aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-10-14 14:12:14 +0100
committerMatthew Wild <mwild1@gmail.com>2009-10-14 14:12:14 +0100
commit1f3374a1300f5915e1b40728bdf4fe8b39ae114e (patch)
treedc07325149c3f984a279d757512c0e779aadbde1 /net
parent257023aae10ea18352719f60fc963a219dcfad7b (diff)
parent68f948425a7f0665fbbea3b35393f23eec256516 (diff)
downloadprosody-1f3374a1300f5915e1b40728bdf4fe8b39ae114e.tar.gz
prosody-1f3374a1300f5915e1b40728bdf4fe8b39ae114e.zip
Merge with 0.5
Diffstat (limited to 'net')
-rw-r--r--net/server.lua16
-rw-r--r--net/xmppserver_listener.lua3
2 files changed, 12 insertions, 7 deletions
diff --git a/net/server.lua b/net/server.lua
index 54eadbc6..1260a260 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -371,18 +371,20 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
send( socket, table_concat( bufferqueue, "", 1, bufferqueuelen ), 1, bufferlen ) -- forced send
end
end
- if not handler then return true; end
- _ = shutdown and shutdown( socket )
- socket:close( )
- _sendlistlen = removesocket( _sendlist, socket, _sendlistlen )
- _socketlist[ socket ] = nil
+ if socket then
+ _ = shutdown and shutdown( socket )
+ socket:close( )
+ _sendlistlen = removesocket( _sendlist, socket, _sendlistlen )
+ _socketlist[ socket ] = nil
+ socket = nil
+ else
+ out_put "server.lua: socket already closed"
+ end
if handler then
_writetimes[ handler ] = nil
_closelist[ handler ] = nil
handler = nil
end
- socket = nil
- --mem_free( )
if server then
server.remove( )
end
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua
index 831f7c3c..ccea1170 100644
--- a/net/xmppserver_listener.lua
+++ b/net/xmppserver_listener.lua
@@ -100,6 +100,9 @@ local function session_close(session, reason)
end
end
session.sends2s("</stream:stream>");
+ if sesson.notopen or not session.conn.close() then
+ session.conn.close(true); -- Force FIXME: timer?
+ end
session.conn.close();
xmppserver.disconnect(session.conn, "stream error");
end