From: <kak...@us...> - 2009-12-17 06:29:02
|
Revision: 11855 http://amsn.svn.sourceforge.net/amsn/?rev=11855&view=rev Author: kakaroto Date: 2009-12-17 06:28:54 +0000 (Thu, 17 Dec 2009) Log Message: ----------- haha, found the problem with the http changes.. the ::http::wait command doesn't wait until $token(status) *changes*, it waits until it *gets defined*.. so when I got connected, and I set it to 'connect' (just as an FYI), it stopped my wait, and the second wait I added would return directly instead of waiting for the actual 'ok/error'... this is also why we had those Event errors.. you would get the http::geturl return as soon as it connects (before sending/receiving data), so we get status 'connect', oh it's unknown, so we ::http::cleanup the token, but that didn't close the socket, simply because it was expected that cleanup would be called AFTER the error/success of the http, and that would have already closed the socket for us.. Modified Paths: -------------- trunk/amsn/utils/http/http.tcl Modified: trunk/amsn/utils/http/http.tcl =================================================================== --- trunk/amsn/utils/http/http.tcl 2009-12-16 21:58:50 UTC (rev 11854) +++ trunk/amsn/utils/http/http.tcl 2009-12-17 06:28:54 UTC (rev 11855) @@ -363,15 +363,7 @@ # Something went wrong, so throw the exception, and the # enclosing catch will do cleanup. return -code error [lindex $state(error) 0] - } elseif {[string equal $state(status) "connect"] } { - # We just got connected, wait for the actual response... - wait $token - if {[string equal $state(status) "error"]} { - # Something went wrong, so throw the exception, and the - # enclosing catch will do cleanup. - return -code error [lindex $state(error) 0] - } - } + } } return $token } @@ -599,9 +591,8 @@ global errorInfo errorCode if {[eof $state(sock)] || [string length [fconfigure $state(sock) -error]]} { - Finish $token "connect failed [fconfigure $state(sock) -error]" + Finish $token "connect failed [fconfigure $state(sock) -error]" } else { - set state(status) connect fileevent $state(sock) writable {} ::http::connected $token } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |