Hi David, On Tue, Sep 03, 2013 at 09:02:41AM +0200, David BERARD wrote: > ./haproxy -f /usr/local/etc/haproxy.conf -d > Available polling systems : > kqueue : pref=300, test result OK > poll : pref=200, test result OK > select : pref=150, test result FAILED > Total: 3 (2 usable), will use kqueue. > Using kqueue() as the polling mechanism. > 00000001:ddos.accept(0004)=0006 from [127.0.0.1:12187] > 00000001:ddos.clireq[0006:ffff]: GET / HTTP/1.1 > 00000001:ddos.clihdr[0006:ffff]: User-Agent: curl/7.31.0 > 00000001:ddos.clihdr[0006:ffff]: Host: 127.0.0.1 > 00000001:ddos.clihdr[0006:ffff]: Accept: */* > send_proxy: Socket is not connected
OK that's what was expected. > 00000001:ddos.clicls[0006:0007] > 00000001:ddos.closed[0006:0007] > > > Alternately, could you try the following change : > > > > 471 - if (errno == EAGAIN) > > 471 + if (errno == EAGAIN || errno == ENOTCONN) > > > > With this change send-proxy work well :) Perfect, thank you. I've merged the fix. Another location had to be fixed as well (health checks), so you'd better apply the attached patch than the one above. Thanks, Willy
>From 95742a43aaddf8a262339833688b75b5907f95c6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau <[email protected]> Date: Tue, 3 Sep 2013 09:02:11 +0200 Subject: BUG/MEDIUM: fix broken send_proxy on FreeBSD David Berard reported that send-proxy was broken on FreeBSD and tracked the issue to be an error returned by send(). We already had the same issue in the past in another area which was addressed by the following commit : 0ea0cf6 BUG: raw_sock: also consider ENOTCONN in addition to EAGAIN In fact, on Linux send() returns EAGAIN when the connection is not yet established while other OSes return ENOTCONN. Let's consider ENOTCONN for send-proxy there as the same as EAGAIN. David confirmed that this change properly fixed the issue. Another place was affected as well (health checks with send-proxy), and was fixed. This fix does not need any backport since it only affects 1.5. --- src/connection.c | 2 +- src/stream_interface.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connection.c b/src/connection.c index f86afde..ad523b9 100644 --- a/src/connection.c +++ b/src/connection.c @@ -573,7 +573,7 @@ int conn_local_send_proxy(struct connection *conn, unsigned int flag) goto out_wait; if (ret < 0) { - if (errno == EAGAIN) + if (errno == EAGAIN || errno == ENOTCONN) goto out_wait; goto out_error; } diff --git a/src/stream_interface.c b/src/stream_interface.c index 33f1d0e..6a21c64 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -468,7 +468,7 @@ int conn_si_send_proxy(struct connection *conn, unsigned int flag) goto out_wait; if (ret < 0) { - if (errno == EAGAIN) + if (errno == EAGAIN || errno == ENOTCONN) goto out_wait; goto out_error; } -- 1.7.12.2.21.g234cd45.dirty

