aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-05-15 15:43:10 -0700
committerGarrett D'Amore <garrett@damore.org>2018-05-15 18:06:15 -0700
commitf69b4c1da69d1e9c513ad63da488a49b6b46a706 (patch)
tree8e123b695ac5e9bd320875f21055f503bbf21fda /src
parent959f4588a164f0a524c4a654b06fcade01f5e6d5 (diff)
downloadnng-f69b4c1da69d1e9c513ad63da488a49b6b46a706.tar.gz
nng-f69b4c1da69d1e9c513ad63da488a49b6b46a706.tar.bz2
nng-f69b4c1da69d1e9c513ad63da488a49b6b46a706.zip
fixes #436 fix for 429 incomplete (ws ep crash)
While here, there is a little more endpoint termination hardening. Running this code base seems to not incur any faults beyond the very rare TCP port conflict that can occur from our random port selection in the test suite.
Diffstat (limited to 'src')
-rw-r--r--src/core/endpt.c12
-rw-r--r--src/supplemental/http/http_client.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/core/endpt.c b/src/core/endpt.c
index d39824a4..9fc26cf3 100644
--- a/src/core/endpt.c
+++ b/src/core/endpt.c
@@ -94,13 +94,13 @@ nni_ep_destroy(nni_ep *ep)
nni_idhash_remove(nni_eps, ep->ep_id);
}
- nni_sock_ep_remove(ep->ep_sock, ep);
-
nni_aio_stop(ep->ep_acc_aio);
nni_aio_stop(ep->ep_con_aio);
nni_aio_stop(ep->ep_con_syn);
nni_aio_stop(ep->ep_tmo_aio);
+ nni_sock_ep_remove(ep->ep_sock, ep);
+
nni_aio_fini(ep->ep_acc_aio);
nni_aio_fini(ep->ep_con_aio);
nni_aio_fini(ep->ep_con_syn);
@@ -247,10 +247,10 @@ nni_ep_shutdown(nni_ep *ep)
nni_mtx_unlock(&ep->ep_mtx);
// Abort any remaining in-flight operations.
- nni_aio_close(ep->ep_acc_aio);
- nni_aio_close(ep->ep_con_aio);
- nni_aio_close(ep->ep_con_syn);
- nni_aio_close(ep->ep_tmo_aio);
+ nni_aio_stop(ep->ep_acc_aio);
+ nni_aio_stop(ep->ep_con_aio);
+ nni_aio_stop(ep->ep_con_syn);
+ nni_aio_stop(ep->ep_tmo_aio);
// Stop the underlying transport.
ep->ep_ops.ep_close(ep->ep_data);
diff --git a/src/supplemental/http/http_client.c b/src/supplemental/http/http_client.c
index aba72715..4034bbff 100644
--- a/src/supplemental/http/http_client.c
+++ b/src/supplemental/http/http_client.c
@@ -246,7 +246,7 @@ nni_http_client_connect(nni_http_client *c, nni_aio *aio)
return;
}
nni_mtx_lock(&c->mtx);
- if ((rv = nni_aio_schedule(aio, http_connect_cancel, aio)) != 0) {
+ if ((rv = nni_aio_schedule(aio, http_connect_cancel, c)) != 0) {
nni_mtx_unlock(&c->mtx);
nni_aio_finish_error(aio, rv);
return;