From 2ea7ae1ae5755ab72833fdea0dcf8e13e4d91d0d Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 3 Jan 2018 13:04:44 -0800 Subject: 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. --- src/transport/ws/websocket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/transport/ws') 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); } -- cgit v1.2.3-70-g09d2