diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-07-15 18:32:32 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-07-15 18:32:32 -0700 |
| commit | bb974dcfa8a22cdf528b6035ab5226f6691f0abf (patch) | |
| tree | 3dcd2a4f3e6c32a2724ade2eadbe07ca91c11203 | |
| parent | a7b16f1d07b680ae8024438e1555d3c43426e4b8 (diff) | |
| download | nng-bb974dcfa8a22cdf528b6035ab5226f6691f0abf.tar.gz nng-bb974dcfa8a22cdf528b6035ab5226f6691f0abf.tar.bz2 nng-bb974dcfa8a22cdf528b6035ab5226f6691f0abf.zip | |
Fix incorrect attempt to proceed inproc.
| -rw-r--r-- | src/core/endpt.c | 6 | ||||
| -rw-r--r-- | src/core/pipe.c | 1 | ||||
| -rw-r--r-- | src/protocol/bus/bus.c | 3 | ||||
| -rw-r--r-- | src/transport/inproc/inproc.c | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/src/core/endpt.c b/src/core/endpt.c index f221be18..50542d17 100644 --- a/src/core/endpt.c +++ b/src/core/endpt.c @@ -211,8 +211,9 @@ nni_ep_connect_done(void *arg) void * tpipe; nni_pipe * pipe; const nni_tran_pipe *ops; + int rv; - int rv; + ops = ep->ep_tran->tran_pipe; nni_mtx_lock(&ep->ep_mtx); if ((rv = nni_aio_result(aio)) == 0) { @@ -257,7 +258,7 @@ done: static void nni_ep_connect_start(nni_ep *ep) { - nni_aio *aio = &ep->ep_acc_aio; + nni_aio *aio = &ep->ep_con_aio; // Call with the Endpoint lock held. if (ep->ep_closed) { @@ -437,7 +438,6 @@ nni_ep_accept_done(void *arg) } done: - switch (rv) { case 0: pipe->p_tran_ops = *ops; diff --git a/src/core/pipe.c b/src/core/pipe.c index 3d0f96ab..664ababa 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -186,7 +186,6 @@ nni_pipe_create(nni_pipe **pp, nni_sock *sock, nni_tran *tran) nni_pipe_destroy(p); return (rv); } - p->p_tran_data = NULL; p->p_proto_data = NULL; p->p_proto_dtor = NULL; diff --git a/src/protocol/bus/bus.c b/src/protocol/bus/bus.c index c235e60a..167c342d 100644 --- a/src/protocol/bus/bus.c +++ b/src/protocol/bus/bus.c @@ -276,7 +276,8 @@ nni_bus_sock_getq_cb(void *arg) nni_bus_pipe *ppipe; nni_bus_pipe *lpipe; nni_msgq * uwq = nni_sock_sendq(psock->nsock); - nni_msg * msg, *dup; + nni_msg * msg; + nni_msg * dup; uint32_t sender; if (nni_aio_result(&psock->aio_getq) != 0) { diff --git a/src/transport/inproc/inproc.c b/src/transport/inproc/inproc.c index 3d13e684..78a0c44a 100644 --- a/src/transport/inproc/inproc.c +++ b/src/transport/inproc/inproc.c @@ -470,6 +470,7 @@ nni_inproc_ep_accept(void *arg, nni_aio *aio) if (ep->mode != NNI_EP_MODE_LISTEN) { nni_aio_finish(aio, NNG_EINVAL, 0); + return; } if ((rv = nni_inproc_pipe_init(&pipe, ep)) != 0) { nni_aio_finish(aio, rv, 0); @@ -477,7 +478,6 @@ nni_inproc_ep_accept(void *arg, nni_aio *aio) } nni_mtx_lock(&nni_inproc.mx); - aio->a_pipe = pipe; // We are already on the master list of servers, thanks to bind. if (ep->closed) { @@ -491,6 +491,8 @@ nni_inproc_ep_accept(void *arg, nni_aio *aio) return; } + aio->a_pipe = pipe; + // Insert us into the pending server aios, and then run the // accept list. nni_aio_list_append(&ep->aios, aio); |
