FTP: connection not closed on user abort on host ip no found

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
za222
Member
Member
Posts: 146
Joined: 2003-03-11, 17:19 UTC
Location: Germany

FTP: connection not closed on user abort on host ip no found

Post by *za222 »

There is a bug i've noticed in the behaviour of the "abort" button on the ftp connect dialog:

To reproduce:

1) CTRL-N, enter and ip that doesnt exist, i.e. 123.123.123.123
2) press ok
3) press abort before TC tells you the host doesnt exist.
4) CTRL-N again, enter a host that exists, i.e. ftp.debian.org
5) press OK

Now, if this all happens quickly (i.e. you typed something wrong, press cancel, quickly fix it, connect again) TC hasn't closed the first attempt yet.

Then the 2nd attempt fails, too, with the message "Host not found". But the 2nd host obviously exists.

You can also see that the previous attempt is still open, as on the 2nd try, there is

[face=courier]1:-----------
1:Connect to: ...
1:...[/face]

in the connection window.

The abort button has to kill the existing connection more thoroughly.

This bug also occurs in previous versions.


Edit:

another way to see the bug is:
instead of 4) and 5)
simply press CTRL-R (reload) once.
Then FTP-0 appears on the drive list.
Press CTRL-R again, and its gone again (the ftp connection isnt closed up until this moment)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is a known problem of the Microsoft TCP/IP stack: When you close a connection via CloseSocket, the connection remains in a so-called "linger" state until the server confirms the close, or a timeout occurs. This is a so-called graceful disconnect. It seems that new connections can fail while a socket is in that state. Sorry, I have no idea what can be done. All that helps is closing and restarting TC...
Author of Total Commander
https://www.ghisler.com
User avatar
za222
Member
Member
Posts: 146
Joined: 2003-03-11, 17:19 UTC
Location: Germany

Post by *za222 »

Ah, interesting, didn't know it was CloseSocket(), which is causing it.

Maybe there is a way:
http://msdn.microsoft.com/en-us/library/aa917514.aspx

The SO_DONOTLINGER option or the SO_LINGER option in combination with an inverval of zero dont seem to wait for close.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I have experimented with all of them, but always had some problems...
Author of Total Commander
https://www.ghisler.com
Post Reply