mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
sockfilt.c: do not wait on unreliable file or pipe handle
The previous implementation caused issues on modern MSYS2 runtimes.
This commit is contained in:
parent
151da51404
commit
f4646b9069
@ -547,8 +547,8 @@ static DWORD WINAPI select_ws_wait_thread(LPVOID lpParameter)
|
|||||||
* Approach: Loop till either the internal event is signalled
|
* Approach: Loop till either the internal event is signalled
|
||||||
* or if the end of the file has already been reached.
|
* or if the end of the file has already been reached.
|
||||||
*/
|
*/
|
||||||
while(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE)
|
while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE)
|
||||||
== WAIT_OBJECT_0 + 1) {
|
== WAIT_TIMEOUT) {
|
||||||
/* get total size of file */
|
/* get total size of file */
|
||||||
length = 0;
|
length = 0;
|
||||||
size.QuadPart = 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
|
* Approach: Loop till either the internal event is signalled
|
||||||
* or there is data in the pipe available for reading.
|
* or there is data in the pipe available for reading.
|
||||||
*/
|
*/
|
||||||
while(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE)
|
while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE)
|
||||||
== WAIT_OBJECT_0 + 1) {
|
== WAIT_TIMEOUT) {
|
||||||
/* peek into the pipe and retrieve the amount of data available */
|
/* peek into the pipe and retrieve the amount of data available */
|
||||||
length = 0;
|
length = 0;
|
||||||
if(PeekNamedPipe(handle, NULL, 0, NULL, &length, NULL)) {
|
if(PeekNamedPipe(handle, NULL, 0, NULL, &length, NULL)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user