Bläddra i källkod

Remove linefeed from WriteLine method in Shellstream class (issue #1584).
Guard against NRE in Channel_DataReceived.

Gert Driesen 11 år sedan
förälder
incheckning
069b373343

+ 2 - 0
Renci.SshClient/Build/nuget/SSH.NET.nuspec

@@ -30,6 +30,8 @@
 
           Fixes:
 
+          * Remove linefeed from WriteLine method in Shellstream class (issue #1584)
+          * Disable logging of messages in release builds (issue #1767)
           * Stuck loop on key exchange using arcfour encryption (issue #1922)
           * Timeout sending data to server with low window size (issue #1706)
           * No connection possible with the same auth method requested multiple times (issue #1930)

+ 3 - 4
Renci.SshClient/Renci.SshNet/ShellStream.cs

@@ -659,7 +659,7 @@ namespace Renci.SshNet
         /// <param name="line">The line to be written to the shell.</param>
         public void WriteLine(string line)
         {
-            var commandText = string.Format("{0}{1}", line, "\r\n");
+            var commandText = string.Format("{0}{1}", line, "\r");
             this.Write(commandText);
         }
 
@@ -728,12 +728,11 @@ namespace Renci.SshNet
             lock (this._incoming)
             {
                 foreach (var b in e.Data)
-                {
                     this._incoming.Enqueue(b);
-                }
             }
 
-            this._dataReceived.Set();
+            if (_dataReceived != null)
+                _dataReceived.Set();
 
             this.OnDataReceived(e.Data);
         }