]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG: raw_sock: also consider ENOTCONN in addition to EAGAIN
authorWilly Tarreau <w@1wt.eu>
Sun, 11 Nov 2012 19:38:30 +0000 (20:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 11 Nov 2012 19:53:28 +0000 (20:53 +0100)
A failed send() may return ENOTCONN when the connection is not yet established.
On Linux, we generally see EAGAIN but on OpenBSD we clearly have ENOTCONN, so
let's ensure we poll for write when we encounter this error.

src/raw_sock.c

index 52a48a5e4ee06e6bbf0e30e0fc255cba54c6c759..b7c9f2b7305fc3442ae88548e14695a052d00384 100644 (file)
@@ -329,7 +329,7 @@ static int raw_sock_from_buf(struct connection *conn, struct buffer *buf, int fl
                        if (ret < try)
                                break;
                }
-               else if (ret == 0 || errno == EAGAIN) {
+               else if (ret == 0 || errno == EAGAIN || errno == ENOTCONN) {
                        /* nothing written, we need to poll for write first */
                        __conn_data_poll_send(conn);
                        break;