aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-05 12:11:03 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-05 12:11:03 +0000
commit44debdde6285d257cbe985ba808d7efe81668b84 (patch)
tree181143460c818fd2a14739487809bdb1b4871048 /lib
parentc6cf2b8e93f867a20f0897f91918ce008bd92e0d (diff)
Better support for being used with the multi interface without the *fd_set()
and proper select()ing have been made.
Diffstat (limited to 'lib')
-rw-r--r--lib/transfer.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index a861e95e7..6d000336b 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -178,8 +178,12 @@ CURLcode Curl_readwrite(struct connectdata *conn,
int didwhat=0;
do {
+ /* If we still have reading to do, we check if we have a readable
+ socket. Sometimes the reafdp is NULL, it no fd_set was done using
+ the multi interface and then we can do nothing but to attempt a
+ read to be sure. */
if((k->keepon & KEEP_READ) &&
- FD_ISSET(conn->sockfd, k->readfdp)) {
+ (!k->readfdp || FD_ISSET(conn->sockfd, k->readfdp))) {
/* read! */
result = Curl_read(conn, conn->sockfd, k->buf,
@@ -746,8 +750,12 @@ CURLcode Curl_readwrite(struct connectdata *conn,
} /* if (! header and data to read ) */
} /* if( read from socket ) */
+ /* If we still have writing to do, we check if we have a writable
+ socket. Sometimes the writefdp is NULL, it no fd_set was done using
+ the multi interface and then we can do nothing but to attempt a
+ write to be sure. */
if((k->keepon & KEEP_WRITE) &&
- FD_ISSET(conn->writesockfd, k->writefdp)) {
+ (!k->writefdp || FD_ISSET(conn->writesockfd, k->writefdp)) ) {
/* write */
int i, si;