Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

SFTP downloads hang in 2025.1.0+ but work in 2025.0.0

未關閉
#1,843 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
csharp
領域
networking

研究方向

Diff the changes between the 2025.0.0 and 2025.1.0 tags to find what changed in the SFTP read path. Start with SftpFileStream (the OpenAsync/CopyToAsync path) and SftpClient.DownloadFileAsync under src/, focusing on async read loops and channel/window handling. Reproduce against a local SFTP server or the project's integration tests, and done means both download paths complete without hanging on the current version.

由索引模型根據 Issue 內容生成。

描述

Summary

An SFTP download that completes successfully with SSH.NET 2025.0.0 hangs after upgrading to 2025.1.0 or 2026.0.0.

Versions tested

  • Works: SSH.NET 2025.0.0
  • Hangs: SSH.NET 2025.1.0
  • Hangs: SSH.NET 2026.0.0

Environment

  • .NET version: [insert]
  • OS: [insert]
  • SFTP server product and version: [insert]

Reproduction

The original implementation opens the remote file as an SftpFileStream and copies it to a local destination stream:

await using var fileStream = File.Create("file path");
await using var sftpFileStream = await client.OpenAsync(
    "file name",
    FileMode.Open,
    FileAccess.Read,
    CancellationToken.None);

await sftpFileStream.CopyToAsync(fileStream);

This completes with SSH.NET 2025.0.0. With 2025.1.0 and 2026.0.0, the operation does not complete.

I also tested the dedicated download API:

await using var fileStream = File.Create("file path");
await client.DownloadFileAsync(
    "file name",
    fileStream,
    CancellationToken.None);

It hangs as well in 2025.1.0 and 2026.0.0.

Expected behavior

The file download should complete, as it does with SSH.NET 2025.0.0.

Actual behavior

The download hangs indefinitely with 2025.1.0 and 2026.0.0, without completing or throwing an exception.

主要語言
C#
星號
4.4k
分支
990
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

sshnet/SSH.NET 的其他 Issue

查看 sshnet/SSH.NET 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。