mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:23:39 +03:00
lib: move mimepost data from ->req.p.http to ->state
When the legacy CURLOPT_HTTPPOST option is used, it gets converted into
the modem mimpost struct at first use. This data is (now) kept for the
entire transfer and not only per single HTTP request. This re-enables
rewind in the beginning of the second request instead of in end of the
first, as brought by 1b39731.
The request struct is per-request data only.
Extend test 650 to verify.
Fixes #11680
Reported-by: yushicheng7788 on github
Closes #11682
This commit is contained in:
parent
821d108fc9
commit
74b87a8af1
9 changed files with 157 additions and 45 deletions
13
lib/multi.c
13
lib/multi.c
|
|
@ -1799,9 +1799,8 @@ static CURLcode protocol_connect(struct Curl_easy *data,
|
|||
*/
|
||||
static CURLcode readrewind(struct Curl_easy *data)
|
||||
{
|
||||
struct connectdata *conn = data->conn;
|
||||
curl_mimepart *mimepart = &data->set.mimepost;
|
||||
DEBUGASSERT(conn);
|
||||
DEBUGASSERT(data->conn);
|
||||
|
||||
data->state.rewindbeforesend = FALSE; /* we rewind now */
|
||||
|
||||
|
|
@ -1814,12 +1813,12 @@ static CURLcode readrewind(struct Curl_easy *data)
|
|||
/* We have sent away data. If not using CURLOPT_POSTFIELDS or
|
||||
CURLOPT_HTTPPOST, call app to rewind
|
||||
*/
|
||||
if(conn->handler->protocol & PROTO_FAMILY_HTTP) {
|
||||
struct HTTP *http = data->req.p.http;
|
||||
|
||||
if(http->sendit)
|
||||
mimepart = http->sendit;
|
||||
#ifndef CURL_DISABLE_HTTP
|
||||
if(data->conn->handler->protocol & PROTO_FAMILY_HTTP) {
|
||||
if(data->state.mimepost)
|
||||
mimepart = data->state.mimepost;
|
||||
}
|
||||
#endif
|
||||
if(data->set.postfields ||
|
||||
(data->state.httpreq == HTTPREQ_GET) ||
|
||||
(data->state.httpreq == HTTPREQ_HEAD))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue