From: Daniel Stenberg Date: Fri, 9 Jun 2006 07:08:34 +0000 (+0000) Subject: oops, serious breakage in the fdset() function X-Git-Tag: curl-7_15_4~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a05ea124b94475a86542d476977519dcb0518c59;p=thirdparty%2Fcurl.git oops, serious breakage in the fdset() function --- diff --git a/lib/transfer.c b/lib/transfer.c index bb43c4da92..4aa94364b5 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1570,11 +1570,12 @@ int Curl_single_getsock(struct connectdata *conn, } if(conn->keep.keepon & KEEP_WRITE) { - if((conn->sockfd != conn->writesockfd) && - (conn->keep.keepon & KEEP_READ)) { - /* only if they are not the same socket and we had a readable one, - we increase index */ - index++; + if((conn->sockfd != conn->writesockfd) || + !(conn->keep.keepon & KEEP_READ)) { + /* only if they are not the same socket or we didn't have a readable + one, we increase index */ + if(conn->keep.keepon & KEEP_READ) + index++; /* increase index if we need two entries */ sock[index] = conn->writesockfd; }