From d72076207a2fad96ff014a81366868fb47a0ed1b Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 31 Aug 2017 17:59:01 -0700 Subject: Allocate AIOs dynamically. We allocate AIO structures dynamically, so that we can use them abstractly in more places without inlining them. This will be used for the ZeroTier transport to allow us to create operations consisting of just the AIO. Furthermore, we provide accessors for some of the aio members, in the hopes that we will be able to wrap these for "safe" version of the AIO capability to export to applications, and to protocol and transport implementors. While here we cleaned up the protocol details to use consistently shorter names (no nni_ prefix for static symbols needed), and we also fixed a bug in the surveyor code. --- src/core/socket.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index 6a242558..01fd9a0c 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -222,7 +222,7 @@ nni_sock_cansend_cb(void *arg) nni_notify *notify = arg; nni_sock * sock = notify->n_sock; - if (nni_aio_result(¬ify->n_aio) != 0) { + if (nni_aio_result(notify->n_aio) != 0) { return; } @@ -235,7 +235,7 @@ nni_sock_canrecv_cb(void *arg) nni_notify *notify = arg; nni_sock * sock = notify->n_sock; - if (nni_aio_result(¬ify->n_aio) != 0) { + if (nni_aio_result(notify->n_aio) != 0) { return; } @@ -259,11 +259,11 @@ nni_sock_notify(nni_sock *sock, int type, nng_notify_func fn, void *arg) switch (type) { case NNG_EV_CAN_RCV: nni_aio_init(¬ify->n_aio, nni_sock_canrecv_cb, notify); - nni_msgq_aio_notify_get(sock->s_urq, ¬ify->n_aio); + nni_msgq_aio_notify_get(sock->s_urq, notify->n_aio); break; case NNG_EV_CAN_SND: nni_aio_init(¬ify->n_aio, nni_sock_cansend_cb, notify); - nni_msgq_aio_notify_put(sock->s_uwq, ¬ify->n_aio); + nni_msgq_aio_notify_put(sock->s_uwq, notify->n_aio); break; default: NNI_FREE_STRUCT(notify); @@ -276,7 +276,7 @@ nni_sock_notify(nni_sock *sock, int type, nng_notify_func fn, void *arg) void nni_sock_unnotify(nni_sock *sock, nni_notify *notify) { - nni_aio_fini(¬ify->n_aio); + nni_aio_fini(notify->n_aio); NNI_FREE_STRUCT(notify); } -- cgit v1.2.3-70-g09d2