summaryrefslogtreecommitdiff
path: root/src/supplemental/websocket
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-02-08 14:16:23 -0800
committerGarrett D'Amore <garrett@damore.org>2018-02-08 18:54:09 -0800
commitd606317f5c028fa8fba5d5384b0ccd90ffa4eab5 (patch)
tree3a6a70f6f2dc81b8722134752716f1c58bd1825c /src/supplemental/websocket
parente9efefca683b244b40f831c554d7c72a745b8372 (diff)
downloadnng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.tar.gz
nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.tar.bz2
nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.zip
fixes #171 Refactor aio to use generic data fields
This addresses the use of the pipe special field, and eliminates it. The message APIs (recvmsg, sendmsg) need to be updated as well still, but I want to handle that as part of a separate issue. While here we fixed various compiler warnings, etc.
Diffstat (limited to 'src/supplemental/websocket')
-rw-r--r--src/supplemental/websocket/websocket.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/supplemental/websocket/websocket.c b/src/supplemental/websocket/websocket.c
index ad4ce196..05a2c62c 100644
--- a/src/supplemental/websocket/websocket.c
+++ b/src/supplemental/websocket/websocket.c
@@ -1174,7 +1174,8 @@ ws_http_cb_listener(nni_ws *ws, nni_aio *aio)
ws->ready = true;
if ((aio = nni_list_first(&l->aios)) != NULL) {
nni_list_remove(&l->aios, aio);
- nni_aio_finish_pipe(aio, ws);
+ nni_aio_set_output(aio, 0, ws);
+ nni_aio_finish(aio, 0, 0);
} else {
nni_list_append(&l->pend, ws);
}
@@ -1269,7 +1270,8 @@ ws_http_cb_dialer(nni_ws *ws, nni_aio *aio)
nni_list_remove(&d->wspend, ws);
ws->ready = true;
ws->useraio = NULL;
- nni_aio_finish_pipe(uaio, ws);
+ nni_aio_set_output(uaio, 0, ws);
+ nni_aio_finish(uaio, 0, 0);
nni_mtx_unlock(&d->mtx);
return;
err:
@@ -1621,7 +1623,8 @@ nni_ws_listener_accept(nni_ws_listener *l, nni_aio *aio)
}
if ((ws = nni_list_first(&l->pend)) != NULL) {
nni_list_remove(&l->pend, ws);
- nni_aio_finish_pipe(aio, ws);
+ nni_aio_set_output(aio, 0, ws);
+ nni_aio_finish(aio, 0, 0);
} else {
nni_list_append(&l->aios, aio);
}