Index: client/1.0/neutral/common.tcl ================================================================== --- client/1.0/neutral/common.tcl +++ client/1.0/neutral/common.tcl @@ -191,10 +191,51 @@ [pid] " : " [clock seconds] " : http : " $string] } } } + # + # NOTE: This procedure was stolen from the "common.tcl" script. It is + # designed to setup the pending progress indicator callback and + # save its working state. + # + proc setupPageProgress { channel type milliseconds } { + # + # NOTE: This variable is used to keep track of the currently scheduled + # (i.e. pending) [after] event. + # + variable afterForPageProgress + + # + # NOTE: Scheduled the necessary [after] event, using the [pageProgress] + # procedure, which is defined further down in this file. + # + set afterForPageProgress [after $milliseconds [namespace code \ + [list pageProgress $channel $type $milliseconds]]] + } + + # + # NOTE: This procedure was stolen from the "common.tcl" script. It is + # designed to cancel the pending progress indicator callback and + # cleanup its working state. + # + proc cancelPageProgress {} { + # + # NOTE: This variable is used to keep track of the currently scheduled + # (i.e. pending) [after] event. + # + variable afterForPageProgress + + # + # NOTE: If there is a currently scheduled [after] event, cancel it. + # + if {[info exists afterForPageProgress]} then { + catch {after cancel $afterForPageProgress} + unset -nocomplain afterForPageProgress + } + } + # # NOTE: This procedure was stolen from the "common.tcl" script. It is # designed to emit a progress indicator while an HTTP request is # being processed. The channel argument is the Tcl channel where # the progress indicator should be emitted. The type argument is @@ -202,30 +243,24 @@ # argument is the number of milliseconds to wait until the next # periodic progress indicator should be emitted. This procedure # reschedules its own execution. # proc pageProgress { channel type milliseconds } { - # - # NOTE: This variable is used to keep track of the currently scheduled - # (i.e. pending) [after] event. - # - variable afterForPageProgress - # # NOTE: Show that something is happening... # pageOut $channel $type # - # NOTE: Make sure that we are scheduled to run again, if requested. - # - if {$milliseconds > 0} then { - set afterForPageProgress [after $milliseconds \ - [namespace code [list pageProgress $channel $type \ - $milliseconds]]] - } else { - unset -nocomplain afterForPageProgress + # NOTE: Make sure that we are scheduled to run again, if requested; + # also, before doing that, make sure there is not already an + # associated [after] event pending. + # + cancelPageProgress + + if {$milliseconds > 0} then { + setupPageProgress $channel $type $milliseconds } } # # NOTE: This procedure was stolen from the "common.tcl" script. It is @@ -270,16 +305,10 @@ # an HTTP redirect response contains an HTTP URI and the original # URI was HTTPS. # variable allowInsecureRedirect - # - # NOTE: This variable is used to keep track of the currently scheduled - # (i.e. pending) [after] event. - # - variable afterForPageProgress - # # NOTE: This variable is used to determine the timeout milliseconds for # HTTP requests. # variable timeoutGetUrl @@ -562,14 +591,11 @@ } # # NOTE: If there is a currently scheduled [after] event, cancel it. # - if {[info exists afterForPageProgress]} then { - catch {after cancel $afterForPageProgress} - unset -nocomplain afterForPageProgress - } + cancelPageProgress # # NOTE: If progress messages were emitted, start a fresh line. # if {!$quiet} then { Index: client/1.0/neutral/common.tcl.asc ================================================================== --- client/1.0/neutral/common.tcl.asc +++ client/1.0/neutral/common.tcl.asc @@ -1,18 +1,18 @@ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository -iQIcBAABCAAGBQJgb7gpAAoJEFAslq9JXcLZyhAP/1P+iaqtoOHt+t0FIElTfWqD -NuZzWXa/pjwUSnwYATrYk2e9mmz9WVtpf8QTFO6aHyCyMrxY0Ufb6VRZosRwXZsb -dFO2K0gFRvM4gH3ZfIbPgrvDl2MycFOnAqHSQ+ELQ0iDKWKo9PV/iPls42HyWuPH -fKD3QHcm9V+4o5s+BRCTmLoFQIFG06YTszJ6wva9oo9GAZOkNJbCup/cVPZhLIPt -S5o3c1TEi+b2exYlaklmpqn+EvJguXW2wri2To/Wd9f9pWpmfBkzzVSCmWfgq/8u -LmCcsmU5qBl1iMpC+KNFgS8a4GHb7B7KPe7iJlUzNzMe7KFgXUqnquYqB3iWUO/7 -QXBV/CEJIK6GgHcIBfFxSU2idduETGd6e3D7+/shqj2Bhds/XKL6lQza1xLPqraO -Lze6yrAk+mE+WPLrvqKvLJMQ0NiAg5qN2QLopTXjGn9OUommKB9LxrGu724LU5EO -0Koq0QEQwg75Z3XC4FGcIl6iRIUBDEMch6Lj6sF53KGHV1QiwQHK7ziOkKcaRb2N -GUNdgQ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