aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/http/http_conn.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-10-09 07:54:52 -0700
committerGarrett D'Amore <garrett@damore.org>2025-10-09 19:01:15 -0700
commitf41cd6a9edf4b9a680194b3fb4378f39d1ed1f34 (patch)
tree6179629b18645429e44e1440063363e975138923 /src/supplemental/http/http_conn.c
parent9601545c27c948e9df530c5f0a912fb15cab9101 (diff)
downloadnng-f41cd6a9edf4b9a680194b3fb4378f39d1ed1f34.tar.gz
nng-f41cd6a9edf4b9a680194b3fb4378f39d1ed1f34.tar.bz2
nng-f41cd6a9edf4b9a680194b3fb4378f39d1ed1f34.zip
fixes #1868 Add nng_http_[remote,local]_address APIs.
Diffstat (limited to 'src/supplemental/http/http_conn.c')
-rw-r--r--src/supplemental/http/http_conn.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/supplemental/http/http_conn.c b/src/supplemental/http/http_conn.c
index 6f2ecef6..ac549649 100644
--- a/src/supplemental/http/http_conn.c
+++ b/src/supplemental/http/http_conn.c
@@ -159,6 +159,16 @@ nni_http_conn_close(nni_http_conn *conn)
nni_mtx_unlock(&conn->mtx);
}
+nng_err
+nni_http_get_addr(nni_http_conn *conn, const char *opt, nng_sockaddr *addrp)
+{
+ nng_err rv;
+ nni_mtx_lock(&conn->mtx);
+ rv = nng_stream_get_addr(conn->sock, opt, addrp);
+ nni_mtx_unlock(&conn->mtx);
+ return (rv);
+}
+
// http_buf_pull_up pulls the content of the read buffer back to the
// beginning, so that the next read can go at the end. This avoids the problem
// of dealing with a read that might wrap.