Software /
code /
prosody
Diff
net/server.lua @ 1953:64538c620450
Merge with 0.5
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 14 Oct 2009 14:12:14 +0100 |
parent | 1886:d19c0a21bfb6 |
parent | 1952:4a15b176fca8 |
child | 1979:52ddaa2e6ab8 |
line wrap: on
line diff
--- a/net/server.lua Tue Oct 13 11:13:52 2009 +0100 +++ b/net/server.lua Wed Oct 14 14:12:14 2009 +0100 @@ -371,18 +371,20 @@ 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