Tcl Library Source Code

View Ticket
Login
Ticket UUID: 862638
Title: can't read "ftp(Wait)": no such variable - background error
Type: Bug Version: None
Submitter: nobody Created on: 2003-12-19 01:39:06
Subsystem: ftp Assigned To: gwlester
Priority: 5 Medium Severity:
Status: Open Last Modified: 2004-03-04 05:23:30
Resolution: None Closed By:
    Closed on:
Description:
When an FTP session is close, all the variables has been 
unset. However, the ::ftp::Timeout{} event is still be 
triggered. This event will read the ftp(Wait) variable 
that doesn't exist because it has already been unset 
during ftp close session. Therefore, this background 
error occur.  To fix this or to work around, we need 
check whether if the ftp(Wait) variable is exist 
in ::ftp::Timeout{} procedure, then we only procceed 
on the event. 

proc ::ftp::Timeout {s} {
    upvar ::ftp::ftp$s ftp
    if {[info exist ftp(Wait)]} {
        after cancel $ftp(Wait)
        set ftp(state.control) 1

        DisplayMsg "" "Timeout of control connection after 
$ftp(Timeout) sec.!" error
        Command $ftp(Command) timeout
    }
    return
}

This only happen when we use ftp in asynchronous 
mode.

My Email:
[email protected]