diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-10-25 23:02:17 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-10-25 23:02:17 -0700 |
| commit | f9ff44ce0f0c73f05c182bb07c76bf6b51470560 (patch) | |
| tree | bc37e151ab8527ca6df85ccb079c2b03673ba319 /src/sp/transport/ws/websocket.c | |
| parent | c2aa8c12e705ba77f3d2d28c5ba0a9ec7efb7632 (diff) | |
| download | nng-f9ff44ce0f0c73f05c182bb07c76bf6b51470560.tar.gz nng-f9ff44ce0f0c73f05c182bb07c76bf6b51470560.tar.bz2 nng-f9ff44ce0f0c73f05c182bb07c76bf6b51470560.zip | |
Plumb sockaddrs all the way through pipes, make them failsafe.
These functions can no longer fail.
Diffstat (limited to 'src/sp/transport/ws/websocket.c')
| -rw-r--r-- | src/sp/transport/ws/websocket.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sp/transport/ws/websocket.c b/src/sp/transport/ws/websocket.c index fe6794c1..dec0ea8e 100644 --- a/src/sp/transport/ws/websocket.c +++ b/src/sp/transport/ws/websocket.c @@ -336,6 +336,20 @@ wstran_pipe_peer_cert(void *arg, nng_tls_cert **certp) return (nng_stream_peer_cert(p->ws, certp)); } +static const nng_sockaddr * +wstran_pipe_peer_addr(void *arg) +{ + ws_pipe *p = arg; + return (nng_stream_peer_addr(p->ws)); +} + +static const nng_sockaddr * +wstran_pipe_self_addr(void *arg) +{ + ws_pipe *p = arg; + return (nng_stream_self_addr(p->ws)); +} + static size_t wstran_pipe_size(void) { @@ -353,6 +367,8 @@ static nni_sp_pipe_ops ws_pipe_ops = { .p_peer = wstran_pipe_peer, .p_getopt = wstran_pipe_getopt, .p_peer_cert = wstran_pipe_peer_cert, + .p_peer_addr = wstran_pipe_peer_addr, + .p_self_addr = wstran_pipe_self_addr, }; static void |
