wsutil: Fix 30 seconds freeze if process fails to start

In ws_pipe_wait_for_pipe() on Windows, the WaitForMultipleObjects() waits
on the pending pipe connection events and process handle. If the process
handle is signalled, then it means that the process did exit without
connecting to the pipes.

The WaitForMultipleObjects() was not waiting on the process handle and thus
if the process did fail without connecting to pipes the Wireshark gui was
frozen for 30 seconds.

This change fixes the freeze by increasing the number of handles, so
WaitForMultipleObjects() is aware of the process handle.

Change-Id: Id13824a60baf4be7795cbe1d5ed1c7932edbff45
Reviewed-on: https://code.wireshark.org/review/33028
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Tomasz Moń 2019-04-30 15:52:38 +02:00 committed by Gerald Combs
parent 15fcf3d4ac
commit b075b8c7f7
1 changed files with 1 additions and 0 deletions

View File

@ -708,6 +708,7 @@ ws_pipe_wait_for_pipe(HANDLE * pipe_handles, int num_pipe_handles, HANDLE pid)
}
/* Wait for process in case it exits before the pipes have connected */
handles[num_handles] = pid;
num_handles++;
dw = WaitForMultipleObjects(num_handles, handles, FALSE, 30000);
int handle_idx = dw - WAIT_OBJECT_0;