瀏覽代碼

scp: notify for uploading finished when uploaded an empty file (#1658)

* scp: add flag to notify for uploading finished when uploaded an empty file

* remove notifyOnEmptyFile Flag
thegame4craft 4 月之前
父節點
當前提交
6bb397872b
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/Renci.SshNet/ScpClient.cs

+ 5 - 0
src/Renci.SshNet/ScpClient.cs

@@ -579,6 +579,11 @@ namespace Renci.SshNet
                 read = source.Read(buffer, 0, buffer.Length);
             }
 
+            if (totalLength == 0 && totalRead == 0)
+            {
+                RaiseUploadingEvent(remoteFileName, totalLength, totalRead);
+            }
+
             SendSuccessConfirmation(channel);
             CheckReturnCode(input);
         }