sshnet / sshnet/SSH.NET

SFTP DownloadFile hangs indefinitely when attempting to download moderate sized files

Aperta
#733 16 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
4.4k
Fork
993
Merge medio
9g 21h
PR unite (30g)
1

Descrizione

Hello,

I've been using SSH.NET for the past month for SFTP downloads and have been encountering an issue that I do not know how to work around. When calling the SftpClient DownloadFile method while attempting to download a file over about 100 KB the program will hang indefinitely even if the connection is forcibly closed by the remote host. This issue occurs inconsistently as sometimes I am able to download files without problem. After testing I have found this issue occurs with both the latest release available through NuGet and the 2020.0.0-beta1 release.

The code I am using to download files is listed below

foreach (string file in fileList)
{
    string filenameNoPath = file.Substring(file.LastIndexOf('/') + 1);
    string destination = outputPath + "\\" + filenameNoPath;
    using (Stream fileStream = File.OpenWrite(destination))
    {
        client.DownloadFile(file, fileStream);
        fileStream.Close();
    }
}

The platform I am using to test is Core SFTP Server (x64) installed on a Windows 10 Home machine. The connection between the testing platform and the client is my home LAN.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con SftpClient.DownloadFile e riproduci il blocco usando il ciclo dell’issue, un file di oltre circa 100 KB e Core SFTP Server (x64) su Windows 10. Verifica il comportamento quando l’host remoto chiude la connessione e confrontalo con download più piccoli o intermittenti completati correttamente. Il lavoro è considerato completato quando il download segnalato non rimane più bloccato indefinitamente in queste condizioni.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
networking
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.