From 3e0a95bb78212e9112b00f8dc8b52367ea675c47 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 2 Aug 2001 16:52:12 +0000 Subject: [PATCH] FD_ZERO() the keepfd variables properly when keepon is modified (Tomasz Lacki reported 12 Jul 2001) --- lib/transfer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/transfer.c b/lib/transfer.c index 0374da0..5bdbefd 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -302,6 +302,7 @@ Transfer(struct connectdata *c_conn) we bail out from this! */ else if (0 >= (signed int) nread) { keepon &= ~KEEP_READ; + FD_ZERO(&rkeepfd); break; } @@ -711,6 +712,7 @@ Transfer(struct connectdata *c_conn) else if(CHUNKE_STOP == res) { /* we're done reading chunks! */ keepon &= ~KEEP_READ; /* read no more */ + FD_ZERO(&rkeepfd); /* There are now possibly N number of bytes at the end of the str buffer that weren't written to the client, but we don't @@ -724,7 +726,9 @@ Transfer(struct connectdata *c_conn) nread = conn->maxdownload - bytecount; if((signed int)nread < 0 ) /* this should be unusual */ nread = 0; + keepon &= ~KEEP_READ; /* we're done reading */ + FD_ZERO(&rkeepfd); } bytecount += nread; @@ -758,6 +762,7 @@ Transfer(struct connectdata *c_conn) if ((signed int)nread<=0) { /* done */ keepon &= ~KEEP_WRITE; /* we're done writing */ + FD_ZERO(&wkeepfd); break; } writebytecount += nread; -- 2.7.4