mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
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> |
||
|---|---|---|
| .. | ||
| dsx | ||
| wcx | ||
| wdx | ||
| wfx | ||
| wlx | ||
| build.bat | ||
| build.sh | ||