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.
This commit is contained in:
parent
9ea3831c08
commit
da58d03ff7
13
CHANGES
13
CHANGES
@ -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.
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
@ -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>
|
||||
|
@ -6,6 +6,7 @@ HTTP/1.1 401 Authorization Required swsclose
|
||||
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||
WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
This is not the real page
|
||||
</data1>
|
||||
@ -95,6 +96,7 @@ HTTP/1.1 401 Authorization Required swsclose
|
||||
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||
WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||
|
@ -33,6 +33,7 @@ This is not the real page either!
|
||||
HTTP/1.1 200 Type-3 Recevied and all Things are fine swsclose
|
||||
Server: Microsoft-IIS/5.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 32
|
||||
|
||||
Finally, this is the real page!
|
||||
</data1002>
|
||||
@ -55,6 +56,7 @@ WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4Ab
|
||||
HTTP/1.1 200 Type-3 Recevied and all Things are fine swsclose
|
||||
Server: Microsoft-IIS/5.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 32
|
||||
|
||||
Finally, this is the real page!
|
||||
</datacheck>
|
||||
|
@ -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>
|
||||
|
@ -4,6 +4,7 @@
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Length: 10
|
||||
|
||||
blablabla
|
||||
</data>
|
||||
|
@ -4,6 +4,7 @@
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Length: 10
|
||||
|
||||
blablabla
|
||||
</data>
|
||||
|
@ -9,6 +9,7 @@ WWW-Authenticate: Digest realm="weirdorealm", nonce="12345"
|
||||
<data1000>
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Server: no
|
||||
Content-Length: 15
|
||||
|
||||
Nice auth sir!
|
||||
</data1000>
|
||||
@ -19,6 +20,7 @@ WWW-Authenticate: Digest realm="weirdorealm", nonce="12345"
|
||||
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Server: no
|
||||
Content-Length: 15
|
||||
|
||||
Nice auth sir!
|
||||
</datacheck>
|
||||
|
@ -20,6 +20,7 @@ you should ignore this data too
|
||||
<data1001>
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Server: no
|
||||
Content-Length: 15
|
||||
|
||||
Nice auth sir!
|
||||
</data1001>
|
||||
@ -33,6 +34,7 @@ WWW-Authenticate: Digest realm="realmweirdo", nonce="123456"
|
||||
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Server: no
|
||||
Content-Length: 15
|
||||
|
||||
Nice auth sir!
|
||||
</datacheck>
|
||||
|
@ -4,6 +4,7 @@
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Length: 11
|
||||
|
||||
blablabla
|
||||
|
||||
|
@ -5,6 +5,7 @@ HTTP/1.1 200 beng swsclose
|
||||
Server: Microsoft-IIS/6.0
|
||||
Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
This is not the real page
|
||||
</data>
|
||||
|
@ -13,6 +13,7 @@ This is not the real page
|
||||
HTTP/1.1 200 moo swsclose
|
||||
Server: Microsoft-IIS/6.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 16
|
||||
|
||||
content for you
|
||||
</data1>
|
||||
@ -26,6 +27,7 @@ Content-Type: text/html; charset=iso-8859-1
|
||||
HTTP/1.1 200 moo swsclose
|
||||
Server: Microsoft-IIS/6.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 16
|
||||
|
||||
content for you
|
||||
</datacheck>
|
||||
|
@ -14,6 +14,7 @@ Content-Type: text/html; charset=iso-8859-1
|
||||
HTTP/1.1 200 moo swsclose
|
||||
Server: Microsoft-IIS/6.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 16
|
||||
|
||||
content for you
|
||||
</data>
|
||||
@ -27,6 +28,7 @@ Content-Type: text/html; charset=iso-8859-1
|
||||
HTTP/1.1 200 moo swsclose
|
||||
Server: Microsoft-IIS/6.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 16
|
||||
|
||||
content for you
|
||||
</datacheck>
|
||||
|
@ -4,6 +4,7 @@
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Length: 11
|
||||
|
||||
blablabla
|
||||
|
||||
|
@ -14,6 +14,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
|
||||
|
||||
@ -28,6 +29,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
|
||||
|
||||
|
@ -28,6 +28,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</data2>
|
||||
@ -47,6 +48,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</datacheck>
|
||||
|
@ -19,6 +19,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</data2>
|
||||
@ -38,6 +39,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</datacheck>
|
||||
|
@ -16,7 +16,7 @@ Hey you, authenticate or go away!
|
||||
HTTP/1.1 200 Things are fine in proxy land swsclose
|
||||
Server: Microsoft-IIS/5.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length; 42
|
||||
Content-Length: 42
|
||||
|
||||
Contents of that page you requested, sir.
|
||||
</data1002>
|
||||
@ -29,7 +29,7 @@ Content-Length: 34
|
||||
HTTP/1.1 200 Things are fine in proxy land swsclose
|
||||
Server: Microsoft-IIS/5.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length; 42
|
||||
Content-Length: 42
|
||||
|
||||
Contents of that page you requested, sir.
|
||||
</datacheck>
|
||||
|
@ -36,7 +36,7 @@ Hey you, authenticate or go away!
|
||||
HTTP/1.1 200 Things are fine in proxy land swsclose
|
||||
Server: Microsoft-IIS/5.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length; 42
|
||||
Content-Length: 42
|
||||
|
||||
Contents of that page you requested, sir.
|
||||
</data1002>
|
||||
@ -57,7 +57,7 @@ Content-Length: 34
|
||||
HTTP/1.1 200 Things are fine in proxy land swsclose
|
||||
Server: Microsoft-IIS/5.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length; 42
|
||||
Content-Length: 42
|
||||
|
||||
Contents of that page you requested, sir.
|
||||
</datacheck>
|
||||
|
@ -31,6 +31,7 @@ If this is received, the location following worked
|
||||
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
|
||||
|
||||
@ -50,6 +51,7 @@ Location: http://athird.com/2570003
|
||||
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
|
||||
|
||||
|
@ -7,7 +7,7 @@ HTTP GET
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 Mooo swsclose
|
||||
HTTP/1.0 200 Mooo swsclose
|
||||
Server: test-server/fake
|
||||
Connection: close
|
||||
|
||||
|
@ -12,6 +12,7 @@ HTTP proxy Basic auth
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Content-Type: text/html
|
||||
Content-Length: 26
|
||||
|
||||
the content would go here
|
||||
</data>
|
||||
|
@ -28,6 +28,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>
|
||||
@ -42,6 +43,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>
|
||||
|
@ -11,6 +11,7 @@ cookies
|
||||
HTTP/1.1 200 Mooo swsclose
|
||||
Connection: close
|
||||
Set-Cookie: path=/; thewinneris=nowayyouwin;
|
||||
Content-Length: 8
|
||||
|
||||
*flopp*
|
||||
</data>
|
||||
|
@ -23,6 +23,7 @@ This is not the real page
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 23
|
||||
|
||||
This IS the real page!
|
||||
</data1000>
|
||||
@ -37,6 +38,7 @@ Content-Type: text/html; charset=iso-8859-1
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 23
|
||||
|
||||
This IS the real page!
|
||||
</datacheck>
|
||||
|
@ -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
|
||||
|
||||
|
@ -10,6 +10,7 @@ HTTP FORMPOST
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Length: 11
|
||||
|
||||
blablabla
|
||||
|
||||
|
@ -12,6 +12,7 @@ HTTP proxy Basic auth
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Content-Type: text/html
|
||||
Content-Length: 27
|
||||
|
||||
the content would go here
|
||||
</data>
|
||||
|
@ -12,6 +12,7 @@ HTTP proxy Basic auth
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Content-Type: text/html
|
||||
Content-Length: 27
|
||||
|
||||
the content would go here
|
||||
</data>
|
||||
|
@ -20,6 +20,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
|
||||
|
||||
@ -34,6 +35,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
|
||||
|
||||
|
@ -50,7 +50,7 @@ Weird
|
||||
</strip>
|
||||
<protocol>
|
||||
PUT /we/want/281 HTTP/1.1
|
||||
Host: 127.0.0.1:%HTTPPORT
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
Content-Length: 38
|
||||
Expect: 100-continue
|
||||
|
43
tests/data/test282
Normal file
43
tests/data/test282
Normal file
@ -0,0 +1,43 @@
|
||||
<info>
|
||||
<keywords>
|
||||
HTTP
|
||||
HTTP GET
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
</data>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
<name>
|
||||
HTTP GET with no response body or headers
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPPORT/282
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<strip>
|
||||
^User-Agent:.*
|
||||
</strip>
|
||||
<protocol>
|
||||
GET /282 HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
|
||||
</protocol>
|
||||
</verify>
|
@ -22,6 +22,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
|
||||
|
||||
@ -36,6 +37,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
|
||||
|
||||
|
@ -8,7 +8,7 @@ HTTP replaced headers
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 OK swsclose
|
||||
HTTP/1.0 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Length: 3
|
||||
|
||||
OK
|
||||
</data>
|
||||
@ -36,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/515
|
||||
</strip>
|
||||
<protocol>
|
||||
POST /515 HTTP/1.1
|
||||
Host: 127.0.0.1:%HTTPPORT
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
Content-Length: 0
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
|
@ -5,6 +5,7 @@
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Length: 3
|
||||
|
||||
OK
|
||||
</data>
|
||||
@ -36,7 +37,7 @@ http://%HOSTIP:%HTTPPORT/516
|
||||
</strip>
|
||||
<protocol>
|
||||
POST /516 HTTP/1.1
|
||||
Host: 127.0.0.1:%HTTPPORT
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
Content-Length: 0
|
||||
|
||||
|
@ -9,7 +9,7 @@ chunked Transfer-Encoding
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 OK swsclose
|
||||
HTTP/1.0 200 OK swsclose
|
||||
Funny-head: yesyes
|
||||
|
||||
This is the proof it works
|
||||
|
@ -8,7 +8,7 @@ HTTP GET
|
||||
# Server-side
|
||||
<reply name="1">
|
||||
<data>
|
||||
HTTP/1.1 200 OK swsclose
|
||||
HTTP/1.0 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
|
||||
|
@ -8,7 +8,7 @@ HTTP replaced headers
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 OK swsclose
|
||||
HTTP/1.0 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Content-Type: text/html
|
||||
|
||||
|
@ -12,6 +12,7 @@ HTTP proxy Basic auth
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Content-Type: text/html
|
||||
Content-Length: 26
|
||||
|
||||
the content would go here
|
||||
</data>
|
||||
|
@ -12,6 +12,7 @@ HTTP/1.1 401 Authorization Required swsclose
|
||||
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||
WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
This is not the real page
|
||||
</data>
|
||||
@ -22,6 +23,7 @@ This is not the real page
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 23
|
||||
|
||||
This IS the real page!
|
||||
</data1000>
|
||||
@ -31,10 +33,12 @@ HTTP/1.1 401 Authorization Required swsclose
|
||||
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||
WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 23
|
||||
|
||||
This IS the real page!
|
||||
</datacheck>
|
||||
|
@ -28,6 +28,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>
|
||||
@ -42,6 +43,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>
|
||||
|
@ -14,6 +14,7 @@ WWW-Authenticate: Basic
|
||||
WWW-Authenticate: Wild-and-crazy
|
||||
WWW-Authenticate: NTLM
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
This is not the real page
|
||||
</data>
|
||||
@ -36,6 +37,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>
|
||||
@ -47,6 +49,7 @@ WWW-Authenticate: Basic
|
||||
WWW-Authenticate: Wild-and-crazy
|
||||
WWW-Authenticate: NTLM
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
HTTP/1.1 401 Now gimme that second request of crap
|
||||
Server: Microsoft-IIS/5.0
|
||||
@ -57,6 +60,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>
|
||||
|
@ -10,6 +10,7 @@ HTTP FORMPOST
|
||||
HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Length: 11
|
||||
|
||||
blablabla
|
||||
|
||||
|
@ -12,6 +12,7 @@ HTTP/1.1 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Content-Type: text/html
|
||||
Set-Cookie: IPCZQX01af0fca5c=000010008168c200d25dfc4b; path=/; domain=.NOT_DISCLOSED.se
|
||||
Content-Length: 4
|
||||
|
||||
boo
|
||||
</data>
|
||||
|
@ -10,7 +10,7 @@ HTTP proxy
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 OK
|
||||
HTTP/1.0 200 OK
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
|
@ -16,6 +16,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</data>
|
||||
@ -27,6 +28,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</datacheck>
|
||||
|
@ -26,6 +26,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>
|
||||
@ -40,6 +41,7 @@ Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4
|
||||
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>
|
||||
|
@ -16,6 +16,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</data>
|
||||
@ -27,6 +28,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</datacheck>
|
||||
|
@ -10,7 +10,7 @@ HTTP proxy
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 OK
|
||||
HTTP/1.0 200 OK
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
|
@ -15,6 +15,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</data>
|
||||
|
@ -50,6 +50,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!
|
||||
</data1012>
|
||||
@ -75,6 +76,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>
|
||||
|
@ -8,7 +8,7 @@ HTTP file upload
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 OK swsclose
|
||||
HTTP/1.0 200 OK swsclose
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
|
||||
|
@ -17,6 +17,7 @@ WWW-Authenticate: Basic
|
||||
WWW-Authenticate: Wild-and-crazy
|
||||
WWW-Authenticate: NTLM
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
This is not the real page
|
||||
</data>
|
||||
@ -51,6 +52,7 @@ WWW-Authenticate: Basic
|
||||
WWW-Authenticate: Wild-and-crazy
|
||||
WWW-Authenticate: NTLM
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
This is not the real page
|
||||
</data10>
|
||||
@ -71,6 +73,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!
|
||||
</data1012>
|
||||
@ -82,6 +85,7 @@ WWW-Authenticate: Basic
|
||||
WWW-Authenticate: Wild-and-crazy
|
||||
WWW-Authenticate: NTLM
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
HTTP/1.1 401 Now gimme that second request of crap
|
||||
Server: Microsoft-IIS/5.0
|
||||
@ -100,6 +104,7 @@ WWW-Authenticate: Basic
|
||||
WWW-Authenticate: Wild-and-crazy
|
||||
WWW-Authenticate: NTLM
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
Content-Length: 26
|
||||
|
||||
HTTP/1.1 401 Now gimme that second round of crap
|
||||
Server: Microsoft-IIS/5.0
|
||||
@ -110,6 +115,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>
|
||||
|
@ -37,6 +37,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>
|
||||
@ -60,6 +61,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>
|
||||
|
@ -14,6 +14,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</data>
|
||||
@ -25,6 +26,7 @@ Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Content-Length: 9
|
||||
|
||||
contents
|
||||
</datacheck>
|
||||
|
@ -572,6 +572,9 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
|
||||
req->open = FALSE;
|
||||
|
||||
if(req->testno < 0) {
|
||||
size_t msglen;
|
||||
char msgbuf[64];
|
||||
|
||||
switch(req->testno) {
|
||||
case DOCNUMBER_QUIT:
|
||||
logmsg("Replying to QUIT");
|
||||
@ -580,8 +583,10 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
|
||||
case DOCNUMBER_WERULEZ:
|
||||
/* we got a "friends?" question, reply back that we sure are */
|
||||
logmsg("Identifying ourselves as friends");
|
||||
sprintf(weare, "HTTP/1.1 200 OK\r\n\r\nWE ROOLZ: %d\r\n",
|
||||
(int)getpid());
|
||||
sprintf(msgbuf, "WE ROOLZ: %d\r\n", (int)getpid());
|
||||
msglen = strlen(msgbuf);
|
||||
sprintf(weare, "HTTP/1.1 200 OK\r\nContent-Length: %d\r\n\r\n%s",
|
||||
msglen, msgbuf);
|
||||
buffer = weare;
|
||||
break;
|
||||
case DOCNUMBER_INTERNAL:
|
||||
|
Loading…
x
Reference in New Issue
Block a user