aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/http/http_public.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-05 11:47:03 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-05 22:39:17 -0800
commitbce6a79fc55852032e9d653b099a121353aaa238 (patch)
tree6e6aa44e73ea7e671a50103539c55443df8c4dc2 /src/supplemental/http/http_public.c
parentd31844817a5b304a894c5b963cd52aeb9e47c627 (diff)
downloadnng-bce6a79fc55852032e9d653b099a121353aaa238.tar.gz
nng-bce6a79fc55852032e9d653b099a121353aaa238.tar.bz2
nng-bce6a79fc55852032e9d653b099a121353aaa238.zip
http: changing transaction API to inline req and res structures
This is a step towards simplifying this API and ultimately simplifying the HTTP callback API used for the server side.
Diffstat (limited to 'src/supplemental/http/http_public.c')
-rw-r--r--src/supplemental/http/http_public.c39
1 files changed, 34 insertions, 5 deletions
diff --git a/src/supplemental/http/http_public.c b/src/supplemental/http/http_public.c
index 88ebaa68..8a81404e 100644
--- a/src/supplemental/http/http_public.c
+++ b/src/supplemental/http/http_public.c
@@ -303,6 +303,18 @@ nng_http_req_set_version(nng_http_req *req, const char *vers)
}
int
+nng_http_req_set_url(nng_http_req *req, const nng_url *url)
+{
+#ifdef NNG_SUPP_HTTP
+ return (nni_http_req_set_url(req, url));
+#else
+ NNI_ARG_UNUSED(req);
+ NNI_ARG_UNUSED(url);
+ return (NNG_ENOTSUP);
+#endif
+}
+
+int
nng_http_req_set_uri(nng_http_req *req, const char *uri)
{
#ifdef NNG_SUPP_HTTP
@@ -382,6 +394,26 @@ nng_http_res_set_reason(nng_http_res *res, const char *rsn)
#endif
}
+nng_http_req *
+nng_http_conn_req(nng_http_conn *conn)
+{
+#ifdef NNG_SUPP_HTTP
+ return (nni_http_conn_req(conn));
+#else
+ return (NULL);
+#endif
+}
+
+nng_http_res *
+nng_http_conn_res(nng_http_conn *conn)
+{
+#ifdef NNG_SUPP_HTTP
+ return (nni_http_conn_res(conn));
+#else
+ return (NULL);
+#endif
+}
+
void
nng_http_conn_close(nng_http_conn *conn)
{
@@ -875,15 +907,12 @@ nng_http_client_transact(
}
void
-nng_http_conn_transact(
- nng_http_conn *conn, nng_http_req *req, nng_http_res *res, nng_aio *aio)
+nng_http_conn_transact(nng_http_conn *conn, nng_aio *aio)
{
#ifdef NNG_SUPP_HTTP
- nni_http_transact_conn(conn, req, res, aio);
+ nni_http_transact_conn(conn, aio);
#else
NNI_ARG_UNUSED(conn);
- NNI_ARG_UNUSED(req);
- NNI_ARG_UNUSED(res);
nni_aio_finish_error(aio, NNG_ENOTSUP);
#endif
}