mirror of
https://github.com/curl/curl.git
synced 2026-08-26 20:23:32 +03:00
pause: handle mixed types of data when paused
When receiving chunked encoded data with trailers, and the write callback returns PAUSE, there might be both body and header to store to resend on unpause. Previously libcurl returned error for that case. Added test case 1540 to verify. Reported-by: Stephen Toub Fixes #1354 Closes #1357
This commit is contained in:
parent
7975d10cf8
commit
452203341d
8 changed files with 290 additions and 54 deletions
|
|
@ -532,6 +532,7 @@ static CURLcode multi_done(struct connectdata **connp,
|
|||
CURLcode result;
|
||||
struct connectdata *conn;
|
||||
struct Curl_easy *data;
|
||||
unsigned int i;
|
||||
|
||||
DEBUGASSERT(*connp);
|
||||
|
||||
|
|
@ -598,9 +599,11 @@ static CURLcode multi_done(struct connectdata **connp,
|
|||
}
|
||||
|
||||
/* if the transfer was completed in a paused state there can be buffered
|
||||
data left to write and then kill */
|
||||
free(data->state.tempwrite);
|
||||
data->state.tempwrite = NULL;
|
||||
data left to free */
|
||||
for(i=0; i < data->state.tempcount; i++) {
|
||||
free(data->state.tempwrite[i].buf);
|
||||
}
|
||||
data->state.tempcount = 0;
|
||||
|
||||
/* if data->set.reuse_forbid is TRUE, it means the libcurl client has
|
||||
forced us to close this connection. This is ignored for requests taking
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue