aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/websocket/websocket.c
diff options
context:
space:
mode:
authorBertrand <1984775+bertrand-@users.noreply.github.com>2018-11-17 17:25:50 +0000
committerGarrett D'Amore <garrett@damore.org>2018-11-17 09:25:50 -0800
commitdda1515cd08c23e056a1a25768c59bdafe11fe6b (patch)
tree35d25ebdecc1b795d6ec3e30781b70cee0fcdf65 /src/supplemental/websocket/websocket.c
parent25fe93b15d322bbe288e49acfc63002f8071158b (diff)
downloadnng-dda1515cd08c23e056a1a25768c59bdafe11fe6b.tar.gz
nng-dda1515cd08c23e056a1a25768c59bdafe11fe6b.tar.bz2
nng-dda1515cd08c23e056a1a25768c59bdafe11fe6b.zip
fixes #789 Websocket ping request crash
Diffstat (limited to 'src/supplemental/websocket/websocket.c')
-rw-r--r--src/supplemental/websocket/websocket.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/supplemental/websocket/websocket.c b/src/supplemental/websocket/websocket.c
index f0a1a269..c214e6d7 100644
--- a/src/supplemental/websocket/websocket.c
+++ b/src/supplemental/websocket/websocket.c
@@ -687,10 +687,8 @@ ws_send_control(nni_ws *ws, uint8_t op, uint8_t *buf, size_t len)
// Note that we do not care if this works or not. So no AIO needed.
- nni_mtx_lock(&ws->mtx);
if ((ws->closed) ||
(ws_msg_init_control(&wm, ws, op, buf, len) != 0)) {
- nni_mtx_unlock(&ws->mtx);
return;
}
@@ -698,7 +696,6 @@ ws_send_control(nni_ws *ws, uint8_t op, uint8_t *buf, size_t len)
// the close frame or other ping/pong requests. Oh well.)
nni_list_prepend(&ws->txmsgs, wm);
ws_start_write(ws);
- nni_mtx_unlock(&ws->mtx);
}
int