doublecmd/plugins
heredie 174fd293f9 ftp/sftp: survive long idles and reconnect on refresh
SFTP/SCP tabs left open for a long time stopped working and never
reconnected. Root causes:

- TScpSend.Connect overrides Connect and never ran TFTPSendEx.Connect,
  the only place SO_KEEPALIVE was applied, so SSH sockets had no
  keep-alive at all and idle links got dropped (NAT/firewall timeout).
- TScpSend.NetworkError required CanRead(0) AND last_errno<>0, so a
  server-closed idle session (readable socket, errno still 0) was
  reported healthy and never triggered a reconnect.
- On a detected error it only re-logged-in on the dead session object.

Changes:

- Factor keep-alive into TFTPSendEx.ApplyKeepAlive and apply it to both
  the FTP control socket and the SSH socket. On Unix also tune
  TCP_KEEPIDLE/INTVL/CNT (30/10/3) so idle connections are probed within
  ~1 min: keeps NAT mappings open and detects dead peers quickly.
- TScpSend.NetworkError now treats either condition (errno set or
  unexpected readable socket) as a dead link.
- On a dead link FtpConnect discards the stale connection and reconnects
  fresh, reusing the cached password or prompting again when none is
  cached. A plain refresh then reconnects and re-lists the current
  folder. Quick connections (no stored entry) report unable to reconnect.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 19:19:29 -06:00
..
dsx FIX: Everything - stop search 2025-06-25 21:16:52 +03:00
wcx FIX: Zip plugin - allow cancelling TAR archive packing mid-operation (#2874) 2026-05-23 12:12:23 +03:00
wdx UPD: Project files 2024-03-01 23:53:33 +03:00
wfx ftp/sftp: survive long idles and reconnect on refresh 2026-06-19 19:19:29 -06:00
wlx FIX: Explorer preview plugin compilation 2025-04-12 13:57:38 +03:00
build.bat UPD: Line-endings 2023-01-19 21:17:15 +03:00
build.sh ADD: SevenZip - install plugin under Linux (experimental) 2025-10-11 13:39:55 +03:00