summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-02-07 14:55:51 -0800
committerGarrett D'Amore <garrett@damore.org>2018-02-07 14:55:51 -0800
commita99cf87099c413cc42642fc7d113092b2f390d91 (patch)
tree1f321577a0e5db2fcb6193c687dd63d49d478e68
parent03447b4532e12df48ab117c7433786334b8aeff7 (diff)
downloadnng-a99cf87099c413cc42642fc7d113092b2f390d91.tar.gz
nng-a99cf87099c413cc42642fc7d113092b2f390d91.tar.bz2
nng-a99cf87099c413cc42642fc7d113092b2f390d91.zip
HTTP public API should initialize the library.
-rw-r--r--src/supplemental/http/http_public.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/supplemental/http/http_public.c b/src/supplemental/http/http_public.c
index 6c28e835..9d23ed8e 100644
--- a/src/supplemental/http/http_public.c
+++ b/src/supplemental/http/http_public.c
@@ -18,6 +18,7 @@ int
nng_http_req_alloc(nng_http_req **reqp, const nng_url *url)
{
#ifdef NNG_SUPP_HTTP
+ nni_init();
return (nni_http_req_alloc(reqp, url));
#else
NNI_ARG_UNUSED(reqp);
@@ -50,6 +51,7 @@ int
nng_http_res_alloc(nng_http_res **resp)
{
#ifdef NNG_SUPP_HTTP
+ nni_init();
return (nni_http_res_alloc(resp));
#else
NNI_ARG_UNUSED(resp);
@@ -60,6 +62,7 @@ nng_http_res_alloc(nng_http_res **resp)
int
nng_http_res_alloc_error(nng_http_res **resp, uint16_t code)
{
+ nni_init();
#ifdef NNG_SUPP_HTTP
return (nni_http_res_alloc_error(resp, code));
#else
@@ -481,6 +484,7 @@ nng_http_handler_alloc(
nng_http_handler **hp, const char *uri, void (*cb)(nng_aio *))
{
#ifdef NNG_SUPP_HTTP
+ nni_init();
return (nni_http_handler_init(hp, uri, cb));
#else
NNI_ARG_UNUSED(hp);
@@ -596,6 +600,7 @@ int
nng_http_server_hold(nng_http_server **srvp, const nng_url *url)
{
#ifdef NNG_SUPP_HTTP
+ nni_init();
return (nni_http_server_init(srvp, url));
#else
NNI_ARG_UNUSED(srvp);
@@ -685,6 +690,7 @@ int
nng_http_client_alloc(nng_http_client **clip, const nng_url *url)
{
#ifdef NNG_SUPP_HTTP
+ nni_init();
return (nni_http_client_init(clip, url));
#else
NNI_ARG_UNUSED(clip);