mirror of
https://github.com/moparisthebest/curl
synced 2024-11-12 04:25:08 -05:00
transfer: close connection after excess data has been read
For HTTP 1.x, it's a protocol error when the server sends more bytes than announced. If this happens, don't reuse the connection, because the start position of the next response is undefined. Closes #5440
This commit is contained in:
parent
18e63b1679
commit
3d44bfb08d
@ -838,6 +838,7 @@ static CURLcode readwrite_data(struct Curl_easy *data,
|
||||
", maxdownload = %" CURL_FORMAT_CURL_OFF_T
|
||||
", bytecount = %" CURL_FORMAT_CURL_OFF_T "\n",
|
||||
excess, k->size, k->maxdownload, k->bytecount);
|
||||
connclose(conn, "excess found in a read");
|
||||
}
|
||||
|
||||
nread = (ssize_t) (k->maxdownload - k->bytecount);
|
||||
|
Loading…
Reference in New Issue
Block a user