Merge 0.7->trunk

This commit is contained in:
Matthew Wild 2010-07-02 17:44:14 +01:00
commit f654c43008
2 changed files with 5 additions and 5 deletions

View file

@ -208,7 +208,7 @@ end
function attempt_connection(host_session, err)
local from_host, to_host = host_session.from_host, host_session.to_host;
local connect_host, connect_port = idna_to_ascii(to_host), 5269;
local connect_host, connect_port = to_host and idna_to_ascii(to_host), 5269;
if not connect_host then
return false;

View file

@ -343,9 +343,9 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
_closelist[ handler ] = nil
handler = nil
end
if server then
server.remove( )
end
if server then
server.remove( )
end
out_put "server.lua: closed client handler and removed socket from list"
return true
end
@ -479,11 +479,11 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
bufferqueuelen = 0
bufferlen = 0
_sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) -- delete socket from writelist
_ = needtls and handler:starttls(nil, true)
_writetimes[ handler ] = nil
if drain then
drain(handler)
end
_ = needtls and handler:starttls(nil, true)
_ = toclose and handler:close( )
return true
elseif byte and ( err == "timeout" or err == "wantwrite" ) then -- want write