diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-01 21:38:01 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-01 21:38:01 -0800 |
| commit | b921ef8889a86cce42bca28950e33ba11d28d78f (patch) | |
| tree | 9aeaf9289d922154b9aeb4cb2ff3c20a984f1505 /src/transport | |
| parent | e5f24dee2d115d6a7f51cd4cae0b086c5be5c0de (diff) | |
| download | nng-b921ef8889a86cce42bca28950e33ba11d28d78f.tar.gz nng-b921ef8889a86cce42bca28950e33ba11d28d78f.tar.bz2 nng-b921ef8889a86cce42bca28950e33ba11d28d78f.zip | |
Clear the connected pipe so dialers don't reuse earlier pipes.
Diffstat (limited to 'src/transport')
| -rw-r--r-- | src/transport/inproc/inproc.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); } |
