protocol: fix lws callback compatibility

This commit is contained in:
Shuanglei Tao
2020-03-10 09:41:35 +08:00
parent 79acf9e896
commit 48f53bcc00

View File

@@ -419,6 +419,9 @@ callback_tty(struct lws *wsi, enum lws_callback_reasons reason,
break; break;
case LWS_CALLBACK_CLOSED: case LWS_CALLBACK_CLOSED:
if (pss->wsi == NULL)
break;
server->client_count--; server->client_count--;
lwsl_notice("WS closed from %s, clients: %d\n", pss->address, server->client_count); lwsl_notice("WS closed from %s, clients: %d\n", pss->address, server->client_count);
if (pss->buffer != NULL) { if (pss->buffer != NULL) {