diff options
Diffstat (limited to 'src/protocol/pipeline/pull.c')
| -rw-r--r-- | src/protocol/pipeline/pull.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/protocol/pipeline/pull.c b/src/protocol/pipeline/pull.c index eb14be81..eb66bc21 100644 --- a/src/protocol/pipeline/pull.c +++ b/src/protocol/pipeline/pull.c @@ -107,7 +107,6 @@ nni_pull_pipe_start(void *arg) nni_pull_pipe *pp = arg; // Start the pending pull... - nni_pipe_hold(pp->pipe); nni_pull_recv(pp); return (0); @@ -115,12 +114,11 @@ nni_pull_pipe_start(void *arg) static void -nni_pull_pipe_stop(void *arg) +nni_pull_pipe_stop(nni_pull_pipe *pp) { - nni_pull_pipe *pp = arg; - // Cancel any pending sendup. nni_msgq_aio_cancel(pp->pull->urq, &pp->putq_aio); + nni_pipe_remove(pp->pipe); } @@ -133,8 +131,7 @@ nni_pull_recv_cb(void *arg) if (nni_aio_result(aio) != 0) { // Failed to get a message, probably the pipe is closed. - nni_pipe_close(pp->pipe); - nni_pipe_rele(pp->pipe); + nni_pull_pipe_stop(pp); return; } @@ -157,8 +154,7 @@ nni_pull_putq_cb(void *arg) // we can do. Just close the pipe. nni_msg_free(aio->a_msg); aio->a_msg = NULL; - nni_pipe_close(pp->pipe); - nni_pipe_rele(pp->pipe); + nni_pull_pipe_stop(pp); return; } @@ -172,8 +168,7 @@ nni_pull_recv(nni_pull_pipe *pp) { // Schedule the aio with callback. if (nni_pipe_aio_recv(pp->pipe, &pp->recv_aio) != 0) { - nni_pipe_close(pp->pipe); - nni_pipe_rele(pp->pipe); + nni_pipe_remove(pp->pipe); } } @@ -230,7 +225,6 @@ static nni_proto_pipe_ops nni_pull_pipe_ops = { .pipe_init = nni_pull_pipe_init, .pipe_fini = nni_pull_pipe_fini, .pipe_start = nni_pull_pipe_start, - .pipe_stop = nni_pull_pipe_stop, }; static nni_proto_sock_ops nni_pull_sock_ops = { |
