aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/http/http_server.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-01-08 20:34:26 -0800
committerGarrett D'Amore <garrett@damore.org>2020-01-08 21:16:30 -0800
commitb21d7805523a407a14567017edbdef57ca81781f (patch)
treee07f08bdc047ee4dfb057b670766e3de5bf2f981 /src/supplemental/http/http_server.c
parent8479b4c8861c77cfd9eb64e724615605bdd1cbcb (diff)
downloadnng-b21d7805523a407a14567017edbdef57ca81781f.tar.gz
nng-b21d7805523a407a14567017edbdef57ca81781f.tar.bz2
nng-b21d7805523a407a14567017edbdef57ca81781f.zip
fixes #1094 Consider in-lining task and aio
This only does it for rep, but it also has changes that should increase the overall test coverage for the REP protocol
Diffstat (limited to 'src/supplemental/http/http_server.c')
-rw-r--r--src/supplemental/http/http_server.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c
index 06a93553..9a4ff2af 100644
--- a/src/supplemental/http/http_server.c
+++ b/src/supplemental/http/http_server.c
@@ -243,10 +243,10 @@ http_sconn_reap(void *arg)
}
nni_http_req_free(sc->req);
nni_http_res_free(sc->res);
- nni_aio_fini(sc->rxaio);
- nni_aio_fini(sc->txaio);
- nni_aio_fini(sc->txdataio);
- nni_aio_fini(sc->cbaio);
+ nni_aio_free(sc->rxaio);
+ nni_aio_free(sc->txaio);
+ nni_aio_free(sc->txdataio);
+ nni_aio_free(sc->cbaio);
// Now it is safe to release our reference on the server.
nni_mtx_lock(&s->mtx);
@@ -746,11 +746,11 @@ http_sconn_init(http_sconn **scp, nng_stream *stream)
}
if (((rv = nni_http_req_alloc(&sc->req, NULL)) != 0) ||
- ((rv = nni_aio_init(&sc->rxaio, http_sconn_rxdone, sc)) != 0) ||
- ((rv = nni_aio_init(&sc->txaio, http_sconn_txdone, sc)) != 0) ||
- ((rv = nni_aio_init(&sc->txdataio, http_sconn_txdatdone, sc)) !=
+ ((rv = nni_aio_alloc(&sc->rxaio, http_sconn_rxdone, sc)) != 0) ||
+ ((rv = nni_aio_alloc(&sc->txaio, http_sconn_txdone, sc)) != 0) ||
+ ((rv = nni_aio_alloc(&sc->txdataio, http_sconn_txdatdone, sc)) !=
0) ||
- ((rv = nni_aio_init(&sc->cbaio, http_sconn_cbdone, sc)) != 0)) {
+ ((rv = nni_aio_alloc(&sc->cbaio, http_sconn_cbdone, sc)) != 0)) {
// Can't even accept the incoming request. Hard close.
http_sconn_close(sc);
return (rv);
@@ -838,7 +838,7 @@ http_server_fini(nni_http_server *s)
nni_mtx_unlock(&s->errors_mtx);
nni_mtx_fini(&s->errors_mtx);
- nni_aio_fini(s->accaio);
+ nni_aio_free(s->accaio);
nni_mtx_fini(&s->mtx);
nni_strfree(s->hostname);
NNI_FREE_STRUCT(s);
@@ -874,7 +874,7 @@ http_server_init(nni_http_server **serverp, const nni_url *url)
nni_mtx_init(&s->errors_mtx);
NNI_LIST_INIT(&s->errors, http_error, node);
- if ((rv = nni_aio_init(&s->accaio, http_server_acccb, s)) != 0) {
+ if ((rv = nni_aio_alloc(&s->accaio, http_server_acccb, s)) != 0) {
http_server_fini(s);
return (rv);
}