mirror of
https://github.com/curl/curl.git
synced 2026-08-24 21:43:32 +03:00
http: deal with partial CONNECT sends
Also added 'CURL_SMALLSENDS' to make Curl_write() send short packets, which helped verifying this even more. Add test 363 to verify. Reported-by: ustcqidi on github Fixes #6950 Closes #7024
This commit is contained in:
parent
63813a0325
commit
51c0ebcff2
8 changed files with 213 additions and 54 deletions
12
lib/sendf.c
12
lib/sendf.c
|
|
@ -309,6 +309,18 @@ CURLcode Curl_write(struct Curl_easy *data,
|
|||
conn = data->conn;
|
||||
num = (sockfd == conn->sock[SECONDARYSOCKET]);
|
||||
|
||||
#ifdef CURLDEBUG
|
||||
{
|
||||
/* Allow debug builds to override this logic to force short sends
|
||||
*/
|
||||
char *p = getenv("CURL_SMALLSENDS");
|
||||
if(p) {
|
||||
size_t altsize = (size_t)strtoul(p, NULL, 10);
|
||||
if(altsize)
|
||||
len = CURLMIN(len, altsize);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
bytes_written = conn->send[num](data, num, mem, len, &result);
|
||||
|
||||
*written = bytes_written;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue