mirror of
https://github.com/curl/curl.git
synced 2026-07-24 13:37:18 +03:00
Venkat Akella found out that libcurl did not like HTTP responses that simply
responded with a single status line and no headers nor body. Starting now, a HTTP response on a persistent connection (i.e not set to be closed after the response has been taken care of) must have Content-Length or chunked encoding set, or libcurl will simply assume that there is no body. To my horror I learned that we had no less than 57(!) test cases that did bad HTTP responses like this, and even the test http server (sws) responded badly when queried by the test system if it is the test system. So although the actual fix for the problem was tiny, going through all the newly failing test cases got really painful and boring.
This commit is contained in:
parent
9ea3831c08
commit
da58d03ff7
61 changed files with 174 additions and 19 deletions
|
|
@ -501,9 +501,19 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||
k->keepon |= KEEP_WRITE;
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
k->header = FALSE; /* no more header to parse! */
|
||||
|
||||
if((k->size == -1) && !conn->bits.chunk && !conn->bits.close)
|
||||
/* When connection is not to get closed, but no
|
||||
Content-Length nor Content-Encoding chunked have been
|
||||
received, there is no body in this response. We don't set
|
||||
stop_reading TRUE since that would also prevent necessary
|
||||
authentication actions to take place. */
|
||||
conn->bits.no_body = TRUE;
|
||||
|
||||
}
|
||||
|
||||
if (417 == k->httpcode) {
|
||||
/*
|
||||
* we got: "417 Expectation Failed" this means:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue