mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
based on Jacky Lam's "HTTP 1.0 304-only" fix, this change makes a 304 reply
always stop reading after the headers no matter what 'close' is.
This commit is contained in:
parent
edbe0d166c
commit
5d28a857a4
@ -366,15 +366,12 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
reading! */
|
reading! */
|
||||||
if(-1 != conn->size)
|
if(-1 != conn->size)
|
||||||
conn->maxdownload = conn->size;
|
conn->maxdownload = conn->size;
|
||||||
|
|
||||||
/* If max download size is *zero* (nothing) we already
|
|
||||||
have nothing and can safely return ok now! */
|
|
||||||
if(0 == conn->maxdownload)
|
|
||||||
stop_reading = TRUE;
|
|
||||||
|
|
||||||
/* What to do if the size is *not* known? */
|
|
||||||
}
|
}
|
||||||
|
/* If max download size is *zero* (nothing) we already
|
||||||
|
have nothing and can safely return ok now! */
|
||||||
|
if(0 == conn->maxdownload)
|
||||||
|
stop_reading = TRUE;
|
||||||
|
|
||||||
if(stop_reading) {
|
if(stop_reading) {
|
||||||
/* we make sure that this socket isn't read more now */
|
/* we make sure that this socket isn't read more now */
|
||||||
k->keepon &= ~KEEP_READ;
|
k->keepon &= ~KEEP_READ;
|
||||||
@ -447,6 +444,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
* NOT contain a message-body, and thus is always terminated
|
* NOT contain a message-body, and thus is always terminated
|
||||||
* by the first empty line after the header fields. */
|
* by the first empty line after the header fields. */
|
||||||
conn->size=0;
|
conn->size=0;
|
||||||
|
conn->maxdownload=0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* nothing */
|
/* nothing */
|
||||||
|
Loading…
Reference in New Issue
Block a user