curl: support parallel transfers

This is done by making sure each individual transfer is first added to a
linked list as then they can be performed serially, or at will, in
parallel.

Closes #3804
This commit is contained in:
Daniel Stenberg 2019-07-20 19:14:00 +02:00
parent 14a385b3ae
commit b889408500
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
34 changed files with 1517 additions and 800 deletions

View file

@ -101,6 +101,14 @@ Content-Length: 3
Expect: 100-continue
st
GET http://%HOSTIP:%HTTPPORT/1002.upload2 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Content-Range: bytes 2-4/5
User-Agent: curl/7.16.1
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 0
GET http://%HOSTIP:%HTTPPORT/1002.upload2 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1002.upload2", response="d711f0d2042786d930de635ba0d1a1d0"

View file

@ -21,7 +21,7 @@ HTTP PUT
none
</server>
<name>
Attempt to upload 100K files but fail immediately
Attempt to upload 1000 files but fail immediately
</name>
<command>
-K log/cmd1291 --fail-early
@ -31,7 +31,7 @@ XXXXXXXx
</file>
# generate the config file
<precheck>
perl -e 'for(1 .. 100000) { printf("upload-file=log/upload-this\nurl=htttttp://non-existing-host.haxx.se/upload/1291\n", $_);}' > log/cmd1291;
perl -e 'for(1 .. 1000) { printf("upload-file=log/upload-this\nurl=htttttp://non-existing-host.haxx.se/upload/1291\n", $_);}' > log/cmd1291;
</precheck>
</client>
@ -40,11 +40,5 @@ perl -e 'for(1 .. 100000) { printf("upload-file=log/upload-this\nurl=htttttp://n
<errorcode>
1
</errorcode>
# we disable valgrind here since it takes 40+ seconds even on a fairly snappy
# machine
<valgrind>
disable
</valgrind>
</verify>
</testcase>

View file

@ -76,13 +76,13 @@ int main(int argc, char *argv[])
hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)38);
curl_easy_setopt(hnd, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/1406");
curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
curl_easy_setopt(hnd, CURLOPT_MAIL_FROM, "sender@example.com");
curl_easy_setopt(hnd, CURLOPT_MAIL_RCPT, slist1);
curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)38);
/* Here is a list of options the curl code used that cannot get generated
as source easily. You may select to either not use them or implement

View file

@ -25,6 +25,19 @@ Connection: close
This is not the real page
</data>
# The second URL will get this response
<data1>
HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
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/html; charset=iso-8859-1
Connection: close
This is not the real page
</data1>
# This is supposed to be returned when the server gets a
# Authorization: Digest line passed-in from the client
<data1000>
@ -107,6 +120,11 @@ Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce=
User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Accept: */*
GET /14120001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Accept: */*
GET /14120001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/14120001", response="0085df91870374c8bf4e94415e7fbf8e"

View file

@ -22,6 +22,15 @@ WWW-Authenticate: Basic
Please auth with me
</data>
<data3>
HTTP/1.1 401 Authentication please!
Content-Length: 20
WWW-Authenticate: Digest realm="loonie", nonce="314156592"
WWW-Authenticate: Basic
Please auth with me
</data3>
# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client
<data1000>
@ -97,6 +106,10 @@ Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/1418", response="986238b7e0077754944c966f56d9bc77"
Accept: */*
GET /14180003 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
GET /14180003 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/14180003", response="1c6390a67bac3283a9b023402f3b3540"

View file

@ -9,7 +9,7 @@ HTTP Digest auth
# Server-side
<reply>
# reply back and ask for Digest auth
# First reply back and ask for Digest auth
<data1>
HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
@ -20,6 +20,17 @@ Content-Length: 26
This is not the real page
</data1>
# second reply back
<data2>
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
</data2>
# This is supposed to be returned when the server gets a
# Authorization: Digest line passed-in from the client
<data1001>
@ -91,6 +102,11 @@ Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145"
User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Accept: */*
GET /1530002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS
Accept: */*
GET /1530002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530002", response="f84511b014fdd0ba6494f42871079c32"
@ -117,6 +133,12 @@ Content-Type: text/html; charset=iso-8859-1
Content-Length: 23
This IS the real page!
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 401 Authorization re-negotiation please swsbounce
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"

View file

@ -86,10 +86,6 @@ Accept: */*
Some data delivered from an HTTP resource
</file1>
<file2 name="log/heads2006">
Content-Length: 496
Accept-ranges: bytes
HTTP/1.1 200 OK
Date: Thu, 21 Jun 2012 14:49:01 GMT
Server: test-server/fake

View file

@ -90,10 +90,6 @@ Something delivered from an HTTP resource
s/Last-Modified:.*//
</stripfile2>
<file2 name="log/heads2007">
Content-Length: 496
Accept-ranges: bytes
HTTP/1.1 200 OK
Date: Thu, 21 Jun 2012 14:50:02 GMT
Server: test-server/fake

View file

@ -82,10 +82,6 @@ Some stuff delivered from an HTTP resource
s/Last-Modified:.*//
</stripfile2>
<file2 name="log/heads2008">
Content-Length: 496
Accept-ranges: bytes
HTTP/1.1 200 OK
Date: Thu, 21 Jun 2012 15:23:48 GMT
Server: test-server/fake

View file

@ -83,10 +83,6 @@ Some contents delivered from an HTTP resource
s/Last-Modified:.*//
</stripfile2>
<file2 name="log/heads2009">
Content-Length: 496
Accept-ranges: bytes
HTTP/1.1 200 OK
Date: Thu, 21 Jun 2012 16:27:17 GMT
Server: test-server/fake

View file

@ -82,10 +82,6 @@ Contents delivered from an HTTP resource
s/Last-Modified:.*//
</stripfile2>
<file2 name="log/heads2010">
Content-Length: 496
Accept-ranges: bytes
HTTP/1.1 200 OK
Date: Thu, 21 Jun 2012 17:37:27 GMT
Server: test-server/fake