diff options
Diffstat (limited to 'src/protocol/reqrep0')
| -rw-r--r-- | src/protocol/reqrep0/rep.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/protocol/reqrep0/rep.c b/src/protocol/reqrep0/rep.c index 24fc7335..33c9efcd 100644 --- a/src/protocol/reqrep0/rep.c +++ b/src/protocol/reqrep0/rep.c @@ -309,6 +309,12 @@ static void rep0_pipe_fini(void *arg) { rep0_pipe *p = arg; + nng_msg * msg; + + if ((msg = nni_aio_get_msg(p->aio_recv)) != NULL) { + nni_aio_set_msg(p->aio_recv, NULL); + nni_msg_free(msg); + } nni_aio_fini(p->aio_send); nni_aio_fini(p->aio_recv); @@ -538,6 +544,7 @@ rep0_pipe_recv_cb(void *arg) if (nni_msg_len(msg) < 4) { // Peer is speaking garbage. Kick it. nni_msg_free(msg); + nni_aio_set_msg(p->aio_recv, NULL); nni_pipe_stop(p->pipe); return; } @@ -593,6 +600,7 @@ rep0_pipe_recv_cb(void *arg) drop: nni_msg_free(msg); + nni_aio_set_msg(p->aio_recv, NULL); nni_pipe_recv(p->pipe, p->aio_recv); } |
