Преглед на файлове

Add ServerVersion and ClientVersion to the ConnectionInfo

olegkap_cp преди 13 години
родител
ревизия
8ac242d197
променени са 2 файла, в които са добавени 14 реда и са изтрити 0 реда
  1. 10 0
      Renci.SshClient/Renci.SshNet/ConnectionInfo.cs
  2. 4 0
      Renci.SshClient/Renci.SshNet/Session.cs

+ 10 - 0
Renci.SshClient/Renci.SshNet/ConnectionInfo.cs

@@ -170,6 +170,16 @@ namespace Renci.SshNet
         /// </summary>
         public string CurrentServerCompressionAlgorithm { get; internal set; }
 
+        /// <summary>
+        /// Gets the server version.
+        /// </summary>
+        public string ServerVersion { get; internal set; }
+
+        /// <summary>
+        /// Get the client version.
+        /// </summary>
+        public string ClientVersion { get; internal set; }
+
         /// <summary>
         /// Gets the current client compression algorithm.
         /// </summary>

+ 4 - 0
Renci.SshClient/Renci.SshNet/Session.cs

@@ -481,6 +481,10 @@ namespace Renci.SshNet
                         }
                     }
 
+                    //  Set connection versions
+                    this.ConnectionInfo.ServerVersion = this.ServerVersion;
+                    this.ConnectionInfo.ClientVersion = this.ClientVersion;
+
                     //  Get server SSH version
                     var version = versionMatch.Result("${protoversion}");