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
commit422af47bdddc607f7f9bc7673a335bc86fe03188 (patch)
treef781aa99c0be8e57c2d306e8c4541f2e2f478329 /net
parentd39558af1788626626d13e66f5b13cbd1228efa0 (diff)
downloadprosody-422af47bdddc607f7f9bc7673a335bc86fe03188.tar.gz
prosody-422af47bdddc607f7f9bc7673a335bc86fe03188.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