diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-04-23 16:16:03 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-04-23 16:16:03 +0000 |
commit | 1fe4a6c7025cb91f3410459a7a92d75fbbcd0df7 (patch) | |
tree | ce0de4d08644800442b083b5337ce04a0c609b75 | |
parent | 8bb4ce7621be4e6bcd4bcdc7513b7c94fcded3b4 (diff) | |
download | libmicrohttpd-1fe4a6c7025cb91f3410459a7a92d75fbbcd0df7.tar.gz libmicrohttpd-1fe4a6c7025cb91f3410459a7a92d75fbbcd0df7.zip |
test_quiesce: do not violate our API
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/testcurl/test_quiesce.c | 9 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,6 @@ | |||
1 | Sat Apr 23 16:06:30 CET 2016 | ||
2 | Improved test_quiesce test. -EG | ||
3 | |||
1 | Sat Apr 23 15:39:38 CET 2016 | 4 | Sat Apr 23 15:39:38 CET 2016 |
2 | Notify other threads in MHD_quiesce_daemon() so listen socket FD | 5 | Notify other threads in MHD_quiesce_daemon() so listen socket FD |
3 | is removed from awaiting select() and poll(). -EG | 6 | is removed from awaiting select() and poll(). -EG |
diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c index aedcf760..bf5e6d44 100644 --- a/src/testcurl/test_quiesce.c +++ b/src/testcurl/test_quiesce.c | |||
@@ -150,8 +150,13 @@ ServeOneRequest(void *param) | |||
150 | MHD_SYS_select_ (max + 1, &rs, &ws, &es, &tv); | 150 | MHD_SYS_select_ (max + 1, &rs, &ws, &es, &tv); |
151 | MHD_run (d); | 151 | MHD_run (d); |
152 | } | 152 | } |
153 | fd = MHD_quiesce_daemon (d); | ||
154 | if (MHD_INVALID_SOCKET == fd) | ||
155 | { | ||
156 | MHD_stop_daemon (d); | ||
157 | return "MHD_quiesce_daemon() failed in ServeOneRequest()"; | ||
158 | } | ||
153 | MHD_stop_daemon (d); | 159 | MHD_stop_daemon (d); |
154 | MHD_socket_close_(fd); | ||
155 | return done ? NULL : "Requests was not served by ServeOneRequest()"; | 160 | return done ? NULL : "Requests was not served by ServeOneRequest()"; |
156 | } | 161 | } |
157 | 162 | ||
@@ -429,7 +434,6 @@ testExternalGet () | |||
429 | MHD_stop_daemon (d); | 434 | MHD_stop_daemon (d); |
430 | return 2; | 435 | return 2; |
431 | } | 436 | } |
432 | MHD_socket_close_ (fd); | ||
433 | c = setupCURL (&cbc); | 437 | c = setupCURL (&cbc); |
434 | multi = curl_multi_init (); | 438 | multi = curl_multi_init (); |
435 | mret = curl_multi_add_handle (multi, c); | 439 | mret = curl_multi_add_handle (multi, c); |
@@ -450,6 +454,7 @@ testExternalGet () | |||
450 | curl_multi_cleanup (multi); | 454 | curl_multi_cleanup (multi); |
451 | } | 455 | } |
452 | MHD_stop_daemon (d); | 456 | MHD_stop_daemon (d); |
457 | MHD_socket_close_ (fd); | ||
453 | if (cbc.pos != strlen ("/hello_world")) | 458 | if (cbc.pos != strlen ("/hello_world")) |
454 | return 8192; | 459 | return 8192; |
455 | if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) | 460 | if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) |