浏览代码

Limit size of SSH packet to 35.000 bytes.
Improve documentation of LocalChannelDataPacketSize.

Gert Driesen 8 年之前
父节点
当前提交
e86fd18b21
共有 1 个文件被更改,包括 13 次插入1 次删除
  1. 13 1
      src/Renci.SshNet/Session.cs

+ 13 - 1
src/Renci.SshNet/Session.cs

@@ -49,7 +49,10 @@ namespace Renci.SshNet
         /// <summary>
         /// Specifies maximum packet size defined by the protocol.
         /// </summary>
-        private const int MaximumSshPacketSize = LocalChannelDataPacketSize + 3000;
+        /// <value>
+        /// 35000.
+        /// </value>
+        private const int MaximumSshPacketSize = 35000;
 
         /// <summary>
         /// Holds the initial local window size for the channels.
@@ -65,6 +68,15 @@ namespace Renci.SshNet
         /// <value>
         /// 64 KB.
         /// </value>
+        /// <remarks>
+        /// <para>
+        /// This is the maximum size (in bytes) we support for the data (payload) of a
+        /// <c>SSH_MSG_CHANNEL_DATA</c> message we receive.
+        /// </para>
+        /// <para>
+        /// We currently do not enforce this limit.
+        /// </para>
+        /// </remarks>
         private const int LocalChannelDataPacketSize = 1024*64;
 
 #if FEATURE_REGEX_COMPILE