aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-01-16 04:44:23 +0000
committerMatthew Wild <mwild1@gmail.com>2012-01-16 04:44:23 +0000
commit5d81665f61754324c10879d5ef7bf259c4e3debf (patch)
treef781aa99c0be8e57c2d306e8c4541f2e2f478329 /net
parent08fe482e7f8c4e1971d5a4a66a3419bca4fb4022 (diff)
downloadprosody-5d81665f61754324c10879d5ef7bf259c4e3debf.tar.gz
prosody-5d81665f61754324c10879d5ef7bf259c4e3debf.zip
net.server_event: Fix :pause() to actually stop reading from the socket, rather than ignoring socket-readable events (!), and :resume() to restart the event listener
Diffstat (limited to 'net')
-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 f4745c34..dbf5161f 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -295,7 +295,10 @@ do
end
function interface_mt:resume()
- return self:_lock(self.nointerface, false, self.nowriting);
+ self:_lock(self.nointerface, false, self.nowriting);
+ if not self.eventread then
+ self.eventread = addevent( base, self.conn, EV_READ, self.readcallback, cfg.READ_TIMEOUT ); -- register callback
+ end
end
function interface_mt:counter(c)
@@ -642,6 +645,10 @@ do
return -1
end
end
+ if interface.noreading then
+ interface.eventread = nil;
+ return -1;
+ end
return EV_READ, cfg.READ_TIMEOUT
end
end