[TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

[TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *white »

  • I blocked TC in the Windows Firewall.
  • I connect to a public ftp server, not using passive mode.
  • A small window is displayed containing the LIST command.
  • I choose Cancel (Esc or C or Enter or Space or click Cancel or click cross) and choose OK.
  • Fallback to passive mode happens, the command PASV is now displayed in the small window.
  • When I press Esc nothing happens, but pressing C or Enter or Space or clicking Cancel or X does work.
    Also, when I use one of the working methods and then abort the aborting, then pressing Esc does work.
The behavior is the same for 32-bit and 64-bit TC.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *ghisler(Author) »

This happens when no button is defined as the default "Cancel" method - then ESC will be ignored. I will check what no button is defined as default "Cancel" button in this case.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *white »

ghisler(Author) wrote: 2023-09-03, 07:29 UTC This happens when no button is defined as the default "Cancel" method - then ESC will be ignored. I will check what no button is defined as default "Cancel" button in this case.
Hmmm, note that when choosing another method to cancel and then cancel the cancellation, then pressing Esc does work. So then a button is set as the default Cancel button?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *ghisler(Author) »

Yes, it has do be defined to work.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *ghisler(Author) »

I have tried to reproduce this, but ESC always works here in the FTP directory reading progress dialog (e.g. when you press Ctrl+R).
Removing TC from the firewall rules made TC switch automatically from PORT to PASV mode.
Blocking TC completely didn't even allow the initial connection (connection dialog with multiple lines), so I don't see how you got that result.

Please provide more information how you got this result.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *white »

I click on the shield icon in system tray, Firewall and Network security, Advanced settings.
Under Rules for incoming connections, I lookup the rules for Total Commander (screenshot).
I then remove, disable or change the rules to block for both TCP and UDP.
Then I try to connect to the FTP server.
When I don't press Esc, both LIST and PASV fail and an empty list is displayed.
If I press Esc to cancel the LIST command, I cannot cancel the PASV command by using the Esc key. If I do not cancel the PASV command by other means, I get a "Connection lost, reconnect" dialog. If I chooses Yes the reconnection and passive mode succeeds and the remote file list is displayed.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *ghisler(Author) »

I cannot reproduce that. Only LIST needs incoming connections, PASV doesn't. It uses outgoing connections to the server.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *white »

ghisler(Author) wrote: 2023-09-10, 10:49 UTC I cannot reproduce that. Only LIST needs incoming connections, PASV doesn't. It uses outgoing connections to the server.
When PASV is sent, passive mode isn't active yet, is it?

Try this server: ftp.nluug.nl (anonymous)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *ghisler(Author) »

I get this result:
PORT 192,168,0,28,156,64
500 Illegal PORT command.
PASV
227 Entering Passive Mode (145,220,21,40,198,91).
Connected to PASV port
LIST -la
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *white »

Did you create a new connection with setting to not use passive mode?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *ghisler(Author) »

No, I changed an existing connection not to use passive mode. As you can see in the log TC sends
PORT
first, but since the server reports that PORT mode isn't possible to that (local) address, it switches to PASV.
What does your log look like?
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *white »

ghisler(Author) wrote: 2023-09-11, 10:05 UTC As you can see in the log TC sends PORT first, but since the server reports that PORT mode isn't possible to that (local) address, it switches to PASV.
What does your log look like?
In my logs, the port command is successful.

If I allow LIST and PASV to time out, the end result is an empty file list.
Log:

Code: Select all

PORT 192,168,2,1,221,214
200 PORT command successful. Consider using PASV.
LIST
PORT failed, try PASV mode!
PASV
If I abort the LIST command, I cannot use the Esc key to abort the PASV command.
If I don't abort PASV by other means and let it time out, a "Connection lost, reconnect?" message appears.
Log:

Code: Select all

PORT 192,168,2,1,221,220
200 PORT command successful. Consider using PASV.
LIST
Cancel pressed!
PASV
OFFLINE4, no reply
If I abort both LIST and PASV, the end result is an empty file list.
Log:

Code: Select all

PORT 192,168,2,1,221,212
200 PORT command successful. Consider using PASV.
LIST
Cancel pressed!
PASV
Cancel pressed!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *ghisler(Author) »

The reason is that the server itself hangs in the PASV command and doesn't respond to abort characters because the PORT command succeeded (some servers don't cancel the PORT connection when receiving a PASV command). Currently the only way to fix it is to manually switch to passive mode. I'm sorry but since the problem is on the server side, there is no solution.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *white »

ghisler(Author) wrote: 2023-09-12, 08:55 UTC The reason is that the server itself hangs in the PASV command and doesn't respond to abort characters because the PORT command succeeded
As reported, it does respond to abort characters but not to Esc. That is, until you use other abort characters and abort the aborting. Then you end up in the same dialog and Esc does work.
ghisler(Author) wrote: 2023-09-12, 08:55 UTC I'm sorry but since the problem is on the server side, there is no solution.
Obviously there is.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client: Esc doesn't work to abort during fallback to passive mode

Post by *ghisler(Author) »

I found something by trying with various servers: ESC doesn't work when you have to press it TWICE, e.g. when the server hangs first in the LIST command and then also in the PASV command. Then TC is already in "aborted" mode and ignores further ESC presses. I will change that.
Author of Total Commander
https://www.ghisler.com
Post Reply