diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-08-20 09:00:46 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-08-20 09:26:20 -0700 |
| commit | 6e5f6a26beec0a44d25625cacb5095cdc7a94146 (patch) | |
| tree | 7d6ef720b239a30d4906f1f2303fed77707b2761 /src/transport/zerotier | |
| parent | 3e70013111b70f1439b2f9991211c887a8eefff3 (diff) | |
| download | nng-6e5f6a26beec0a44d25625cacb5095cdc7a94146.tar.gz nng-6e5f6a26beec0a44d25625cacb5095cdc7a94146.tar.bz2 nng-6e5f6a26beec0a44d25625cacb5095cdc7a94146.zip | |
fixes #664 aio cancellation could be better
This changes the signature of the aio cancellation routines
to take the argument for cancellation directly, so we do not
need to lookup the argument using the nni_aio_get_prov_data.
We should probably consider eliminating nni_aio_get_prov_data,
and co, and changing the prov_extra to reflect prov_data. Later.
Diffstat (limited to 'src/transport/zerotier')
| -rw-r--r-- | src/transport/zerotier/zerotier.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/transport/zerotier/zerotier.c b/src/transport/zerotier/zerotier.c index d1072931..0a68c1ca 100644 --- a/src/transport/zerotier/zerotier.c +++ b/src/transport/zerotier/zerotier.c @@ -1840,9 +1840,9 @@ zt_pipe_send(void *arg, nni_aio *aio) } static void -zt_pipe_cancel_recv(nni_aio *aio, int rv) +zt_pipe_cancel_recv(nni_aio *aio, void *arg, int rv) { - zt_pipe *p = nni_aio_get_prov_data(aio); + zt_pipe *p = arg; nni_mtx_lock(&zt_lk); if (p->zp_user_rxaio == aio) { p->zp_user_rxaio = NULL; @@ -2331,9 +2331,9 @@ zt_ep_bind(void *arg) } static void -zt_ep_cancel(nni_aio *aio, int rv) +zt_ep_cancel(nni_aio *aio, void *arg, int rv) { - zt_ep *ep = nni_aio_get_prov_data(aio); + zt_ep *ep = arg; nni_mtx_lock(&zt_lk); if (nni_aio_list_active(aio)) { @@ -2417,9 +2417,9 @@ zt_ep_accept(void *arg, nni_aio *aio) } static void -zt_ep_conn_req_cancel(nni_aio *aio, int rv) +zt_ep_conn_req_cancel(nni_aio *aio, void *arg, int rv) { - zt_ep *ep = nni_aio_get_prov_data(aio); + zt_ep *ep = arg; // We don't have much to do here. The AIO will have been // canceled as a result of the "parent" AIO canceling. nni_mtx_lock(&zt_lk); |
