aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-06-28 23:10:33 -0700
committerGarrett D'Amore <garrett@damore.org>2017-06-28 23:10:33 -0700
commitd0c0c9969ab5552889f91d09db6dbf6b79f6705c (patch)
treecee4e0e2426af804a20b12a6de454b9409e8acdf /src
parentfe3c9705072ac8cafecdf2ea6bca4c26f9464824 (diff)
downloadnng-d0c0c9969ab5552889f91d09db6dbf6b79f6705c.tar.gz
nng-d0c0c9969ab5552889f91d09db6dbf6b79f6705c.tar.bz2
nng-d0c0c9969ab5552889f91d09db6dbf6b79f6705c.zip
We don't need pipe_hold or pipe_rele anymore.
Diffstat (limited to 'src')
-rw-r--r--src/core/pipe.c19
-rw-r--r--src/core/pipe.h3
-rw-r--r--src/protocol/reqrep/rep.c3
3 files changed, 2 insertions, 23 deletions
diff --git a/src/core/pipe.c b/src/core/pipe.c
index 3dcfe9e0..791ba4aa 100644
--- a/src/core/pipe.c
+++ b/src/core/pipe.c
@@ -103,23 +103,6 @@ nni_pipe_aio_send(nni_pipe *p, nni_aio *aio)
}
-void
-nni_pipe_hold(nni_pipe *p)
-{
- int rv;
-
- rv = nni_objhash_find(nni_pipes, p->p_id, NULL);
- NNI_ASSERT(rv == 0);
-}
-
-
-void
-nni_pipe_rele(nni_pipe *p)
-{
- nni_objhash_unref(nni_pipes, p->p_id);
-}
-
-
// nni_pipe_close closes the underlying connection. It is expected that
// subsequent attempts receive or send (including any waiting receive) will
// simply return NNG_ECLOSED.
@@ -160,7 +143,7 @@ nni_pipe_remove(nni_pipe *p)
nni_sock_pipe_stop(p->p_sock, p);
// XXX: would be simpler to just do a destroy here
- nni_pipe_rele(p);
+ nni_objhash_unref(nni_pipes, p->p_id);
}
diff --git a/src/core/pipe.h b/src/core/pipe.h
index 80560e0e..f09d9bf0 100644
--- a/src/core/pipe.h
+++ b/src/core/pipe.h
@@ -48,9 +48,6 @@ extern uint32_t nni_pipe_id(nni_pipe *);
// operations against will return NNG_ECLOSED.
extern void nni_pipe_close(nni_pipe *);
-extern void nni_pipe_hold(nni_pipe *);
-extern void nni_pipe_rele(nni_pipe *);
-
// nni_pipe_remove is called by the protocol when it is done with the socket.
// The pipe should already be closed; it will be unregistered and it's
// resources released back to the system. The protocol MUST not reference
diff --git a/src/protocol/reqrep/rep.c b/src/protocol/reqrep/rep.c
index 38bf082a..036904b1 100644
--- a/src/protocol/reqrep/rep.c
+++ b/src/protocol/reqrep/rep.c
@@ -373,8 +373,7 @@ nni_rep_pipe_recv_cb(void *arg)
malformed:
// Failures here are bad enough to warrant to dropping the conn.
nni_msg_free(msg);
- nni_pipe_close(rp->pipe);
- nni_pipe_rele(rp->pipe);
+ nni_pipe_stop(rp->pipe);
}