aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-09-28 16:36:12 +0100
committerMatthew Wild <mwild1@gmail.com>2020-09-28 16:36:12 +0100
commit74f380f064c286cf81426cc443474d2cbee2399a (patch)
tree1e5f939681c1ef6d401eae35691d8ba8bace92b1 /plugins
parent68208217aff9d76528b92777f078cff4d68324be (diff)
downloadprosody-74f380f064c286cf81426cc443474d2cbee2399a.tar.gz
prosody-74f380f064c286cf81426cc443474d2cbee2399a.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_websocket.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_websocket.lua b/plugins/mod_websocket.lua
index 0bd001f4..ecc12a45 100644
--- a/plugins/mod_websocket.lua
+++ b/plugins/mod_websocket.lua
@@ -291,7 +291,7 @@ function handle_request(event)
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