mod_net_multiplex: Read no more than the max buffer size setting
authorKim Alvefur <zash@zash.se>
Sun, 02 Aug 2020 00:22:57 +0200
changeset 11027 a59b37b03eca
parent 11026 3e5bc34be734
child 11028 1c7602c70d1f
mod_net_multiplex: Read no more than the max buffer size setting Otherwise the '*a' read mode applies, which under certain circumstances can read infinite amounts of data into memory.
plugins/mod_net_multiplex.lua
--- a/plugins/mod_net_multiplex.lua	Sat Aug 01 18:41:30 2020 +0200
+++ b/plugins/mod_net_multiplex.lua	Sun Aug 02 00:22:57 2020 +0200
@@ -41,7 +41,7 @@
 
 local buffers = {};
 
-local listener = { default_mode = "*a" };
+local listener = { default_mode = max_buffer_len };
 
 function listener.onconnect(conn)
 	local sock = conn:socket();