From 290b62c8174370470b72bea1947758c919980196 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Tue, 5 Oct 2010 07:35:02 +0200 Subject: [PATCH] TCP-CONNECT with option nonblock reported successful connect even when it was still pending --- CHANGES | 3 +++ xio-socket.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 6f279dd..9ed08e6 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,9 @@ corrections: UNIX-CONNECT did not support half-close. Thanks to Greg Hughes who pointed me to that bug + TCP-CONNECT with option nonblock reported successful connect even when + it was still pending + ####################### V 1.7.1.3: security: diff --git a/xio-socket.c b/xio-socket.c index 1cfd714..3829e81 100644 --- a/xio-socket.c +++ b/xio-socket.c @@ -910,15 +910,15 @@ int _xioopen_connect(struct single *xfd, struct sockaddr *us, size_t uslen, Close(xfd->fd); return STAT_RETRYLATER; } + } else { /* result >= 0 */ + Notice1("successfully connected from local address %s", + sockaddr_info(&la.soa, themlen, infobuff, sizeof(infobuff))); } applyopts_fchown(xfd->fd, opts); /* OPT_USER, OPT_GROUP */ applyopts(xfd->fd, opts, PH_CONNECTED); applyopts(xfd->fd, opts, PH_LATE); - Notice1("successfully connected from local address %s", - sockaddr_info(&la.soa, themlen, infobuff, sizeof(infobuff))); - return STAT_OK; }