Bug when -timeout specified and triggered
Closed / Duplicate1449233fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 19 years ago
Descriptionplain2006-03-13 23:42:46
Assume set token [http::geturl -timeout XXXX badurl] The timeout will trigger, because of the badurl. The "http::geturl" creates a timer to handle the -timeout, with the id stored in state(after). See line 447 of http.tcl. Later on it does a [http::wait] on the token to wait for the connection. See line 479ff. When the timer triggers it calls [http::reset]. See line 447. This deletes the token, i.e. the state array. See line 196ff. The [http::wait] the geturl is in (line 479) then breaks out of the [vwait]-eventloop it is in and returns $state(status), see line 956. Except that the state is already gone due to the aforementioned [reset], therefore boom. Note also, even if the [http::wait] would not throw an error then [http::geturl] itself would, because immediately after the [http::wait] it also tries to access the state array by itself, to determine what went wrong (line 479ff). A possible solution is to use [info exists] to check if the state is gone, and react accordingly (http::wait returns nothing, http::geturl then knows that a timeout happened).
dgpplain2006-03-14 10:31:37
Logged In: YES user_id=80530 see also 513385 and 705956
patthoytsplain2008-02-22 18:23:03
Logged In: YES user_id=202636 Originator: NO Same as 1818565
Log in (anonymous is fine) to add a comment.