From be13c2e8845423cec17af429fc4e16a5d9749e47 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 26 Oct 2025 10:54:58 -0700 Subject: Replace nng_pipe_get_addr, nng_stream_get_addr, and the NNG_OPT_REMADDR option. More direct access methods are provided instead. This results in much lower friction when using, and is a step on the path to removing NNG_OPT_LOCADDR as well. We need to figure a solution for NNG_OPT_LOCADDR for dialers; for listeners there is little use in it either, and it will be removed. (Dialers will probably get a new NNG_OPT_BIND_IP option.) --- src/supplemental/http/http_server_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/supplemental/http/http_server_test.c') diff --git a/src/supplemental/http/http_server_test.c b/src/supplemental/http/http_server_test.c index d299cb97..19449b9c 100644 --- a/src/supplemental/http/http_server_test.c +++ b/src/supplemental/http/http_server_test.c @@ -190,7 +190,7 @@ httpaddrcheck(nng_http *conn, void *arg, nng_aio *aio) static void server_setup(struct server_test *st, nng_http_handler *h) { - nng_sockaddr sa; + int port; memset(st, 0, sizeof(*st)); NUTS_PASS(nng_url_parse(&st->url, "http://127.0.0.1:0")); NUTS_PASS(nng_aio_alloc(&st->aio, NULL, NULL)); @@ -200,8 +200,8 @@ server_setup(struct server_test *st, nng_http_handler *h) NUTS_PASS(nng_http_server_add_handler(st->s, h)); } NUTS_PASS(nng_http_server_start(st->s)); - NUTS_PASS(nng_http_server_get_addr(st->s, &sa)); - nng_url_resolve_port(st->url, nng_sockaddr_port(&sa)); + NUTS_PASS(nng_http_server_get_port(st->s, &port)); + nng_url_resolve_port(st->url, (uint32_t) port); nng_url_sprintf(st->urlstr, sizeof(st->urlstr), st->url); NUTS_PASS(nng_http_client_alloc(&st->cli, st->url)); -- cgit v1.2.3-70-g09d2