]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sockfilt: fix broken pipe on Windows to be ready in select_ws
authorMarc Hoersken <info@marc-hoersken.de>
Mon, 13 Apr 2020 17:18:15 +0000 (19:18 +0200)
committerMarc Hoersken <info@marc-hoersken.de>
Tue, 14 Apr 2020 15:50:38 +0000 (17:50 +0200)
Closes #5228

tests/server/sockfilt.c

index 166b75b386e6ffeb37371c63ca13eb49d8c5b520..60ee07f64a7dfd95ed28cee7a21afcbc796ad162 100644 (file)
@@ -544,14 +544,17 @@ static DWORD WINAPI select_ws_wait_thread(LPVOID lpParameter)
             }
           }
           else {
-            /* if the pipe has been closed, sleep and continue waiting */
+            /* if the pipe has NOT been closed, sleep and continue waiting */
             length = GetLastError();
-            logmsg("[select_ws_wait_thread] PeekNamedPipe error: %d", length);
-            if(length == ERROR_BROKEN_PIPE) {
+            if(length != ERROR_BROKEN_PIPE) {
+              logmsg("[select_ws_wait_thread] PeekNamedPipe err: %d", length);
               SleepEx(0, FALSE);
               ReleaseMutex(mutex);
               continue;
             }
+            else {
+              logmsg("[select_ws_wait_thread] pipe closed, PIPE: %p", handle);
+            }
           }
           /* there is some data available, stop waiting */
           logmsg("[select_ws_wait_thread] data available, PIPE: %p", handle);