From: <kak...@us...> - 2008-04-28 07:08:33
|
Revision: 9773 http://amsn.svn.sourceforge.net/amsn/?rev=9773&view=rev Author: kakaroto Date: 2008-04-28 00:07:38 -0700 (Mon, 28 Apr 2008) Log Message: ----------- Should probably fix the bug id #2 and this : http://www.amsn-project.net/forums/viewtopic.php?t=5071&highlight= hopefully... once and for all.... Modified Paths: -------------- trunk/amsn/protocol.tcl trunk/amsn/proxy.tcl Modified: trunk/amsn/protocol.tcl =================================================================== --- trunk/amsn/protocol.tcl 2008-04-28 07:03:27 UTC (rev 9772) +++ trunk/amsn/protocol.tcl 2008-04-28 07:07:38 UTC (rev 9773) @@ -1687,6 +1687,7 @@ if { [string match -nocase "*ns*" $sb] } { status_log "clearing sb $sb. oldstat=$oldstat" + catch {[$sb cget -proxy] finish $sb} catch {close [$sb cget -sock]} $sb configure -sock "" @@ -4495,6 +4496,7 @@ $sb configure -time [clock seconds] + catch {[$sb cget -proxy] finish $sb} $sb configure -sock "" #$sb configure -data [list] $sb configure -users [list] Modified: trunk/amsn/proxy.tcl =================================================================== --- trunk/amsn/proxy.tcl 2008-04-28 07:03:27 UTC (rev 9772) +++ trunk/amsn/proxy.tcl 2008-04-28 07:07:38 UTC (rev 9773) @@ -478,6 +478,7 @@ option -proxy_gateway_ip option -proxy_writing variable poll_afterids + variable created_sockets [list] constructor {args } { array set poll_afterids [list] @@ -488,6 +489,9 @@ foreach name [array names poll_afterids] { after cancel [set poll_afterids($name)] } + foreach sock $created_sockets { + catch {close $sock} + } } method write { name {msg ""} } { @@ -745,6 +749,7 @@ fileevent $sock readable "" fileevent $sock writable "" } + set created_sockets [lreplace $created_sockets [lsearch $created_sockets $sock] [lsearch $created_sockets $sock]] if {[catch {close $sock}]} { return -1 @@ -786,6 +791,7 @@ $sb configure -error_msg $res return -1 } + lappend created_sockets $sock $sb configure -sock $sock fconfigure $sock -buffering none -translation {binary binary} -blocking 0 @@ -892,6 +898,7 @@ set sock [$name cget -sock] if {[catch {eof $sock} res]} { status_log "::HTTPConnection::HTTPRead: Error, closing\n" red + catch { close $sock } $name sockError } elseif {[eof $sock]} { fileevent $sock readable "" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |