aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/supplemental/http/http_public.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/supplemental/http/http_public.c b/src/supplemental/http/http_public.c
index 3152c41f..d2e876ab 100644
--- a/src/supplemental/http/http_public.c
+++ b/src/supplemental/http/http_public.c
@@ -9,8 +9,8 @@
//
#include "core/nng_impl.h"
-#include "nng/supplemental/http/http.h"
#include "http_api.h"
+#include "nng/supplemental/http/http.h"
#include "nng/supplemental/tls/tls.h"
// Symbols in this file are "public" versions of the HTTP API.
@@ -780,6 +780,22 @@ nng_http_server_get_tls(nng_http_server *srv, struct nng_tls_config **cfgp)
}
int
+nng_http_server_get_addr(nng_http_server *srv, nng_sockaddr *addrp)
+{
+#ifdef NNG_SUPP_HTTP
+ size_t size = sizeof(nng_sockaddr);
+ if (srv == NULL || addrp == NULL)
+ return NNG_EINVAL;
+ return (nni_http_server_getx(
+ srv, NNG_OPT_LOCADDR, addrp, &size, NNI_TYPE_SOCKADDR));
+#else
+ NNI_ARG_UNUSED(srv);
+ NNI_ARG_UNUSED(addrp);
+ return (NNG_ENOTSUP);
+#endif
+}
+
+int
nng_http_server_res_error(nng_http_server *srv, nng_http_res *res)
{
#ifdef NNG_SUPP_HTTP