# HG changeset patch # User Matthew Wild # Date 1326689063 0 # Node ID 938d878d80873306ccfc7a1cfaead1586729231f # Parent fc8a22936b3cdb505221e52a302268391b2aab12 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 diff -r fc8a22936b3c -r 938d878d8087 net/server_event.lua --- a/net/server_event.lua Fri Jan 13 23:30:32 2012 +0000 +++ b/net/server_event.lua Mon Jan 16 04:44:23 2012 +0000 @@ -295,7 +295,10 @@ 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 @@ return -1 end end + if interface.noreading then + interface.eventread = nil; + return -1; + end return EV_READ, cfg.READ_TIMEOUT end end