Commit da58d03f authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Venkat Akella found out that libcurl did not like HTTP responses that simply

responded with a single status line and no headers nor body. Starting now, a
HTTP response on a persistent connection (i.e not set to be closed after the
response has been taken care of) must have Content-Length or chunked
encoding set, or libcurl will simply assume that there is no body.

To my horror I learned that we had no less than 57(!) test cases that did bad
HTTP responses like this, and even the test http server (sws) responded badly
when queried by the test system if it is the test system. So although the
actual fix for the problem was tiny, going through all the newly failing test
cases got really painful and boring.
parent 9ea3831c
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -6,6 +6,19 @@

                                  Changelog

Daniel (25 November 2006)
- Venkat Akella found out that libcurl did not like HTTP responses that simply
  responded with a single status line and no headers nor body. Starting now, a
  HTTP response on a persistent connection (i.e not set to be closed after the
  response has been taken care of) must have Content-Length or chunked
  encoding set, or libcurl will simply assume that there is no body.

  To my horror I learned that we had no less than 57(!) test cases that did bad
  HTTP responses like this, and even the test http server (sws) responded badly
  when queried by the test system if it is the test system. So although the
  actual fix for the problem was tiny, going through all the newly failing test
  cases got really painful and boring.

Daniel (24 November 2006)
- James Housley did lots of work and introduced SFTP downloads.

+3 −1
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ This release includes the following bugfixes:
 o SIGSEGV when disconnecting on a transfer on a re-used handle when the
   host name didn't resolve
 o stack overwrite on 64bit Windows in the chunked decoding department
 o HTTP responses on persistent connections without Content-Length nor chunked
   encoding are now considered to be without response body

Other curl-related news:

@@ -38,6 +40,6 @@ This release would not have looked like this without help, code, reports and
advice from friends like these:

 James Housley, Olaf Stueben, Yang Tse, Gisle Vanem, Bradford Bruce,
 Ciprian Badescu, Dmitriy Sergeyev, Nir Soffer
 Ciprian Badescu, Dmitriy Sergeyev, Nir Soffer, Venkat Akella

        Thanks! (and sorry if I forgot to mention someone)
+11 −1
Original line number Diff line number Diff line
@@ -501,9 +501,19 @@ CURLcode Curl_readwrite(struct connectdata *conn,
                  k->keepon |= KEEP_WRITE;
                }
              }
              else
              else {
                k->header = FALSE; /* no more header to parse! */

                if((k->size == -1) && !conn->bits.chunk && !conn->bits.close)
                  /* When connection is not to get closed, but no
                     Content-Length nor Content-Encoding chunked have been
                     received, there is no body in this response. We don't set
                     stop_reading TRUE since that would also prevent necessary
                     authentication actions to take place. */
                  conn->bits.no_body = TRUE;

              }

              if (417 == k->httpcode) {
                /*
                 * we got: "417 Expectation Failed" this means:
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ This server reply is for testing a simple Location: following
HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked

@@ -35,6 +36,7 @@ Connection: close
HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked

+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ This is not the real page either!
HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!
</data1002>
@@ -35,6 +36,7 @@ WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4Ab
HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!
</datacheck>
Loading