diff options
author | Kim Alvefur <zash@zash.se> | 2016-03-02 16:34:34 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-03-02 16:34:34 +0100 |
commit | a6931a80e52b4bd32bf91d8d6163e82006972b83 (patch) | |
tree | 503e8a7491dba1c841c729de3c74b2b63d529298 | |
parent | 489122032eb363a6de4aa173e213741ccf1a95ef (diff) | |
parent | f5b5f7639813c293c65a73e3f70847d32c76d451 (diff) | |
download | prosody-a6931a80e52b4bd32bf91d8d6163e82006972b83.tar.gz prosody-a6931a80e52b4bd32bf91d8d6163e82006972b83.zip |
Merge 0.10->trunk
-rw-r--r-- | net/server_event.lua | 15 | ||||
-rw-r--r-- | plugins/mod_c2s.lua | 1 |
2 files changed, 9 insertions, 7 deletions
diff --git a/net/server_event.lua b/net/server_event.lua index 67758664..7940a1b8 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -238,8 +238,8 @@ function interface_mt:_destroy() -- close this interface + events and call last end function interface_mt:_lock(nointerface, noreading, nowriting) -- lock or unlock this interface or events - self.nointerface, self.noreading, self.nowriting = nointerface, noreading, nowriting - return nointerface, noreading, nowriting + self.nointerface, self.noreading, self.nowriting = nointerface, noreading, nowriting + return nointerface, noreading, nowriting end --TODO: Deprecate @@ -257,8 +257,9 @@ end function interface_mt:resume() self:_lock(self.nointerface, false, self.nowriting); - if not self.eventread then + if self.readcallback and not self.eventread then self.eventread = addevent( base, self.conn, EV_READ, self.readcallback, cfg.READ_TIMEOUT ); -- register callback + return true; end end @@ -740,7 +741,7 @@ end local function newevent( ... ) return addevent( base, ... ) - end +end local function closeallservers ( arg ) for item in pairs( interfacelist ) do @@ -752,9 +753,9 @@ end local function setquitting(yes) if yes then - -- Quit now - closeallservers(); - base:loopexit(); + -- Quit now + closeallservers(); + base:loopexit(); end end diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index c638cd03..42c35689 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -283,6 +283,7 @@ function listener.ondisconnect(conn, err) if session then (session.log or log)("info", "Client disconnected: %s", err or "connection closed"); sm_destroy_session(session, err); + session.conn = nil; sessions[conn] = nil; end end |