mirror of
https://github.com/curl/curl.git
synced 2026-08-25 05:23:32 +03:00
if an empty 'transfer-encoding:' header is provided, we switch off the
chunky coding of uploads
This commit is contained in:
parent
e97ce57d0b
commit
cc90a235f4
1 changed files with 7 additions and 7 deletions
14
lib/http.c
14
lib/http.c
|
|
@ -1123,17 +1123,16 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||||
conn->allocptr.cookie = NULL;
|
conn->allocptr.cookie = NULL;
|
||||||
|
|
||||||
if(!conn->bits.upload_chunky && (data->set.httpreq != HTTPREQ_GET)) {
|
if(!conn->bits.upload_chunky && (data->set.httpreq != HTTPREQ_GET)) {
|
||||||
/* not a chunky transfer but data is to be sent */
|
/* not a chunky transfer yet, but data is to be sent */
|
||||||
ptr = checkheaders(data, "Transfer-Encoding:");
|
ptr = checkheaders(data, "Transfer-Encoding:");
|
||||||
if(ptr) {
|
if(ptr) {
|
||||||
/* Some kind of TE is requested, check if 'chunked' is chosen */
|
/* Some kind of TE is requested, check if 'chunked' is chosen */
|
||||||
if(Curl_compareheader(ptr, "Transfer-Encoding:", "chunked"))
|
conn->bits.upload_chunky =
|
||||||
/* we have been told explicitly to upload chunky so deal with it! */
|
Curl_compareheader(ptr, "Transfer-Encoding:", "chunked");
|
||||||
conn->bits.upload_chunky = TRUE;
|
te = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(conn->bits.upload_chunky) {
|
||||||
if(conn->bits.upload_chunky) {
|
|
||||||
/* RFC2616 section 4.4:
|
/* RFC2616 section 4.4:
|
||||||
Messages MUST NOT include both a Content-Length header field and a
|
Messages MUST NOT include both a Content-Length header field and a
|
||||||
non-identity transfer-coding. If the message does include a non-
|
non-identity transfer-coding. If the message does include a non-
|
||||||
|
|
@ -1143,8 +1142,9 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||||
te = "Transfer-Encoding: chunked\r\n";
|
te = "Transfer-Encoding: chunked\r\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* The "Transfer-Encoding:" header was already added. */
|
|
||||||
te = "";
|
te = "";
|
||||||
|
conn->bits.upload_chunky = FALSE; /* transfer-encoding was disabled,
|
||||||
|
so don't chunkify this! */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue