diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-03 22:46:48 -0500 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-03 23:08:54 -0500 |
| commit | d017a6af12dcf9660f7acc149c0a809a7247aa9c (patch) | |
| tree | 08682a2c0ea63d78316ae5226a5ced6dfeb90dda /src | |
| parent | ec714f06594269b671a6f484106259854b6a99b6 (diff) | |
| download | nng-d017a6af12dcf9660f7acc149c0a809a7247aa9c.tar.gz nng-d017a6af12dcf9660f7acc149c0a809a7247aa9c.tar.bz2 nng-d017a6af12dcf9660f7acc149c0a809a7247aa9c.zip | |
windows ipc: check the return value of nni_aio_schedule
This hopefully addresses a long standing bug with Windows IPC sometimes
hanging on shut down.
Diffstat (limited to 'src')
| -rw-r--r-- | src/platform/windows/win_ipclisten.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/platform/windows/win_ipclisten.c b/src/platform/windows/win_ipclisten.c index 3d39ed71..b7b7b526 100644 --- a/src/platform/windows/win_ipclisten.c +++ b/src/platform/windows/win_ipclisten.c @@ -257,6 +257,7 @@ static void ipc_listener_accept(void *arg, nni_aio *aio) { ipc_listener *l = arg; + int rv; if (nni_aio_begin(aio) != 0) { return; } @@ -266,10 +267,13 @@ ipc_listener_accept(void *arg, nni_aio *aio) nni_aio_finish_error(aio, NNG_ESTATE); return; } - nni_aio_schedule(aio, ipc_accept_cancel, l); - nni_list_append(&l->aios, aio); - if (nni_list_first(&l->aios) == aio) { - ipc_accept_start(l); + if ((rv = nni_aio_schedule(aio, ipc_accept_cancel, l)) != 0) { + nni_aio_finish_error(aio, rv); + } else { + nni_list_append(&l->aios, aio); + if (nni_list_first(&l->aios) == aio) { + ipc_accept_start(l); + } } nni_mtx_unlock(&l->mtx); } |
