Tcl Library Source Code

View Ticket
Login
Ticket UUID: 783878
Title: FTP library responding WAY to slow on ftp connect timeout.
Type: Bug Version: None
Submitter: atlems Created on: 2003-08-06 02:35:02
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:
I am currently programming a tcl script for an 
eggdrop(www.egghelp.org) which shall tell me if a list of 
ftp's are up and running or not. For making the coding a 
lot more easy for me I am using the FTP library package 
and I am running TCL 8.4.4 (did also try with 8.3.4). It is 
a really great library and all seems to work ok, but a 
rather large problem occurs when I am trying to connect 
to a server which ends up with a timeout. It takes just 
way to long time for the tcl library to give me the right 
response: "-1".

When I connect to this server in FlashFXP in Windows it 
says;
Connecting to 123.456.789.123
Connection failed (Connection timed out)
 
This is what I type & get in tcl cmd line;
% ftp::Open 123.456.789.123 username password 
-timeout 2 -port 12345 -mode passive
-1
 
As you can see, this works in theory, but it takes several 
minutes before I get the "-1" response, even though I've 
set the "timeout" setting.
 
Those minutes causes my eggdrop to totally "crash" for 
some minutes and usually disconnects from the IRC 
server because of this... In short; I need it to tell me 
MUCH faster if the ftp is responding or not...
 
If this is not a bug in the tcl library, how can/shall I solve 
my problem? If it is a bug, would it be possible for any of 
you guys to give me a 
fix? A fix is appreciated!
 
Thanks!
User Comments: andreas_kupries added on 2003-10-22 04:33:05:
Logged In: YES 
user_id=75003

This can be a bug. The code we inherited is so convoluted 
that it is difficult to say. 

I was thinking that this could also be a DNS resolution 
problem as the DNS resolver will also wait quite long for a 
responses, uninteruptible, however I see that you are using 
an explicit IP address.

You can activate more verbose logging, maybe this will give 
us some hints. From the docs:

The output of the package is controlled by two state 
variables, ::ftp::VERBOSE and ::ftp::DEBUG. 
Setting ::ftp::VERBOSE to "1" forces the package to show all 
responses from a remote server. The default value is "0". 
Setting ::ftp::DEBUG to "1" enables debugging and forces the 
package to show all return codes, states, state changes 
and "real" ftp commands. The default value is "0".