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.
|