From f3c35e371cc70f1b6bc33f7faa904d37d1567eb3 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 17 Nov 2019 15:12:15 +0100 Subject: 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 --- tests/data/Makefile.inc | 2 +- tests/data/test1135 | 1 + tests/data/test1538 | 3 ++- tests/data/test1564 | 31 +++++++++++++++++++++++++++++++ tests/data/test1565 | 41 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 tests/data/test1564 create mode 100644 tests/data/test1565 (limited to 'tests/data') diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 23215655b..c45bced5b 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -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 \ \ diff --git a/tests/data/test1135 b/tests/data/test1135 index eca6860fb..37a55427f 100644 --- a/tests/data/test1135 +++ b/tests/data/test1135 @@ -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, diff --git a/tests/data/test1538 b/tests/data/test1538 index 36f53040b..3b22ebc27 100644 --- a/tests/data/test1538 +++ b/tests/data/test1538 @@ -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 diff --git a/tests/data/test1564 b/tests/data/test1564 new file mode 100644 index 000000000..279665bd1 --- /dev/null +++ b/tests/data/test1564 @@ -0,0 +1,31 @@ + + + +multi +wakeup + + + +# Server-side + + + +# Client-side + + +none + + +lib1564 + + +wakeup before poll with no easy handles + + + + + +# Verify data after the test has been "shot" + + + diff --git a/tests/data/test1565 b/tests/data/test1565 new file mode 100644 index 000000000..f554e0f34 --- /dev/null +++ b/tests/data/test1565 @@ -0,0 +1,41 @@ + + + +HTTP +HTTP GET +multi +multi-threaded +wakeup + + + +# Server-side + + +HTTP/1.1 200 OK +Content-Length: 3 + +OK + + + +# Client-side + + +http + + +lib1565 + + +wakeup from another thread + + +http://%HOSTIP:%HTTPPORT/1 + + + +# Verify data after the test has been "shot" + + + -- cgit v1.2.3