SFTP: stop waiting for ever on a host whose login prints text, and draw the file panes' icons whole #25

Merged
job merged 1 commits from claude/sftp-connection-icons-5ad752 into main 2026-10-19 09:15:25 +00:00
Owner

SFTP connect hang (desktop)

The connect could sit on "Connecting…" for ever. SSH.NET 2026.0.0 runs the SFTP handshake synchronously inside ConnectAsync. It waits with no time limit and ignores cancellation while it does. When a host's login script prints anything (an echo in .bashrc), that text lands where the first SFTP packet should be. SSH.NET reads it as a ~1 GB packet length and waits for the rest. OpenSSH's own sftp fails on the same host with "Received message too long".

  • During the handshake, SftpClient.OperationTimeout is set to the connect timeout (15 s by default). Once connected it goes back to infinite, so slow transfers behave as before.
  • A timeout after a successful login becomes a TimeoutException. Its message says the host's SFTP service didn't answer and names a login script that prints text as the usual cause.

Test: the SSH test server gets a second port (Match LocalPort 2223 with a ForceCommand that prints a banner before starting sftp-server). A second account isn't possible because the image's sshd runs unprivileged. The new SftpSessionTests case fails within a 3 s connect timeout with the new message. Without the fix it runs into its 30 s guard.

SFTP pane icons (desktop)

  • Clipped: Button.paneicon is a fixed 26×26 but kept Fluent's default 8,5,8,6 padding. That left a 10 px-wide space for 15–16 px Material icons, so they were drawn with their sides cut off. Padding is now 0. The same style is used on a few Settings pages, which get the fix too.
  • Rename used U+E9AD, an italic T (a text-formatting icon). It now uses U+E9A2, the rename glyph the phone already uses.
  • Up one directory on the host pane drew the design's arrow_downward. Both panes now use arrow_upward.

The changes were checked by rendering the screen headlessly to PNG before and after the fix.

Tests

  • SSH: 123/123
  • Layout: 203/203
  • App: 744/749, with the 5 usual Linux TPM skips
## SFTP connect hang (desktop) The connect could sit on "Connecting…" for ever. SSH.NET 2026.0.0 runs the SFTP handshake synchronously inside `ConnectAsync`. It waits with no time limit and ignores cancellation while it does. When a host's login script prints anything (an `echo` in `.bashrc`), that text lands where the first SFTP packet should be. SSH.NET reads it as a ~1 GB packet length and waits for the rest. OpenSSH's own `sftp` fails on the same host with "Received message too long". - During the handshake, `SftpClient.OperationTimeout` is set to the connect timeout (15 s by default). Once connected it goes back to infinite, so slow transfers behave as before. - A timeout after a successful login becomes a `TimeoutException`. Its message says the host's SFTP service didn't answer and names a login script that prints text as the usual cause. **Test:** the SSH test server gets a second port (`Match LocalPort 2223` with a `ForceCommand` that prints a banner before starting `sftp-server`). A second account isn't possible because the image's sshd runs unprivileged. The new `SftpSessionTests` case fails within a 3 s connect timeout with the new message. Without the fix it runs into its 30 s guard. ## SFTP pane icons (desktop) - **Clipped:** `Button.paneicon` is a fixed 26×26 but kept Fluent's default `8,5,8,6` padding. That left a 10 px-wide space for 15–16 px Material icons, so they were drawn with their sides cut off. Padding is now 0. The same style is used on a few Settings pages, which get the fix too. - **Rename** used U+E9AD, an italic T (a text-formatting icon). It now uses U+E9A2, the rename glyph the phone already uses. - **Up one directory** on the host pane drew the design's `arrow_downward`. Both panes now use `arrow_upward`. The changes were checked by rendering the screen headlessly to PNG before and after the fix. ## Tests - SSH: 123/123 - Layout: 203/203 - App: 744/749, with the 5 usual Linux TPM skips
jaap-jan added 1 commit 2026-10-16 13:12:22 +00:00
SFTP: stop waiting for ever on a host whose login prints text, and draw the file panes' icons whole
ci / build and test (pull_request) Successful in 2m40s
ci / desktop nightly (pull_request) Skipped
ci / api image (pull_request) Successful in 7s
ci / deploy ssh.dodotech.cloud (pull_request) Skipped
ci / android head (pull_request) Successful in 3m43s
d71f057bde
SSH.NET 2026.0.0 runs the SFTP handshake synchronously inside ConnectAsync, with an infinite
operation timeout and without reading the cancellation token. A host whose login script prints
anything (an echo in .bashrc) puts text where the first SFTP packet belongs; SSH.NET reads its first
four bytes as a length of about a gigabyte and waits for the rest, so the file browser said
"Connecting…" for ever. The SFTP client now uses the connect timeout as its operation timeout for
the handshake and resets it to infinite once connected, so transfers on slow links are unchanged. A
timeout after authentication becomes a TimeoutException naming the likely cause.

The SSH test server gains a second port whose sessions print a banner before sftp-server, and
SftpSessionTests proves the open fails within a 3 s connect timeout with that message. Without the
fix the test runs into its 30 s guard.

Button.paneicon is a fixed 26x26 but kept Fluent's 8,5,8,6 padding, which left a 10px-wide content
box, so every 15-16px Material icon on the SFTP panes was drawn with its sides cut off. Its padding
is now 0. Rename on the host pane used U+E9AD, an italic T (text formatting); it now uses U+E9A2,
the rename glyph the phone's files screen already uses. The host pane's "Up one directory" drew the
design's arrow_downward; both panes now use arrow_upward.

SSH tests 123/123, layout tests 203/203, app tests 744/749 with the 5 Linux TPM skips.
job merged commit f7354aa7e8 into main 2026-10-19 09:15:25 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DodoTech-Public/DodoSSH#25