aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport/ws
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp/transport/ws')
-rw-r--r--src/sp/transport/ws/CMakeLists.txt15
-rw-r--r--src/sp/transport/ws/websocket.c8
2 files changed, 16 insertions, 7 deletions
diff --git a/src/sp/transport/ws/CMakeLists.txt b/src/sp/transport/ws/CMakeLists.txt
index 437d0919..2b477c27 100644
--- a/src/sp/transport/ws/CMakeLists.txt
+++ b/src/sp/transport/ws/CMakeLists.txt
@@ -12,11 +12,14 @@
nng_directory(ws)
if (NNG_TRANSPORT_WS OR NNG_TRANSPORT_WSS)
- set(WS_ON ON)
+ nng_sources(websocket.c)
endif()
-nng_defines_if(NNG_TRANSPORT_WS NNG_TRANSPORT_WS)
-nng_defines_if(NNG_TRANSPORT_WSS NNG_TRANSPORT_WSS)
-nng_sources_if(WS_ON websocket.c)
-nng_test_if(WS_ON ws_test)
-nng_test_if(NNG_TRANSPORT_WSS wss_test)
+if (NNG_TRANSPORT_WS)
+ nng_defines(NNG_TRANSPORT_WS)
+ nng_test(ws_test)
+endif()
+if (NNG_TRANSPORT_WSS)
+ nng_defines(NNG_TRANSPORT_WSS)
+ nng_test(wss_test)
+endif()
diff --git a/src/sp/transport/ws/websocket.c b/src/sp/transport/ws/websocket.c
index b6045306..515f7b65 100644
--- a/src/sp/transport/ws/websocket.c
+++ b/src/sp/transport/ws/websocket.c
@@ -328,8 +328,14 @@ wstran_pipe_getopt(
return (rv);
}
+static size_t
+wstran_pipe_size(void)
+{
+ return (sizeof(ws_pipe));
+}
+
static nni_sp_pipe_ops ws_pipe_ops = {
- .p_size = sizeof(ws_pipe),
+ .p_size = wstran_pipe_size,
.p_init = wstran_pipe_init,
.p_fini = wstran_pipe_fini,
.p_stop = wstran_pipe_stop,