aboutsummaryrefslogtreecommitdiffstats
path: root/net
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
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')
-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