sshnet / sshnet/SSH.NET

DownloadCallback action registered in SFtpClient.DownloadFile can get called after FtpClient is disposed

Open
#207 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

Currently the callback action is queued on a thread pool thread. This is a problem because you may want to wait for all callback progress actions to complete prior to continuing ... but there is no way of doing that.

I found this in my trace listener that is recording download progress. I won't actually get all events.

These callbacks should either be synchronous, or the download method should complete only once all progress events are done / joined.

The issue is probably also in SFtpClient.Uploadfile

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at SFtpClient.DownloadFile and inspect how progress callbacks are queued on the thread pool, then compare the corresponding path in SFtpClient.Uploadfile. Reproduce the trace-listener scenario and verify that the download operation does not return until all progress callbacks have completed, with equivalent behavior checked for uploads.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.