1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

Andrs Garca 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.
This commit is contained in:
Daniel Stenberg 2002-01-23 07:15:32 +00:00
parent 95ceeb6e0b
commit 2db894807b

View File

@ -356,10 +356,11 @@ CURLcode Curl_readwrite(struct connectdata *conn,
* If we requested a "no body", this is a good time to get * If we requested a "no body", this is a good time to get
* out and return home. * out and return home.
*/ */
if(data->set.no_body) bool stop_reading = FALSE;
return CURLE_OK;
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 /* If this is not the last request before a close, we must
set the maximum download size to the size of the set the maximum download size to the size of the
expected document or else, we won't know when to stop 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 /* If max download size is *zero* (nothing) we already
have nothing and can safely return ok now! */ have nothing and can safely return ok now! */
if(0 == conn->maxdownload) if(0 == conn->maxdownload)
return CURLE_OK; stop_reading = TRUE;
/* What to do if the size is *not* known? */ /* 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 */ break; /* exit header line loop */
} }