diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-04-04 09:41:12 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-04-04 09:41:12 -0700 |
| commit | 0aa1de1316b46bb4af23fdf26759bca08008eaf5 (patch) | |
| tree | aad04dd247016e6ef31469d2f92b64e633565da9 /src/supplemental/websocket/websocket.c | |
| parent | 4e6a71bf2f0fdfdfe15a774a5d541aa22b8b9195 (diff) | |
| download | nng-0aa1de1316b46bb4af23fdf26759bca08008eaf5.tar.gz nng-0aa1de1316b46bb4af23fdf26759bca08008eaf5.tar.bz2 nng-0aa1de1316b46bb4af23fdf26759bca08008eaf5.zip | |
fixes #324 nni_aio_set_synch leads to race condition
fixes #325 synchronous aio completion crash
fixes #327 move nni_clock() operations to outside the nni_aio_lk.
This work was done for the context tree, and is necessary to properly
enable that branch.
Diffstat (limited to 'src/supplemental/websocket/websocket.c')
| -rw-r--r-- | src/supplemental/websocket/websocket.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/supplemental/websocket/websocket.c b/src/supplemental/websocket/websocket.c index 6932ce70..7bd698bd 100644 --- a/src/supplemental/websocket/websocket.c +++ b/src/supplemental/websocket/websocket.c @@ -604,8 +604,7 @@ ws_write_cb(void *arg) if (aio != NULL) { nng_msg *msg = nni_aio_get_msg(aio); nni_aio_set_msg(aio, NULL); - nni_aio_set_synch(aio); - nni_aio_finish(aio, 0, nni_msg_len(msg)); + nni_aio_finish_synch(aio, 0, nni_msg_len(msg)); nni_msg_free(msg); } } @@ -1022,8 +1021,7 @@ ws_read_cb(void *arg) body += frame->len; } nni_aio_set_msg(wm->aio, msg); - nni_aio_set_synch(aio); - nni_aio_finish(wm->aio, 0, nni_msg_len(msg)); + nni_aio_finish_synch(wm->aio, 0, nni_msg_len(msg)); ws_msg_fini(wm); } } |
