Better connection handling.

This commit is contained in:
Diego Nehab 2005-04-21 03:15:34 +00:00
parent 4e3cf63c95
commit 434e8e014c
4 changed files with 26 additions and 16 deletions

View file

@ -76,13 +76,13 @@ function connect(who, host, port)
if not ret and err == "timeout" then
wait(who, "output")
ret, err = who:connect(host, port)
if not ret and err ~= "already connected" then
kick(who)
kick(context[who].peer)
return
end
end
if not ret then
kick(who)
kick(context[who].peer)
else
return forward(who)
end
return forward(who)
end
-- gets rid of a client