mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Mark Lentczner fixed how libcurl was not properly doing chunked encoding
if the header "Transfer-Encoding: chunked" was set by the application. http://curl.haxx.se/bug/view.cgi?id=1531838
This commit is contained in:
parent
fbcdc192d5
commit
8a38c72c48
5
CHANGES
5
CHANGES
@ -6,6 +6,11 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Daniel (2 August 2006)
|
||||||
|
- Mark Lentczner fixed how libcurl was not properly doing chunked encoding
|
||||||
|
if the header "Transfer-Encoding: chunked" was set by the application.
|
||||||
|
http://curl.haxx.se/bug/view.cgi?id=1531838
|
||||||
|
|
||||||
Daniel (1 August 2006)
|
Daniel (1 August 2006)
|
||||||
- Maciej Karpiuk fixed a crash that would occur if we passed Curl_strerror()
|
- Maciej Karpiuk fixed a crash that would occur if we passed Curl_strerror()
|
||||||
an unknown error number on glibc systems.
|
an unknown error number on glibc systems.
|
||||||
|
@ -24,6 +24,7 @@ This release includes the following changes:
|
|||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
|
o chunked encoding when custom header "Transfer-Encoding: chunked" is set
|
||||||
o Curl_strerror() crash on unknown errors
|
o Curl_strerror() crash on unknown errors
|
||||||
o changing Content-Type when doing formposts
|
o changing Content-Type when doing formposts
|
||||||
o added CURL_EXTERN to a few recent multi functions that lacked them
|
o added CURL_EXTERN to a few recent multi functions that lacked them
|
||||||
@ -51,6 +52,6 @@ advice from friends like these:
|
|||||||
Dan Fandrich, Peter Silva, Arve Knudsen, Michael Wallner, Toshiyuki Maezawa,
|
Dan Fandrich, Peter Silva, Arve Knudsen, Michael Wallner, Toshiyuki Maezawa,
|
||||||
Ingmar Runge, Ates Goral, David McCreedy, Jari Sundell, Georg Horn,
|
Ingmar Runge, Ates Goral, David McCreedy, Jari Sundell, Georg Horn,
|
||||||
Gisle Vanem, Yang Tse, Michael Jerris, Dan Nelson, Yves Lejeune,
|
Gisle Vanem, Yang Tse, Michael Jerris, Dan Nelson, Yves Lejeune,
|
||||||
Maciej Karpiuk
|
Maciej Karpiuk, Mark Lentczner
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
31
lib/http.c
31
lib/http.c
@ -1684,30 +1684,17 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
|||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!conn->bits.upload_chunky && (httpreq != HTTPREQ_GET)) {
|
ptr = checkheaders(data, "Transfer-Encoding:");
|
||||||
/* not a chunky transfer yet, but data is to be sent */
|
if(ptr) {
|
||||||
ptr = checkheaders(data, "Transfer-Encoding:");
|
/* Some kind of TE is requested, check if 'chunked' is chosen */
|
||||||
if(ptr) {
|
conn->bits.upload_chunky =
|
||||||
/* Some kind of TE is requested, check if 'chunked' is chosen */
|
Curl_compareheader(ptr, "Transfer-Encoding:", "chunked");
|
||||||
conn->bits.upload_chunky =
|
|
||||||
Curl_compareheader(ptr, "Transfer-Encoding:", "chunked");
|
|
||||||
te = "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(conn->bits.upload_chunky) {
|
else {
|
||||||
/* RFC2616 section 4.4:
|
if (httpreq == HTTPREQ_GET)
|
||||||
Messages MUST NOT include both a Content-Length header field and a
|
conn->bits.upload_chunky = FALSE;
|
||||||
non-identity transfer-coding. If the message does include a non-
|
if(conn->bits.upload_chunky)
|
||||||
identity transfer-coding, the Content-Length MUST be ignored. */
|
|
||||||
|
|
||||||
if(!checkheaders(data, "Transfer-Encoding:")) {
|
|
||||||
te = "Transfer-Encoding: chunked\r\n";
|
te = "Transfer-Encoding: chunked\r\n";
|
||||||
}
|
|
||||||
else {
|
|
||||||
te = "";
|
|
||||||
conn->bits.upload_chunky = FALSE; /* transfer-encoding was disabled,
|
|
||||||
so don't chunkify this! */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Curl_safefree(conn->allocptr.host);
|
Curl_safefree(conn->allocptr.host);
|
||||||
|
Loading…
Reference in New Issue
Block a user