mirror of
https://github.com/curl/curl.git
synced 2026-08-25 01:33:31 +03:00
Revert "mime: do not perform more than one read in a row"
This reverts commit ed0f357f7d.
This commit is contained in:
parent
e002f6c0cb
commit
d7242f4757
15 changed files with 77 additions and 679 deletions
|
|
@ -85,7 +85,7 @@ test626 test627 test628 test629 test630 test631 test632 test633 test634 \
|
|||
test635 test636 test637 test638 test639 test640 test641 test642 \
|
||||
test643 test644 test645 test646 test647 test648 test649 test650 test651 \
|
||||
test652 test653 test654 test655 test656 test658 test659 test660 test661 \
|
||||
test662 test663 test664 test665 \
|
||||
test662 test663 \
|
||||
test670 test671 test672 test673 \
|
||||
\
|
||||
test700 test701 test702 test703 test704 test705 test706 test707 test708 \
|
||||
|
|
|
|||
|
|
@ -69,18 +69,18 @@ s/boundary=------------------------[a-z0-9]*/boundary=--------------------------
|
|||
POST /643 HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
Content-Length: 640
|
||||
Content-Length: 718
|
||||
Content-Type: multipart/form-data; boundary=----------------------------
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
|
||||
|
||||
dummy
|
||||
this is what we post to the silly web server
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="callbackdata"
|
||||
|
||||
dummy
|
||||
this is what we post to the silly web server
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="filename"
|
||||
|
|
@ -99,18 +99,18 @@ blah blah
|
|||
POST /643 HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
Content-Length: 654
|
||||
Content-Length: 732
|
||||
Content-Type: multipart/form-data; boundary=----------------------------
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"
|
||||
|
||||
dummy
|
||||
this is what we post to the silly web server
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="callbackdata"
|
||||
|
||||
dummy
|
||||
this is what we post to the silly web server
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="filename"
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ s/boundary=------------------------[a-z0-9]*/boundary=--------------------------
|
|||
POST /644 HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
Content-Length: 640
|
||||
Content-Length: 718
|
||||
Content-Type: multipart/form-data; boundary=----------------------------
|
||||
|
||||
------------------------------
|
||||
|
|
|
|||
|
|
@ -73,42 +73,16 @@ Transfer-Encoding: chunked
|
|||
Content-Type: multipart/form-data; boundary=----------------------------
|
||||
Expect: 100-continue
|
||||
|
||||
76
|
||||
2ce
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
|
||||
|
||||
d
|
||||
1
|
||||
u
|
||||
1
|
||||
m
|
||||
1
|
||||
m
|
||||
1
|
||||
y
|
||||
1
|
||||
|
||||
|
||||
65
|
||||
this is what we post to the silly web server
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="callbackdata"
|
||||
|
||||
|
||||
1
|
||||
d
|
||||
1
|
||||
u
|
||||
1
|
||||
m
|
||||
1
|
||||
m
|
||||
1
|
||||
y
|
||||
1
|
||||
|
||||
|
||||
19a
|
||||
this is what we post to the silly web server
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="filename"
|
||||
|
|
@ -134,42 +108,16 @@ Transfer-Encoding: chunked
|
|||
Content-Type: multipart/form-data; boundary=----------------------------
|
||||
Expect: 100-continue
|
||||
|
||||
84
|
||||
2dc
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"
|
||||
|
||||
d
|
||||
1
|
||||
u
|
||||
1
|
||||
m
|
||||
1
|
||||
m
|
||||
1
|
||||
y
|
||||
1
|
||||
|
||||
|
||||
65
|
||||
this is what we post to the silly web server
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="callbackdata"
|
||||
|
||||
|
||||
1
|
||||
d
|
||||
1
|
||||
u
|
||||
1
|
||||
m
|
||||
1
|
||||
m
|
||||
1
|
||||
y
|
||||
1
|
||||
|
||||
|
||||
19a
|
||||
this is what we post to the silly web server
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="filename"
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ Transfer-Encoding: chunked
|
|||
Content-Type: multipart/form-data; boundary=----------------------------
|
||||
Expect: 100-continue
|
||||
|
||||
361
|
||||
60a
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="fieldname"
|
||||
Content-Type: text/plain
|
||||
|
|
@ -89,16 +89,12 @@ This is data from a file.
|
|||
Content-Disposition: attachment; filename="test650.filedata"
|
||||
Content-Type: text/whatever
|
||||
|
||||
|
||||
a5
|
||||
This is data from a file.
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: attachment; filename="test650.filedata"
|
||||
Content-Type: text/whatever
|
||||
|
||||
|
||||
af
|
||||
This is data from a file.
|
||||
|
||||
--------------------------------
|
||||
|
|
@ -106,8 +102,6 @@ This is data from a file.
|
|||
------------------------------
|
||||
Content-Disposition: form-data; name="filecontents"
|
||||
|
||||
|
||||
10f
|
||||
This is data from a file.
|
||||
|
||||
------------------------------
|
||||
|
|
@ -118,12 +112,8 @@ Content-Disposition: form-data; name="formlength"
|
|||
Content-Disposition: form-data; name="standardinput"
|
||||
Content-Type: application/octet-stream
|
||||
|
||||
|
||||
16
|
||||
Some data from stdin
|
||||
|
||||
30
|
||||
|
||||
--------------------------------
|
||||
|
||||
0
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ Transfer-Encoding: chunked
|
|||
Content-Type: multipart/form-data; boundary=----------------------------
|
||||
Expect: 100-continue
|
||||
|
||||
1af
|
||||
20c
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="greeting"
|
||||
Content-Type: application/X-Greeting
|
||||
|
|
@ -98,21 +98,7 @@ This is data from a file
|
|||
------------------------------
|
||||
Content-Disposition: form-data
|
||||
|
||||
|
||||
1
|
||||
d
|
||||
1
|
||||
u
|
||||
1
|
||||
m
|
||||
1
|
||||
m
|
||||
1
|
||||
y
|
||||
1
|
||||
|
||||
|
||||
30
|
||||
this is what we post to the silly web server
|
||||
|
||||
--------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,85 +0,0 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
HTTP
|
||||
HTTP POST
|
||||
HTTP MIME POST
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 OK
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
hello
|
||||
</data>
|
||||
<datacheck>
|
||||
HTTP/1.1 200 OK
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
hello
|
||||
</datacheck>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
# tool is what to use instead of 'curl'
|
||||
<tool>
|
||||
lib664
|
||||
</tool>
|
||||
|
||||
<name>
|
||||
HTTP chunked mimepost using single-byte read callback with encoder
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPPORT/664
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<strippart>
|
||||
s/^--------------------------[a-z0-9]*/------------------------------/
|
||||
s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
|
||||
</strippart>
|
||||
# Note that the stripping above removes 12 bytes from every occurrence of the
|
||||
# boundary string and since 5 of them are in the body contents, we see
|
||||
# (5*12) == 60 bytes less
|
||||
<protocol>
|
||||
POST /664 HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
Transfer-Encoding: chunked
|
||||
Content-Type: multipart/form-data; boundary=----------------------------
|
||||
Expect: 100-continue
|
||||
|
||||
7f
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="field"
|
||||
Content-Transfer-Encoding: base64
|
||||
|
||||
|
||||
4
|
||||
ZHVt
|
||||
34
|
||||
bXk=
|
||||
--------------------------------
|
||||
|
||||
0
|
||||
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
HTTP
|
||||
HTTP POST
|
||||
HTTP MIME POST
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
HTTP/1.1 200 OK
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
hello
|
||||
</data>
|
||||
<datacheck>
|
||||
HTTP/1.1 200 OK
|
||||
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake swsclose
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
hello
|
||||
</datacheck>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
# tool is what to use instead of 'curl'
|
||||
<tool>
|
||||
lib665
|
||||
</tool>
|
||||
|
||||
<name>
|
||||
HTTP mimepost early end of data detection
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPPORT/665
|
||||
</command>
|
||||
<file name="log/file665.txt">
|
||||
This is data from a file
|
||||
</file>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<strippart>
|
||||
s/^--------------------------[a-z0-9]*/------------------------------/
|
||||
s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
|
||||
</strippart>
|
||||
# Note that the stripping above removes 12 bytes from every occurrence of the
|
||||
# boundary string and since 5 of them are in the body contents, we see
|
||||
# (5*12) == 60 bytes less
|
||||
<protocol>
|
||||
POST /665 HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
Transfer-Encoding: chunked
|
||||
Content-Type: multipart/form-data; boundary=----------------------------
|
||||
Expect: 100-continue
|
||||
|
||||
c1
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="field1"
|
||||
|
||||
dummy
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="field2"
|
||||
|
||||
|
||||
5
|
||||
dummy
|
||||
91
|
||||
|
||||
------------------------------
|
||||
Content-Disposition: form-data; name="field3"; filename="file665.txt"
|
||||
Content-Type: text/plain
|
||||
|
||||
|
||||
49
|
||||
This is data from a file
|
||||
|
||||
--------------------------------
|
||||
|
||||
0
|
||||
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
||||
Loading…
Add table
Add a link
Reference in a new issue