]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sockfilt.c: do not wait on unreliable file or pipe handle
authorMarc Hoersken <info@marc-hoersken.de>
Wed, 16 Dec 2015 14:32:31 +0000 (15:32 +0100)
committerMarc Hoersken <info@marc-hoersken.de>
Wed, 16 Dec 2015 14:32:31 +0000 (15:32 +0100)
The previous implementation caused issues on modern MSYS2 runtimes.

tests/server/sockfilt.c

index a4496e0fb0032ce8ba26267f90d6d3331b3e2633..0530dad3f415a30141d116b7f30370eaeca26db5 100644 (file)
@@ -547,8 +547,8 @@ static DWORD WINAPI select_ws_wait_thread(LPVOID lpParameter)
         * Approach: Loop till either the internal event is signalled
         *           or if the end of the file has already been reached.
         */
-      while(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE)
-            == WAIT_OBJECT_0 + 1) {
+      while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE)
+            == WAIT_TIMEOUT) {
         /* get total size of file */
         length = 0;
         size.QuadPart = 0;
@@ -611,8 +611,8 @@ static DWORD WINAPI select_ws_wait_thread(LPVOID lpParameter)
         * Approach: Loop till either the internal event is signalled
         *           or there is data in the pipe available for reading.
         */
-      while(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE)
-            == WAIT_OBJECT_0 + 1) {
+      while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE)
+            == WAIT_TIMEOUT) {
         /* peek into the pipe and retrieve the amount of data available */
         length = 0;
         if(PeekNamedPipe(handle, NULL, 0, NULL, &length, NULL)) {