From 765914cab1824563335f43009bd85be67f2ced6d Mon Sep 17 00:00:00 2001 From: Andrejs Hanins Date: Tue, 1 Dec 2015 14:44:33 +0200 Subject: [PATCH] Allow zero-length pong to be received by server Client code already allows zero-length pongs --- lib/parsers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/parsers.c b/lib/parsers.c index ef9c3e7..cec9585 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -985,7 +985,8 @@ ping_drop: LWS_EXT_CALLBACK_PAYLOAD_RX, &eff_buf, 0) < 0) return -1; - if (eff_buf.token_len > 0) { + if (eff_buf.token_len > 0 || + callback_action == LWS_CALLBACK_RECEIVE_PONG) { eff_buf.token[eff_buf.token_len] = '\0'; if (wsi->protocol->callback) { -- 2.7.4