From: Marko Kreen Date: Wed, 28 Jun 2017 14:58:51 +0000 (+0300) Subject: sbuf: check for EAGAIN in connect X-Git-Tag: pgbouncer_1_8~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f2b3c822f0dbe07d1a6469518bea634ad999696;p=pgbouncer sbuf: check for EAGAIN in connect seems it can be returned in win32 fixes: #188 #161 --- diff --git a/src/sbuf.c b/src/sbuf.c index 8d9cc0a..ed000e6 100644 --- a/src/sbuf.c +++ b/src/sbuf.c @@ -175,7 +175,7 @@ bool sbuf_connect(SBuf *sbuf, const struct sockaddr *sa, int sa_len, int timeout /* unix socket gives connection immediately */ sbuf_connect_cb(sock, EV_WRITE, sbuf); return true; - } else if (errno == EINPROGRESS) { + } else if (errno == EINPROGRESS || errno == EAGAIN) { /* tcp socket needs waiting */ event_set(&sbuf->ev, sock, EV_WRITE, sbuf_connect_cb, sbuf); res = event_add(&sbuf->ev, &timeout);