Improved the logic the decides whether to use HTTP 1.1 features or not in a

request.

Detect cases where an upload must be sent chunked and the server supports
only HTTP 1.0 and return CURLE_UPLOAD_FAILED.
This commit is contained in:
Dan Fandrich
2008-09-05 17:58:53 +00:00
parent 3acd1146f9
commit 91ff938035
12 changed files with 80 additions and 52 deletions

View File

@@ -3,8 +3,3 @@
# test cases are run by runtests.pl. Just add the plain test case numbers, one
# per line.
# Lines starting with '#' letters are treated as comments.
1069
1071
1072
1073
1074

View File

@@ -12,7 +12,7 @@ followlocation
# Server-side
<reply>
<data>
HTTP/1.0 307 Redirect swsclose
HTTP/1.1 307 Redirect swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Location: data/10530002.txt?coolsite=yes
@@ -21,24 +21,28 @@ Connection: close
</data>
<data2>
HTTP/1.0 200 OK swsclose
HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 11
Connection: close
blablabla
</data2>
<datacheck>
HTTP/1.0 307 Redirect swsclose
HTTP/1.1 307 Redirect swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Location: data/10530002.txt?coolsite=yes
Content-Length: 0
Connection: close
HTTP/1.0 200 OK swsclose
HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 11
Connection: close
blablabla

View File

@@ -9,14 +9,6 @@ HTTP/1.0
# Server-side
<reply>
<data>
HTTP/1.0 500 Impossible swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
blablabla
</data>
</reply>
# Client-side

View File

@@ -22,10 +22,9 @@ WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
Content-Type: text/plain
Content-Length: 35
Content-Length: 0
Connection: close
Try again on this HTTP 1.0 server!
</data>
</reply>
@@ -71,6 +70,7 @@ This is data we upload with PUT
it comes from stdin so MUST be sent
with chunked encoding
which is impossible in HTTP/1.0
0
</protocol>

View File

@@ -64,6 +64,7 @@ This is data we upload with PUT
it comes from stdin so MUST be sent
with chunked encoding
which is impossible in HTTP/1.0
0
</protocol>