diff options
Diffstat (limited to 'src/supplemental/http/http_server_test.c')
| -rw-r--r-- | src/supplemental/http/http_server_test.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/supplemental/http/http_server_test.c b/src/supplemental/http/http_server_test.c index 37c45f14..91411499 100644 --- a/src/supplemental/http/http_server_test.c +++ b/src/supplemental/http/http_server_test.c @@ -10,6 +10,7 @@ // // Basic HTTP server tests. +#include "core/defs.h" #include <nng/nng.h> #include <nng/supplemental/http/http.h> @@ -141,21 +142,20 @@ fail: } static void -httpecho(nng_aio *aio) +httpecho(nng_http_conn *conn, void *arg, nng_aio *aio) { - nng_http_req *req = nng_aio_get_input(aio, 0); - nng_http_res *res; + nng_http_req *req = nng_http_conn_req(conn); + nng_http_res *res = nng_http_conn_res(conn); int rv; void *body; size_t len; + NNI_ARG_UNUSED(arg); nng_http_req_get_data(req, &body, &len); - if (((rv = nng_http_res_alloc(&res)) != 0) || - ((rv = nng_http_res_copy_data(res, body, len)) != 0) || + if (((rv = nng_http_res_copy_data(res, body, len)) != 0) || ((rv = nng_http_res_set_header( res, "Content-type", "text/plain")) != 0)) { - nng_http_res_free(res); nng_aio_finish(aio, rv); return; } |
