Skip to content

fix: accept concurrent SFTP session channels#321

Open
metabrixkt wants to merge 1 commit into
pterodactyl:developfrom
metabrixkt:fix/sftp-session-multiplexing
Open

fix: accept concurrent SFTP session channels#321
metabrixkt wants to merge 1 commit into
pterodactyl:developfrom
metabrixkt:fix/sftp-session-multiplexing

Conversation

@metabrixkt
Copy link
Copy Markdown

What was wrong?

Previously, Wings handled each accepted SFTP session channel synchronously inside the SSH channel loop. This blocked the server from accepting additional session channels on the same SSH connection until the active SFTP session ended (which may not happen until the client disconnects).

What's the impact?

Some clients, such as GVFS, open multiple SFTP session channels over a single SSH connection during mount setup. With the accept loop blocked, GVFS would wait for the additional channel to be accepted before timing out and falling back.

The change

This change handles each accepted session channel in its own goroutine, allowing SSH session channel multiplexing to work as expected.

In local testing, this reduced GVFS mount setup time from about 40 seconds to under a second 👀

Previously, Wings handled each accepted SFTP session channel synchronously inside the SSH channel loop. This blocked the server from accepting additional session channels on the same SSH connection until the active SFTP session ended (which may not happen until the client disconnects).

Some clients, such as GVFS, open multiple SFTP session channels over a single SSH connection during mount setup. With the accept loop blocked, GVFS would wait for the additional channel to be accepted before timing out and falling back.

Now, each accepted session channel is handled in its own goroutine, so SSH session channel multiplexing works as expected.

After the SSH channel stream closes, `AcceptInbound` waits for active session handlers before returning.
@metabrixkt metabrixkt force-pushed the fix/sftp-session-multiplexing branch from 0fb7746 to c1c4e01 Compare May 29, 2026 19:33
@metabrixkt
Copy link
Copy Markdown
Author

Rebased following the release of v1.12.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant