Tk Library Source Code

View Ticket
Login
Ticket UUID: 503471
Title: ftp GET to non-existent directory
Type: Bug Version: None
Submitter: nobody Created on: 2002-01-14 19:51:40
Subsystem: ftp Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2002-01-17 02:01:35
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2002-01-16 19:01:35
Description:
Hello,

i started to use ftp package and i have problems with
this situation:

set fd [ftp::Open host user passwd]
ftp:Get $fd file /non-existent-directory

After timeout it hangs for a long period of time and
exists with a lot of messsages:

    Error in bgerror: invalid command name "bgerror"
bgerror failed to handle background error.
    Original error: can't wait for variable
"::ftp::ftp2(state.data)":  would wait forever
    Error in bgerror: invalid command name "bgerror"
bgerror failed to handle background error.
    Original error: can't wait for variable
"::ftp::ftp2(state.data)":  would wait forever
    Error in bgerror: invalid command name "bgerror"
User Comments: andreas_kupries added on 2002-01-17 02:01:35:
Logged In: YES 
user_id=75003

Committed to head.

andreas_kupries added on 2002-01-15 12:45:52:

File Added - 16080: 503471.diff

Logged In: YES 
user_id=75003

Enclosed a patch which should solve the problem.

nobody added on 2002-01-15 11:32:08:
Logged In: NO 

But why does it go into infinite loop by calling itself so
many times, if it couldn't create that file, open command
failed and the system could throw exception.
I suspect something with state machine also, because i use
this package inside AOLServer, and with infinite loop it
crashes the whole server which is not reliable solution i am
building. Would be greate if ftp package would control stack
level or loop count.
Thank you

andreas_kupries added on 2002-01-15 06:59:07:
Logged In: YES 
user_id=75003

Ah. It seems that the ftp package does not generate
the directory for ta target file and then gets
confused if that directory does not exist. I classify
that as a true bug. Not enough argument checking on
the target file. Some other operations could have the
same problem.

IMHO the correct solution is to have the package 
check "FILEnameInWrongDirectory" and immediately
throw an error if the drectory does not exist. I
believe that this is safer than simply creating
the directory.

nobody added on 2002-01-15 05:05:21:
Logged In: NO 

sorry for confused message, i am trying to get file and save
it into different directory. It happend that that direcoty
didn't exists at that time.

ftp::Get $fd FILEtoGET FILEnameInWrongDirectory

andreas_kupries added on 2002-01-15 05:01:22:
Logged In: YES 
user_id=75003

Have tried the same for an existing directory ?
I do not believe that you can GET a directory at
all. Only LIST its contents.

Attachments: