From c34abc224e572b19fb5aa1b5afc8841705485d14 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 12 Jan 2025 10:42:54 -0800 Subject: http: remove unused nng_http_handler_get_data The data is now passed directly to the handler function. --- src/supplemental/http/http_api.h | 6 +----- src/supplemental/http/http_public.c | 11 ----------- src/supplemental/http/http_server.c | 6 ------ 3 files changed, 1 insertion(+), 22 deletions(-) (limited to 'src') diff --git a/src/supplemental/http/http_api.h b/src/supplemental/http/http_api.h index c8d73788..63a4adab 100644 --- a/src/supplemental/http/http_api.h +++ b/src/supplemental/http/http_api.h @@ -294,15 +294,11 @@ extern void nni_http_handler_set_host(nni_http_handler *, const char *); extern void nni_http_handler_set_method(nni_http_handler *, const char *); // nni_http_handler_set_data sets an opaque data element on the handler, -// which will be available to the callback via nni_http_handler_get_data. +// which will be available to the handler function as argument. // The callback is an optional destructor, and will be called with the // data as its argument, when the handler is being destroyed. extern void nni_http_handler_set_data(nni_http_handler *, void *, nni_cb); -// nni_http_handler_get_data returns the data that was previously stored -// by nni_http_handler_set_data. -extern void *nni_http_handler_get_data(nni_http_handler *); - // nni_http_handler_get_uri returns the URI set on the handler. extern const char *nni_http_handler_get_uri(nni_http_handler *); diff --git a/src/supplemental/http/http_public.c b/src/supplemental/http/http_public.c index 8210224b..9c4145fd 100644 --- a/src/supplemental/http/http_public.c +++ b/src/supplemental/http/http_public.c @@ -434,17 +434,6 @@ nng_http_handler_set_data(nng_http_handler *h, void *dat, void (*dtor)(void *)) #endif } -void * -nng_http_handler_get_data(nng_http_handler *h) -{ -#ifdef NNG_SUPP_HTTP - return (nni_http_handler_get_data(h)); -#else - NNI_ARG_UNUSED(h); - return (NULL); -#endif -} - int nng_http_server_hold(nng_http_server **srvp, const nng_url *url) { diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c index 5d6a2aee..9a9a619f 100644 --- a/src/supplemental/http/http_server.c +++ b/src/supplemental/http/http_server.c @@ -163,12 +163,6 @@ nni_http_handler_set_data(nni_http_handler *h, void *data, nni_cb dtor) h->dtor = dtor; } -void * -nni_http_handler_get_data(nni_http_handler *h) -{ - return (h->data); -} - const char * nni_http_handler_get_uri(nni_http_handler *h) { -- cgit v1.2.3-70-g09d2