aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-06-09 07:08:34 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-06-09 07:08:34 +0000
commita05ea124b94475a86542d476977519dcb0518c59 (patch)
treee50d4c6b8d48c48f45528ff159ddadb1140bc1d4 /lib/transfer.c
parent6a03ab3ad4f1835f47a8fcbc6a8b4a070541d4e6 (diff)
oops, serious breakage in the fdset() function
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index bb43c4da9..4aa94364b 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;
}