summaryrefslogtreecommitdiff
path: root/tests/wss.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wss.c')
-rw-r--r--tests/wss.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/wss.c b/tests/wss.c
index 58df8cbf..89a26623 100644
--- a/tests/wss.c
+++ b/tests/wss.c
@@ -156,26 +156,28 @@ check_props(nng_msg *msg)
// Request header
z = 0;
buf = NULL;
- So(nng_pipe_getopt(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == 0);
+ So(nng_pipe_getopt(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) ==
+ NNG_EINVAL);
So(z > 0);
len = z;
- So((buf = nni_alloc(len)) != NULL);
+ So((buf = nng_alloc(len)) != NULL);
So(nng_pipe_getopt(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == 0);
So(strstr(buf, "Sec-WebSocket-Key") != NULL);
So(z == len);
- nni_free(buf, len);
+ nng_free(buf, len);
// Response header
z = 0;
buf = NULL;
- So(nng_pipe_getopt(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) == 0);
+ So(nng_pipe_getopt(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) ==
+ NNG_EINVAL);
So(z > 0);
len = z;
- So((buf = nni_alloc(len)) != NULL);
+ So((buf = nng_alloc(len)) != NULL);
So(nng_pipe_getopt(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) == 0);
So(strstr(buf, "Sec-WebSocket-Accept") != NULL);
So(z == len);
- nni_free(buf, len);
+ nng_free(buf, len);
return (0);
}