aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/server_event.lua9
-rw-r--r--net/server_select.lua2
2 files changed, 9 insertions, 2 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index c28c5ce2..bbc9a527 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -402,6 +402,13 @@ do
self.starttls = false; -- prevent starttls()
end
end
+
+ function interface_mt:set_mode(pattern)
+ if pattern then
+ self._pattern = pattern;
+ end
+ return self._pattern;
+ end
function interface_mt:set_send(new_send)
-- No-op, we always use the underlying connection's send
@@ -599,7 +606,7 @@ do
interface.eventreadtimeout = nil
end
end
- local buffer, err, part = interface.conn:receive( pattern ) -- receive buffer with "pattern"
+ local buffer, err, part = interface.conn:receive( interface._pattern ) -- receive buffer with "pattern"
--vdebug( "read data:", tostring(buffer), "error:", tostring(err), "part:", tostring(part) )
buffer = buffer or part or ""
local len = string_len( buffer )
diff --git a/net/server_select.lua b/net/server_select.lua
index 6d6f7fbc..475e8aca 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -379,7 +379,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
handler.socket = function( self )
return socket
end
- handler.pattern = function( self, new )
+ handler.set_mode = function( self, new )
pattern = new or pattern
return pattern
end