michaellukashov / Far-NetBox

SFTP/SCP/FTP/FTPS/WebDAV/S3 client for Far Manager 3 (http://farmanager.com/)
https://forum.farmanager.com/viewtopic.php?t=6317
GNU General Public License v2.0
157 stars 52 forks source link

KeepAlive doesn't work in FAR 3 distributions since 2021 #329

Closed emuzychenko closed 7 months ago

emuzychenko commented 1 year ago

Since 2021, KeepAlive doesn't work in SSH connection in plugin versions supplied in FAR distribution. The log at level Debug 2 contains no KeepAlive records for both methods (null packets and dummy actions).

I found FAR 3.0.5588.1545 (2020) where both methods of KeepAlive works normally, the related records are logged.

rohitab commented 1 year ago

Please see https://github.com/FarGroup/FarManager/issues/713 and my comment https://github.com/FarGroup/FarManager/issues/713#issuecomment-1637023230.

I believe this issue is due to the same reason, i.e. the FE_IDLE event and the DN_ENTERIDLE message were removed in https://github.com/FarGroup/FarManager/commit/7af0fd7b1c7dcdc0625381568c5dee981748c784, and keep-alive messages depend on it. Due to the changes in the commit, the Idle() methods will not be called, and as you can in the code below, these methods are responsible for keeping the connection alive.

https://github.com/michaellukashov/Far-NetBox/blob/518bfc3ef73242d0c4abeb1826bf06894d5147ef/src/core/SftpFileSystem.cpp#L2184-L2205

https://github.com/michaellukashov/Far-NetBox/blob/518bfc3ef73242d0c4abeb1826bf06894d5147ef/src/core/ScpFileSystem.cpp#L441-L470

https://github.com/michaellukashov/Far-NetBox/blob/518bfc3ef73242d0c4abeb1826bf06894d5147ef/src/core/FtpFileSystem.cpp#L898-L914

michaellukashov commented 7 months ago

Fixed in latest builds https://nightly.link/michaellukashov/Far-NetBox/workflows/release/main?preview