From: Pat Thoyts Date: Sun, 14 Feb 2010 02:04:37 +0000 (+0000) Subject: Handle socket connection failures properly X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=ec6608ff2940d66d5e994398b2f2b20b882da7ec;p=Bullfrog Handle socket connection failures properly Signed-off-by: Pat Thoyts --- diff --git a/lib/irc/picoirc.tcl b/lib/irc/picoirc.tcl index c6429aa..86c0dad 100644 --- a/lib/irc/picoirc.tcl +++ b/lib/irc/picoirc.tcl @@ -118,6 +118,11 @@ proc ::picoirc::SocksConnect {context} { global tcl_platform upvar #0 $context irc fileevent $irc(socket) writable {} + if {[set err [fconfigure $irc(socket) -error]] ne ""} { + Callback $context close $err + catch {close $irc(socket)} + return + } socks5::init $irc(socket) $irc(server) $irc(port) \ -username $tcl_platform(user) \ -command [list [namespace origin SocksConnected] $context]