mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-11 01:36:39 +00:00
Change default buffer size from maximum allowed to 16KB to avoid several buffer related errors
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Renci.SshNet.NetConf
|
||||
|
||||
private const string _prompt = "]]>]]>";
|
||||
|
||||
private List<byte> _data = new List<byte>(32 * 1024);
|
||||
private List<byte> _data = new List<byte>(16 * 1024);
|
||||
|
||||
private EventWaitHandle _serverCapabilitiesConfirmed = new AutoResetEvent(false);
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Renci.SshNet
|
||||
: base(connectionInfo)
|
||||
{
|
||||
this.OperationTimeout = new TimeSpan(0, 0, 0, 0, -1);
|
||||
this.BufferSize = 1024 * 32 - 52;
|
||||
this.BufferSize = 1024 * 16;
|
||||
|
||||
if (_byteToChar == null)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Renci.SshNet.Sftp
|
||||
{
|
||||
private Dictionary<uint, SftpRequest> _requests = new Dictionary<uint, SftpRequest>();
|
||||
|
||||
private List<byte> _data = new List<byte>(32 * 1024);
|
||||
private List<byte> _data = new List<byte>(16 * 1024);
|
||||
|
||||
private EventWaitHandle _sftpVersionConfirmed = new AutoResetEvent(false);
|
||||
|
||||
@@ -385,7 +385,7 @@ namespace Renci.SshNet.Sftp
|
||||
/// <param name="wait">The wait event handle if needed.</param>
|
||||
internal void RequestWrite(byte[] handle, UInt64 offset, byte[] data, EventWaitHandle wait)
|
||||
{
|
||||
var maximumDataSize = 1024 * 32 - 52;
|
||||
var maximumDataSize = 1024 * 16;
|
||||
|
||||
if (data.Length < maximumDataSize + 1)
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Renci.SshNet
|
||||
: base(connectionInfo)
|
||||
{
|
||||
this.OperationTimeout = new TimeSpan(0, 0, 0, 0, -1);
|
||||
this.BufferSize = 1024 * 32 - 52;
|
||||
this.BufferSize = 1024 * 16;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user