Tcl Source Code

Artifact [176a3a11b8]
Login

Artifact 176a3a11b85802b79a5398374de14116c19d181b:

Attachment "http-fix2-for--69687a01db.patch" to ticket [3581754fff] added by kjnash 2012-10-30 10:02:09.
Index: library/http/http.tcl
==================================================================
--- library/http/http.tcl
+++ library/http/http.tcl
@@ -198,18 +198,20 @@
     }
     if {[info exists state(after)]} {
 	after cancel $state(after)
     }
     if {[info exists state(-command)] && !$skipCB} {
-	if {[catch {eval $state(-command) {$token}} err]} {
+	Log "Calling user's -command"
+	set commandScript $state(-command)
+	unset state(-command)
+	if {[catch {eval $commandScript {$token}} err]} {
 	    if {$errormsg eq ""} {
 		set state(error) [list $err $errorInfo $errorCode]
 		set state(status) error
 	    }
 	}
-	# Command callback may already have unset our state
-	unset -nocomplain state(-command)
+	Log "Returned from user's -command"
     }
 }
 
 # http::CloseSocket -
 #