Tk Library Source Code

View Ticket
Login
Ticket UUID: 1709566
Title: crash during ftp::Get
Type: Bug Version: None
Submitter: hofkensg Created on: 2007-04-29 12:13:45
Subsystem: ftp Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2013-07-04 17:25:11
Resolution: Not Applicable Here Closed By:
    Closed on:
Description:
I sometimes see the following crash during a ftp::Get :

can't read "ftp(Start_Time)": no such element in array
    while executing
"expr {$stop_time - $ftp(Start_Time)}"
    (procedure "ElapsedTime" line 5)
    invoked from within
"ElapsedTime $s [clock seconds]"
    (procedure "ftp::Get" line 87)


I think this happens because the proc ftp::WaitOrTimeout (used at the endof ftp::Get) returns 1 on timeout i.s.o. 0. And so ftp::Get tries to calculate the elapsed time in ftp::ElapsedTime, while ftp(Start_Time) is not yet existing, resulting in a crash.
I have looked at all usage of ftp::WaitOrTimeout, and the return code should be 1 on success, 0 on error. Therefore I suggest to change ftp::Timeout to put ftp(state.control) to 0.
User Comments: hofkensg added on 2007-04-29 19:13:45:

File Added - 227090: ftp.tcl.patch

Attachments: