diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-03-20 18:38:54 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-03-20 18:42:23 -0700 |
| commit | 6df40cb6eea9a4220d61c4c927ce5a857a12a338 (patch) | |
| tree | ac4b7ecbcb41a456eb4d0429fc180047656371ba /src/transport/ws/websocket.c | |
| parent | 9ca901c1b70b17d851426483d9f54611cfa8e395 (diff) | |
| download | nng-6df40cb6eea9a4220d61c4c927ce5a857a12a338.tar.gz nng-6df40cb6eea9a4220d61c4c927ce5a857a12a338.tar.bz2 nng-6df40cb6eea9a4220d61c4c927ce5a857a12a338.zip | |
fixes #301 String option handling for getopt
Diffstat (limited to 'src/transport/ws/websocket.c')
| -rw-r--r-- | src/transport/ws/websocket.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/transport/ws/websocket.c b/src/transport/ws/websocket.c index 1b862d73..1a83462a 100644 --- a/src/transport/ws/websocket.c +++ b/src/transport/ws/websocket.c @@ -470,14 +470,14 @@ ws_ep_setopt_reshdrs(void *arg, const void *v, size_t sz) } static int -ws_ep_getopt_recvmaxsz(void *arg, void *v, size_t *szp) +ws_ep_getopt_recvmaxsz(void *arg, void *v, size_t *szp, int typ) { ws_ep *ep = arg; - return (nni_getopt_size(ep->rcvmax, v, szp)); + return (nni_copyout_size(ep->rcvmax, v, szp, typ)); } static int -ws_pipe_getopt_locaddr(void *arg, void *v, size_t *szp) +ws_pipe_getopt_locaddr(void *arg, void *v, size_t *szp, int typ) { ws_pipe * p = arg; int rv; @@ -485,13 +485,13 @@ ws_pipe_getopt_locaddr(void *arg, void *v, size_t *szp) memset(&sa, 0, sizeof(sa)); if ((rv = nni_ws_sock_addr(p->ws, &sa)) == 0) { - rv = nni_getopt_sockaddr(&sa, v, szp); + rv = nni_copyout_sockaddr(&sa, v, szp, typ); } return (rv); } static int -ws_pipe_getopt_remaddr(void *arg, void *v, size_t *szp) +ws_pipe_getopt_remaddr(void *arg, void *v, size_t *szp, int typ) { ws_pipe * p = arg; int rv; @@ -499,13 +499,13 @@ ws_pipe_getopt_remaddr(void *arg, void *v, size_t *szp) memset(&sa, 0, sizeof(sa)); if ((rv = nni_ws_peer_addr(p->ws, &sa)) == 0) { - rv = nni_getopt_sockaddr(&sa, v, szp); + rv = nni_copyout_sockaddr(&sa, v, szp, typ); } return (rv); } static int -ws_pipe_getopt_reshdrs(void *arg, void *v, size_t *szp) +ws_pipe_getopt_reshdrs(void *arg, void *v, size_t *szp, int typ) { ws_pipe * p = arg; const char *s; @@ -513,11 +513,11 @@ ws_pipe_getopt_reshdrs(void *arg, void *v, size_t *szp) if ((s = nni_ws_response_headers(p->ws)) == NULL) { return (NNG_ENOMEM); } - return (nni_getopt_str(s, v, szp)); + return (nni_copyout_str(s, v, szp, typ)); } static int -ws_pipe_getopt_reqhdrs(void *arg, void *v, size_t *szp) +ws_pipe_getopt_reqhdrs(void *arg, void *v, size_t *szp, int typ) { ws_pipe * p = arg; const char *s; @@ -525,14 +525,14 @@ ws_pipe_getopt_reqhdrs(void *arg, void *v, size_t *szp) if ((s = nni_ws_request_headers(p->ws)) == NULL) { return (NNG_ENOMEM); } - return (nni_getopt_str(s, v, szp)); + return (nni_copyout_str(s, v, szp, typ)); } static int -ws_pipe_getopt_tls_verified(void *arg, void *v, size_t *szp) +ws_pipe_getopt_tls_verified(void *arg, void *v, size_t *szp, int typ) { ws_pipe *p = arg; - return (nni_getopt_bool(nni_ws_tls_verified(p->ws), v, szp)); + return (nni_copyout_bool(nni_ws_tls_verified(p->ws), v, szp, typ)); } static nni_tran_pipe_option ws_pipe_options[] = { @@ -815,14 +815,14 @@ wss_get_tls(ws_ep *ep, nng_tls_config **tlsp) } static int -wss_ep_getopt_tlsconfig(void *arg, void *v, size_t *szp) +wss_ep_getopt_tlsconfig(void *arg, void *v, size_t *szp, int typ) { ws_ep * ep = arg; nng_tls_config *tls; int rv; if (((rv = wss_get_tls(ep, &tls)) != 0) || - ((rv = nni_getopt_ptr(tls, v, szp)) != 0)) { + ((rv = nni_copyout_ptr(tls, v, szp, typ)) != 0)) { return (rv); } return (0); |
