diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-12-26 16:18:38 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-12-26 16:37:41 -0800 |
| commit | eb1f8db4ed87867f0f08afba79253e3981db9c88 (patch) | |
| tree | aa85c54c5c53ab62cc269e83c04e106637d49473 /src/supplemental/websocket/websocket.c | |
| parent | 93db6fe3aaff421d61a15993ba6827b742ab00d1 (diff) | |
| download | nng-eb1f8db4ed87867f0f08afba79253e3981db9c88.tar.gz nng-eb1f8db4ed87867f0f08afba79253e3981db9c88.tar.bz2 nng-eb1f8db4ed87867f0f08afba79253e3981db9c88.zip | |
fixes #165 Add address properties for websocket pipes
Diffstat (limited to 'src/supplemental/websocket/websocket.c')
| -rw-r--r-- | src/supplemental/websocket/websocket.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/supplemental/websocket/websocket.c b/src/supplemental/websocket/websocket.c index fe0a9bd9..dfcac3e7 100644 --- a/src/supplemental/websocket/websocket.c +++ b/src/supplemental/websocket/websocket.c @@ -646,6 +646,26 @@ ws_send_control(nni_ws *ws, uint8_t op, uint8_t *buf, size_t len) nni_mtx_unlock(&ws->mtx); } +int +nni_ws_sock_addr(nni_ws *ws, nni_sockaddr *sa) +{ + int rv; + nni_mtx_lock(&ws->mtx); + rv = ws->closed ? NNG_ECLOSED : nni_http_sock_addr(ws->http, sa); + nni_mtx_unlock(&ws->mtx); + return (rv); +} + +int +nni_ws_peer_addr(nni_ws *ws, nni_sockaddr *sa) +{ + int rv; + nni_mtx_lock(&ws->mtx); + rv = ws->closed ? NNG_ECLOSED : nni_http_peer_addr(ws->http, sa); + nni_mtx_unlock(&ws->mtx); + return (rv); +} + void nni_ws_send_msg(nni_ws *ws, nni_aio *aio) { |
