multi: add curl_multi_wakeup()

This commit adds curl_multi_wakeup() which was previously in the TODO
list under the curl_multi_unblock name.

On some platforms and with some configurations this feature might not be
available or can fail, in these cases a new error code
(CURLM_WAKEUP_FAILURE) is returned from curl_multi_wakeup().

Fixes #4418
Closes #4608
This commit is contained in:
Gergely Nagy 2019-11-17 15:12:15 +01:00 committed by Daniel Stenberg
parent 0a65febccf
commit f3c35e371c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
20 changed files with 684 additions and 17 deletions

View file

@ -179,7 +179,7 @@ test1525 test1526 test1527 test1528 test1529 test1530 test1531 test1532 \
test1533 test1534 test1535 test1536 test1537 test1538 \
test1540 test1541 \
test1550 test1551 test1552 test1553 test1554 test1555 test1556 test1557 \
test1558 test1559 test1560 test1561 test1562 test1563 \
test1558 test1559 test1560 test1561 test1562 test1563 test1564 test1565 \
\
test1590 test1591 test1592 test1593 test1594 test1595 test1596 \
\

View file

@ -92,6 +92,7 @@ CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle);
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,

View file

@ -139,7 +139,8 @@ m5: Invalid socket argument
m6: Unknown option
m7: The easy handle is already added to a multi handle
m8: API function called from within callback
m9: Unknown error
m9: Wakeup is unavailable or failed
m10: Unknown error
s0: No error
s1: Unknown share option
s2: Share currently in use

31
tests/data/test1564 Normal file
View file

@ -0,0 +1,31 @@
<testcase>
<info>
<keywords>
multi
wakeup
</keywords>
</info>
# Server-side
<reply>
</reply>
# Client-side
<client>
<server>
none
</server>
<tool>
lib1564
</tool>
<name>
wakeup before poll with no easy handles
</name>
<command>
</command>
</client>
# Verify data after the test has been "shot"
<verify>
</verify>
</testcase>

41
tests/data/test1565 Normal file
View file

@ -0,0 +1,41 @@
<testcase>
<info>
<keywords>
HTTP
HTTP GET
multi
multi-threaded
wakeup
</keywords>
</info>
# Server-side
<reply>
<data nocheck="yes">
HTTP/1.1 200 OK
Content-Length: 3
OK
</data>
</reply>
# Client-side
<client>
<server>
http
</server>
<tool>
lib1565
</tool>
<name>
wakeup from another thread
</name>
<command>
http://%HOSTIP:%HTTPPORT/1
</command>
</client>
# Verify data after the test has been "shot"
<verify>
</verify>
</testcase>