TODO fixed: Detect when called from within callbacks

Closes #2302
This commit is contained in:
Björn Stenberg 2018-02-10 15:13:15 +01:00 committed by Daniel Stenberg
parent 43a50a2580
commit b46cfbc068
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
28 changed files with 312 additions and 29 deletions

View file

@ -171,7 +171,7 @@ test1520 test1521 \
test1525 test1526 test1527 test1528 test1529 test1530 test1531 test1532 \
test1533 test1534 test1535 test1536 test1537 test1538 \
test1540 \
test1550 test1551 test1552 test1553 test1554 \
test1550 test1551 test1552 test1553 test1554 test1555 \
test1600 test1601 test1602 test1603 test1604 test1605 test1606 \
\
test1700 test1701 test1702 \

View file

@ -125,7 +125,8 @@ e89: The max connection limit is reached
e90: SSL public key does not match pinned public key
e91: SSL server certificate status verification FAILED
e92: Stream error in the HTTP/2 framing layer
e93: Unknown error
e93: API function called from within callback
e94: Unknown error
m-1: Please call curl_multi_perform() soon
m0: No error
m1: Invalid multi handle
@ -135,7 +136,8 @@ m4: Internal error
m5: Invalid socket argument
m6: Unknown option
m7: The easy handle is already added to a multi handle
m8: Unknown error
m8: API function called from within callback
m9: Unknown error
s0: No error
s1: Unknown share option
s2: Share currently in use

50
tests/data/test1555 Normal file
View file

@ -0,0 +1,50 @@
<testcase>
<info>
<keywords>
RECURSIVE_API_CALL
</keywords>
</info>
# Server-side
<reply>
<data nocheck="yes">
HTTP/1.1 204 PARTIAL
X-Comment: partial response to keep the client waiting
</data>
<postcmd>
wait 10
</postcmd>
</reply>
# Client-side
<client>
<server>
http
</server>
<tool>
lib1555
</tool>
<name>
verify api is protected against calls from callbacks
</name>
# this server/host won't be used for real
<command>
http://%HOSTIP:%HTTPPORT/1555
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
</protocol>
# 42 == CURLE_ABORTED_BY_CALLBACK
<errorcode>
42
</errorcode>
<stdout>
curl_easy_recv returned 93
curl_easy_send returned 93
</stdout>
</verify>
</testcase>