diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-02-26 16:27:01 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-02-26 16:27:01 -0800 |
| commit | 2729907d4b618e1b35b4b0d1b4f6271f5139ebef (patch) | |
| tree | 855c80b20f479807443fd3132bbf6df86c8145af /src/platform/windows | |
| parent | 504d7b5a11bce8ab1ec1e18ff9c4a72dfd12a36f (diff) | |
| download | nng-2729907d4b618e1b35b4b0d1b4f6271f5139ebef.tar.gz nng-2729907d4b618e1b35b4b0d1b4f6271f5139ebef.tar.bz2 nng-2729907d4b618e1b35b4b0d1b4f6271f5139ebef.zip | |
Hang in concurrent IPC connection close.
ConnectNamedPipe can return ERROR_PIPE_CONNECTED, and does not
enqueue a completion packet if it does. So we need to handle
that specially.
Diffstat (limited to 'src/platform/windows')
| -rw-r--r-- | src/platform/windows/win_ipc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/platform/windows/win_ipc.c b/src/platform/windows/win_ipc.c index f967a054..8c94e404 100644 --- a/src/platform/windows/win_ipc.c +++ b/src/platform/windows/win_ipc.c @@ -336,10 +336,11 @@ nni_win_ipc_acc_start(nni_win_event *evt, nni_aio *aio) int rv = GetLastError(); switch (rv) { case ERROR_PIPE_CONNECTED: - // Synch completion already occurred. - // Windows is weird. Apparently the I/O - // completion packet has already been sent. - return (0); + // Kind of like success, but as this is technically + // an "error", we have to complete it ourself. + evt->status = 0; + evt->count = 0; + return (1); case ERROR_IO_PENDING: // Normal asynchronous operation. Wait for @@ -354,8 +355,8 @@ nni_win_ipc_acc_start(nni_win_event *evt, nni_aio *aio) } } - // Synch completion right now. I/O completion packet delivered - // already. + // Synchronous success - the I/O completion packet should still + // be delivered. return (0); } |
