From b921ef8889a86cce42bca28950e33ba11d28d78f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 1 Jan 2017 21:38:01 -0800 Subject: Clear the connected pipe so dialers don't reuse earlier pipes. --- src/transport/inproc/inproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/transport/inproc/inproc.c b/src/transport/inproc/inproc.c index aeb3ff1a..88cf96b9 100644 --- a/src/transport/inproc/inproc.c +++ b/src/transport/inproc/inproc.c @@ -234,7 +234,7 @@ nni_inproc_ep_close(void *arg) if (ep->mode == NNI_INPROC_EP_LISTEN) { nni_list_remove(&nni_inproc.servers, ep); for (;;) { - // Notify our clients that we are closed. + // Notify waiting clients that we are closed. nni_inproc_ep *client; client = nni_list_first(&ep->clients); if (client == NULL) { @@ -284,6 +284,9 @@ nni_inproc_ep_connect(void *arg, void **pipep) nni_mtx_unlock(&nni_inproc.mx); return (NNG_ECONNREFUSED); } + + // XXX check protocol peer validity... + ep->mode = NNI_INPROC_EP_DIAL; nni_list_append(&server->clients, ep); nni_cv_wake(&server->cv); @@ -294,6 +297,7 @@ nni_inproc_ep_connect(void *arg, void **pipep) } } *pipep = ep->cpipe; + ep->cpipe = NULL; nni_mtx_unlock(&nni_inproc.mx); return (0); } -- cgit v1.2.3-70-g09d2