summaryrefslogtreecommitdiff
path: root/tests/wss.c
diff options
context:
space:
mode:
authorEdward Rudd <urkle@outoforder.cc>2021-12-29 10:13:09 -0500
committerGitHub <noreply@github.com>2021-12-29 07:13:09 -0800
commit44fadb7042fbfdf75f20572c59e410f406bb82f4 (patch)
treeaa8380a652d7666f9f51732361494db79ec7114a /tests/wss.c
parent6cf5acb15147766eebdd6cf2731eacd8e0e31518 (diff)
downloadnng-44fadb7042fbfdf75f20572c59e410f406bb82f4.tar.gz
nng-44fadb7042fbfdf75f20572c59e410f406bb82f4.tar.bz2
nng-44fadb7042fbfdf75f20572c59e410f406bb82f4.zip
don't use deprecated functions in tests (#1560)
Diffstat (limited to 'tests/wss.c')
-rw-r--r--tests/wss.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/wss.c b/tests/wss.c
index 0f570b81..455d9d85 100644
--- a/tests/wss.c
+++ b/tests/wss.c
@@ -143,24 +143,24 @@ check_props(nng_msg *msg)
So(nng_pipe_id(p) > 0);
z = sizeof(nng_sockaddr);
- So(nng_pipe_getopt(p, NNG_OPT_LOCADDR, &la, &z) == 0);
+ So(nng_pipe_get(p, NNG_OPT_LOCADDR, &la, &z) == 0);
So(z == sizeof(la));
So(validloopback(&la));
z = sizeof(nng_sockaddr);
- So(nng_pipe_getopt(p, NNG_OPT_REMADDR, &ra, &z) == 0);
+ So(nng_pipe_get(p, NNG_OPT_REMADDR, &ra, &z) == 0);
So(z == sizeof(ra));
So(validloopback(&ra));
// Request header
z = 0;
buf = NULL;
- So(nng_pipe_getopt(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) ==
+ So(nng_pipe_get(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) ==
NNG_EINVAL);
So(z > 0);
len = z;
So((buf = nng_alloc(len)) != NULL);
- So(nng_pipe_getopt(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == 0);
+ So(nng_pipe_get(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == 0);
So(strstr(buf, "Sec-WebSocket-Key") != NULL);
So(z == len);
nng_free(buf, len);
@@ -168,12 +168,12 @@ check_props(nng_msg *msg)
// Response header
z = 0;
buf = NULL;
- So(nng_pipe_getopt(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) ==
+ So(nng_pipe_get(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) ==
NNG_EINVAL);
So(z > 0);
len = z;
So((buf = nng_alloc(len)) != NULL);
- So(nng_pipe_getopt(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) == 0);
+ So(nng_pipe_get(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) == 0);
So(strstr(buf, "Sec-WebSocket-Accept") != NULL);
So(z == len);
nng_free(buf, len);
@@ -200,7 +200,7 @@ init_dialer_wss(nng_dialer d)
0) {
goto out;
}
- rv = nng_dialer_setopt_ptr(d, NNG_OPT_TLS_CONFIG, cfg);
+ rv = nng_dialer_set_ptr(d, NNG_OPT_TLS_CONFIG, cfg);
out:
nng_tls_config_free(cfg);
@@ -220,7 +220,7 @@ init_listener_wss(nng_listener l)
goto out;
}
- if ((rv = nng_listener_setopt_ptr(l, NNG_OPT_TLS_CONFIG, cfg)) != 0) {
+ if ((rv = nng_listener_set_ptr(l, NNG_OPT_TLS_CONFIG, cfg)) != 0) {
// We can wind up with EBUSY from the server already running.
if (rv == NNG_EBUSY) {
rv = 0;