Changeset

11111:55d8612ac357 0.11

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.
author Matthew Wild <mwild1@gmail.com>
date Mon, 28 Sep 2020 16:36:12 +0100
parents 11110:67fb92e312f1
children 11112:bcc701377fe4
files plugins/mod_websocket.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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