# HG changeset patch # User Matthew Wild # Date 1601307372 -3600 # Node ID 55d8612ac3573f01534d82d8d6a140fba58c3fa8 # Parent 67fb92e312f15c45b66b5f37d05638b345b1cfe3 mod_websocket: Continue to process data already in the buffer after an error occurs Previously any error, or even a normal websocket close frame, would return early, leaving potentially entire frames in the buffer unprocessed and then discarded. This change stops processing new data, but returns an existing processed data up to the point of the error/close. diff -r 67fb92e312f1 -r 55d8612ac357 plugins/mod_websocket.lua --- a/plugins/mod_websocket.lua Thu Sep 17 16:42:36 2020 +0100 +++ b/plugins/mod_websocket.lua Mon Sep 28 16:36:12 2020 +0100 @@ -291,7 +291,7 @@ end frameBuffer:discard(length); local result = handle_frame(frame); - if not result then return; end + if not result then break; end cache[#cache+1] = filter_open_close(result); frame, length = parse_frame(frameBuffer); end