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-23 14:47:26 +08:00 committed by Andy Green
parent d8b8542d59
commit d727e9f698

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