From 763b8deee1fd38566b85d4745a83adae245d9b26 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 21 Jun 2017 14:04:16 -0700 Subject: Make APIs for holding references more consistent. --- src/protocol/reqrep/rep.c | 14 +++++++------- src/protocol/reqrep/req.c | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/protocol/reqrep') diff --git a/src/protocol/reqrep/rep.c b/src/protocol/reqrep/rep.c index 5a5f6bff..822758ef 100644 --- a/src/protocol/reqrep/rep.c +++ b/src/protocol/reqrep/rep.c @@ -182,9 +182,9 @@ nni_rep_pipe_start(void *arg) return (rv); } - nni_pipe_incref(rp->pipe); + nni_pipe_hold(rp->pipe); nni_msgq_aio_get(rp->sendq, &rp->aio_getq); - nni_pipe_incref(rp->pipe); + nni_pipe_hold(rp->pipe); nni_pipe_aio_recv(rp->pipe, &rp->aio_recv); rp->running = 1; return (0); @@ -268,7 +268,7 @@ nni_rep_pipe_getq_cb(void *arg) if (nni_aio_result(&rp->aio_getq) != 0) { nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); return; } @@ -288,7 +288,7 @@ nni_rep_pipe_send_cb(void *arg) nni_msg_free(rp->aio_send.a_msg); rp->aio_send.a_msg = NULL; nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); return; } @@ -309,7 +309,7 @@ nni_rep_pipe_recv_cb(void *arg) if (nni_aio_result(&rp->aio_recv) != 0) { nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); return; } @@ -359,7 +359,7 @@ malformed: // Failures here are bad enough to warrant to dropping the conn. nni_msg_free(msg); nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); } @@ -372,7 +372,7 @@ nni_rep_pipe_putq_cb(void *arg) nni_msg_free(rp->aio_putq.a_msg); rp->aio_putq.a_msg = NULL; nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); return; } diff --git a/src/protocol/reqrep/req.c b/src/protocol/reqrep/req.c index af4dbd42..8268ecd6 100644 --- a/src/protocol/reqrep/req.c +++ b/src/protocol/reqrep/req.c @@ -187,9 +187,9 @@ nni_req_pipe_start(void *arg) nni_req_resend(req); } - nni_pipe_incref(rp->pipe); + nni_pipe_hold(rp->pipe); nni_msgq_aio_get(req->uwq, &rp->aio_getq); - nni_pipe_incref(rp->pipe); + nni_pipe_hold(rp->pipe); nni_pipe_aio_recv(rp->pipe, &rp->aio_recv); rp->running = 1; return (0); @@ -294,7 +294,7 @@ nni_req_getq_cb(void *arg) if (nni_aio_result(&rp->aio_getq) != 0) { nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); return; } @@ -316,7 +316,7 @@ nni_req_sendraw_cb(void *arg) nni_msg_free(rp->aio_sendraw.a_msg); rp->aio_sendraw.a_msg = NULL; nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); return; } @@ -339,7 +339,7 @@ nni_req_sendcooked_cb(void *arg) nni_msg_free(rp->aio_sendcooked.a_msg); rp->aio_sendcooked.a_msg = NULL; nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); return; } @@ -364,7 +364,7 @@ nni_req_putq_cb(void *arg) if (nni_aio_result(&rp->aio_putq) != 0) { nni_msg_free(rp->aio_putq.a_msg); nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); return; } rp->aio_putq.a_msg = NULL; @@ -381,7 +381,7 @@ nni_req_recv_cb(void *arg) if (nni_aio_result(&rp->aio_recv) != 0) { nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); return; } @@ -412,7 +412,7 @@ nni_req_recv_cb(void *arg) malformed: nni_msg_free(msg); nni_pipe_close(rp->pipe); - nni_pipe_decref(rp->pipe); + nni_pipe_rele(rp->pipe); } -- cgit v1.2.3-70-g09d2