cURL / Mailing Lists / curl-users / Single Mail

curl-users

[ curl-Bugs-852814 ] ignore content-length if transfer-encoding is not identity

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 02 Dec 2003 11:36:11 -0800

Bugs item #852814, was opened at 2003-12-02 11:36
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=852814&group_id=976

Category: http
Group: wrong content
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: ignore content-length if transfer-encoding is not identity

Initial Comment:
I'm using v7.10.8 on linux and my email address is
swalkaus_at_yahoo.com.

RFC2616, section 4.4 states that "Messages MUST NOT
include both a Content-Length header field and a non-
identity transfer-coding. If the message does include a
non- identity transfer-coding, the Content-Length MUST
be ignored." Arguably the first sentence nullifies the
second, however, I've come across a webserver (or
perhaps a proxy) for which the content-length is invalid
but the transfer-encoding is chunked and cURL does not
behave well in this case. I made the following patch
which I did not test thoroughly in transfer.c, around line
680 (ignoring the comments it is a two line fix):
              conn->bits.chunk = TRUE; /* chunks coming
our way */

               /*
                * Quote from RFC2616, Section
4.4: "Messages MUST NOT include
                 * both a Content-Length header field and a
non-identity
                * transfer-coding. If the message does
include a non-identity
               * transfer-coding, the Content-Length MUST
be ignored.
                */
              k->contentlength = 0;
              conn->size = -1;

              /* init our chunky engine */

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=852814&group_id=976

-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
Received on 2003-12-02