multi: handle errors returned from socket/timer callbacks

The callbacks were partially documented to support this. Now the
behavior is documented and returning error from either of these
callbacks will effectively kill all currently ongoing transfers.

Added test 530 to verify

Reported-by: Marcelo Juchem
Fixes #8083
Closes #8089
This commit is contained in:
Daniel Stenberg 2021-12-02 13:57:38 +01:00
parent b3f9c1aa09
commit 2b3dd01b77
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
14 changed files with 574 additions and 67 deletions

View file

@ -75,7 +75,7 @@ test490 test491 test492 test493 test494 \
test500 test501 test502 test503 test504 test505 test506 test507 test508 \
test509 test510 test511 test512 test513 test514 test515 test516 test517 \
test518 test519 test520 test521 test522 test523 test524 test525 test526 \
test527 test528 test529 test531 test532 test533 test534 test535 \
test527 test528 test529 test530 test531 test532 test533 test534 test535 \
test537 test538 test539 test540 test541 test542 test543 test544 \
test545 test546 test547 test548 test549 test550 test551 test552 test553 \
test554 test555 test556 test557 test558 test559 test560 test561 test562 \

View file

@ -144,7 +144,8 @@ m7: The easy handle is already added to a multi handle
m8: API function called from within callback
m9: Wakeup is unavailable or failed
m10: A libcurl function was given a bad argument
m11: Unknown error
m11: Operation was aborted by an application callback
m12: Unknown error
s0: No error
s1: Unknown share option
s2: Share currently in use

49
tests/data/test530 Normal file
View file

@ -0,0 +1,49 @@
<testcase>
<info>
<keywords>
multi
HTTP
</keywords>
</info>
# Server-side
<reply>
<data nocheck="yes">
HTTP/1.1 200 OK
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6007
Connection: close
Content-Type: text/html
Funny-head: yesyes
-foo-
%repeat[1000 x foobar]%
</data>
</reply>
# Client-side
<client>
<server>
http
</server>
<tool>
lib%TESTNUMBER
</tool>
<name>
multi_socket interface transfer with callbacks returning error
</name>
<command>
http://%HOSTIP:%HTTPPORT/file%TESTNUMBER
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
</protocol>
</verify>
</testcase>