1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

websocket: clear buffer of received data once completely parsed

This commit is contained in:
Steffen Vogel 2018-05-26 01:13:22 +02:00
parent a7bd77944f
commit 8819c4101f

View file

@ -321,6 +321,8 @@ int websocket_protocol_cb(struct lws *wsi, enum lws_callback_reasons reason, voi
if (enqueued < avail)
sample_put_many(&smps[enqueued], avail - enqueued);
buffer_clear(&c->buffers.recv);
if (c->state == STATE_SHUTDOWN) {
websocket_connection_close(c, wsi, LWS_CLOSE_STATUS_GOINGAWAY, "Node stopped");
return -1;