1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 08:38:49 -05:00

sockfilt: fix broken pipe on Windows to be ready in select_ws

Closes #5228
This commit is contained in:
Marc Hoersken 2020-04-13 19:18:15 +02:00
parent 7bade50b63
commit 8a2038a3ad
No known key found for this signature in database
GPG Key ID: 61E03CBED7BC859E

View File

@ -544,14 +544,17 @@ static DWORD WINAPI select_ws_wait_thread(LPVOID lpParameter)
} }
} }
else { else {
/* if the pipe has been closed, sleep and continue waiting */ /* if the pipe has NOT been closed, sleep and continue waiting */
length = GetLastError(); 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); SleepEx(0, FALSE);
ReleaseMutex(mutex); ReleaseMutex(mutex);
continue; continue;
} }
else {
logmsg("[select_ws_wait_thread] pipe closed, PIPE: %p", handle);
}
} }
/* there is some data available, stop waiting */ /* there is some data available, stop waiting */
logmsg("[select_ws_wait_thread] data available, PIPE: %p", handle); logmsg("[select_ws_wait_thread] data available, PIPE: %p", handle);