doublecmd/plugins/wfx
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
..
ftp ftp/sftp: survive long idles and reconnect on refresh 2026-06-19 19:19:29 -06:00
MacCloud ADD: Korean language file (#2754) 2026-02-16 22:51:17 +03:00
samba UPD: Plugins output directory 2020-11-04 14:12:31 +00:00
sample UPD: Sample plugin 2025-11-11 18:17:02 +03:00