aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-01-23 07:15:32 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-01-23 07:15:32 +0000
commit2db894807b546087b4e03af5afa0cb07aae6127c (patch)
tree65d5e372228107f363169670e0e1cfd7a66a7573 /lib/transfer.c
parent95ceeb6e0bbb0b3abaf447b236d08ef9c30817df (diff)
Andrés García found out that we didn't properly stop reading from a connection
after the headers on a HEAD request. This bug has been added in 7.9.3 and was mnot present earlier.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index b57560b56..f08e88c8a 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -356,10 +356,11 @@ CURLcode Curl_readwrite(struct connectdata *conn,
* If we requested a "no body", this is a good time to get
* out and return home.
*/
- if(data->set.no_body)
- return CURLE_OK;
+ bool stop_reading = FALSE;
- if(!conn->bits.close) {
+ if(data->set.no_body)
+ stop_reading = TRUE;
+ else if(!conn->bits.close) {
/* If this is not the last request before a close, we must
set the maximum download size to the size of the
expected document or else, we won't know when to stop
@@ -370,10 +371,18 @@ CURLcode Curl_readwrite(struct connectdata *conn,
/* If max download size is *zero* (nothing) we already
have nothing and can safely return ok now! */
if(0 == conn->maxdownload)
- return CURLE_OK;
+ stop_reading = TRUE;
/* What to do if the size is *not* known? */
}
+
+ if(stop_reading) {
+ /* we make sure that this socket isn't read more now */
+ k->keepon &= ~KEEP_READ;
+ FD_ZERO(&k->rkeepfd);
+ return CURLE_OK;
+ }
+
break; /* exit header line loop */
}