summaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-08-20 09:00:46 -0700
committerGarrett D'Amore <garrett@damore.org>2018-08-20 09:26:20 -0700
commit6e5f6a26beec0a44d25625cacb5095cdc7a94146 (patch)
tree7d6ef720b239a30d4906f1f2303fed77707b2761 /src/protocol
parent3e70013111b70f1439b2f9991211c887a8eefff3 (diff)
downloadnng-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/protocol')
-rw-r--r--src/protocol/reqrep0/rep.c8
-rw-r--r--src/protocol/reqrep0/req.c8
-rw-r--r--src/protocol/survey0/respond.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/src/protocol/reqrep0/rep.c b/src/protocol/reqrep0/rep.c
index f9ce58fd..586f7143 100644
--- a/src/protocol/reqrep0/rep.c
+++ b/src/protocol/reqrep0/rep.c
@@ -131,9 +131,9 @@ rep0_ctx_init(void **ctxp, void *sarg)
}
static void
-rep0_ctx_cancel_send(nni_aio *aio, int rv)
+rep0_ctx_cancel_send(nni_aio *aio, void *arg, int rv)
{
- rep0_ctx * ctx = nni_aio_get_prov_data(aio);
+ rep0_ctx * ctx = arg;
rep0_sock *s = ctx->sock;
nni_mtx_lock(&s->lk);
@@ -448,9 +448,9 @@ rep0_pipe_send_cb(void *arg)
}
static void
-rep0_cancel_recv(nni_aio *aio, int rv)
+rep0_cancel_recv(nni_aio *aio, void *arg, int rv)
{
- rep0_ctx * ctx = nni_aio_get_prov_data(aio);
+ rep0_ctx * ctx = arg;
rep0_sock *s = ctx->sock;
nni_mtx_lock(&s->lk);
diff --git a/src/protocol/reqrep0/req.c b/src/protocol/reqrep0/req.c
index 6220697b..49d0ea66 100644
--- a/src/protocol/reqrep0/req.c
+++ b/src/protocol/reqrep0/req.c
@@ -590,9 +590,9 @@ req0_ctx_reset(req0_ctx *ctx)
}
static void
-req0_ctx_cancel_recv(nni_aio *aio, int rv)
+req0_ctx_cancel_recv(nni_aio *aio, void *arg, int rv)
{
- req0_ctx * ctx = nni_aio_get_prov_data(aio);
+ req0_ctx * ctx = arg;
req0_sock *s = ctx->sock;
nni_mtx_lock(&s->mtx);
@@ -666,9 +666,9 @@ req0_ctx_recv(void *arg, nni_aio *aio)
}
static void
-req0_ctx_cancel_send(nni_aio *aio, int rv)
+req0_ctx_cancel_send(nni_aio *aio, void *arg, int rv)
{
- req0_ctx * ctx = nni_aio_get_prov_data(aio);
+ req0_ctx * ctx = arg;
req0_sock *s = ctx->sock;
nni_mtx_lock(&s->mtx);
diff --git a/src/protocol/survey0/respond.c b/src/protocol/survey0/respond.c
index 4e0a5263..80e3f2f8 100644
--- a/src/protocol/survey0/respond.c
+++ b/src/protocol/survey0/respond.c
@@ -133,9 +133,9 @@ resp0_ctx_init(void **ctxp, void *sarg)
}
static void
-resp0_ctx_cancel_send(nni_aio *aio, int rv)
+resp0_ctx_cancel_send(nni_aio *aio, void *arg, int rv)
{
- resp0_ctx * ctx = nni_aio_get_prov_data(aio);
+ resp0_ctx * ctx = arg;
resp0_sock *s = ctx->sock;
nni_mtx_lock(&s->mtx);
@@ -437,9 +437,9 @@ resp0_pipe_send_cb(void *arg)
}
static void
-resp0_cancel_recv(nni_aio *aio, int rv)
+resp0_cancel_recv(nni_aio *aio, void *arg, int rv)
{
- resp0_ctx * ctx = nni_aio_get_prov_data(aio);
+ resp0_ctx * ctx = arg;
resp0_sock *s = ctx->sock;
nni_mtx_lock(&s->mtx);