diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-01-03 13:04:44 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-01-03 13:04:44 -0800 |
| commit | 2ea7ae1ae5755ab72833fdea0dcf8e13e4d91d0d (patch) | |
| tree | 0c9043030419dbe6ac54f709d7658330f2e1d529 /src/transport/ws | |
| parent | 303f84fbbfc4ee04b9f62e12bb2c1106834a2371 (diff) | |
| download | nng-2ea7ae1ae5755ab72833fdea0dcf8e13e4d91d0d.tar.gz nng-2ea7ae1ae5755ab72833fdea0dcf8e13e4d91d0d.tar.bz2 nng-2ea7ae1ae5755ab72833fdea0dcf8e13e4d91d0d.zip | |
Fix leaks on send.
I'm pretty sure I need to go back and review the handling of
send messages for websocket too. We still have a receive leak
in websocket and leaks caused by the new URL parsing code which
needs to be refactored.
Diffstat (limited to 'src/transport/ws')
| -rw-r--r-- | src/transport/ws/websocket.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/transport/ws/websocket.c b/src/transport/ws/websocket.c index 977119a2..05cb9513 100644 --- a/src/transport/ws/websocket.c +++ b/src/transport/ws/websocket.c @@ -119,6 +119,8 @@ ws_pipe_recv_cancel(nni_aio *aio, int rv) return; } nni_aio_cancel(p->rxaio, rv); + p->user_rxaio = NULL; + nni_aio_finish_error(aio, rv); nni_mtx_unlock(&p->mtx); } @@ -147,9 +149,9 @@ ws_pipe_send_cancel(nni_aio *aio, int rv) nni_mtx_unlock(&p->mtx); return; } - // This aborts the upper send, which will call back with an error - // when it is done. + p->user_txaio = NULL; nni_aio_cancel(p->txaio, rv); + nni_aio_finish_error(aio, rv); nni_mtx_unlock(&p->mtx); } |
