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:
parent
a7bd77944f
commit
8819c4101f
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue