From d727e9f698e91e1832a53e088ad54f2fda69dba8 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Sun, 23 Jun 2013 14:47:26 +0800 Subject: [PATCH] Support empty ping and pong packets. --- lib/output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/output.c b/lib/output.c index ef823c3e..37502dd2 100644 --- a/lib/output.c +++ b/lib/output.c @@ -311,7 +311,7 @@ LWS_VISIBLE int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, int m; #endif - if (len == 0 && protocol != LWS_WRITE_CLOSE) { + if (len == 0 && protocol != LWS_WRITE_CLOSE && protocol != LWS_WRITE_PING && protocol != LWS_WRITE_PONG) { lwsl_warn("zero length libwebsocket_write attempt\n"); return 0; }