aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_event.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-05-05 15:23:17 +0100
committerMatthew Wild <mwild1@gmail.com>2010-05-05 15:23:17 +0100
commit242d67b43e37e5fa4a831011f70a2429957f7b6b (patch)
tree3544518eeb87b7575d8367bfa293ba17ea081757 /net/server_event.lua
parentc51d0beea7af41fd615cb11640a2a6bb0fcf1aab (diff)
downloadprosody-242d67b43e37e5fa4a831011f70a2429957f7b6b.tar.gz
prosody-242d67b43e37e5fa4a831011f70a2429957f7b6b.zip
net.server_select, net.server_event: Rename :pattern() method to :set_mode() for select backend, and add :set_mode() to event backend
Diffstat (limited to 'net/server_event.lua')
-rw-r--r--net/server_event.lua9
1 files changed, 8 insertions, 1 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 )