1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

Support empty ping and pong packets.

This commit is contained in:
Joachim Bauch 2013-06-19 15:00:23 +02:00
parent 0c9563bbd2
commit 8977d5e513

View file

@ -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;
}