From 4efa3c5ebca2a4b8b69f07c895d392473ccdd8c4 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Sun, 22 Jul 2012 16:15:46 +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 c5e7afa..0196fcd 100644 --- a/CHANGES +++ b/CHANGES @@ -44,6 +44,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 + docu mentions option so-bindtodev but correct name is so-bindtodevice. Thanks to Jim Zimmerman for reporting. diff --git a/xio-socket.c b/xio-socket.c index ef2157d..9bfadc4 100644 --- a/xio-socket.c +++ b/xio-socket.c @@ -952,15 +952,15 @@ int _xioopen_connect(struct single *xfd, struct sockaddr *us, size_t uslen, Close(xfd->rfd); return STAT_RETRYLATER; } + } else { /* result >= 0 */ + Notice1("successfully connected from local address %s", + sockaddr_info(&la.soa, themlen, infobuff, sizeof(infobuff))); } applyopts_fchown(xfd->rfd, opts); /* OPT_USER, OPT_GROUP */ applyopts(xfd->rfd, opts, PH_CONNECTED); applyopts(xfd->rfd, opts, PH_LATE); - Notice1("successfully connected from local address %s", - sockaddr_info(&la.soa, themlen, infobuff, sizeof(infobuff))); - return STAT_OK; }