From 8977d5e513a2732b5c21fc78e29f9793c4188f45 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Wed, 19 Jun 2013 15:00:23 +0200 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 ef823c3e9..37502dd27 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; }