Browse Source

Number of bytes in read buffer can never be negative.

drieseng 9 years ago
parent
commit
5260f1b73d
1 changed files with 0 additions and 12 deletions
  1. 0 12
      src/Renci.SshNet/Sftp/SftpFileStream.cs

+ 0 - 12
src/Renci.SshNet/Sftp/SftpFileStream.cs

@@ -370,12 +370,6 @@ namespace Renci.SshNet.Sftp
                         Buffer.BlockCopy(data, 0, _readBuffer, 0, _bufferLen);
                         _serverFilePosition = (ulong)_position;
 
-                        if (_bufferLen < 0)
-                        {
-                            _bufferLen = 0;
-                            //  TODO:   Add SFTP error code or message if possible
-                            throw new IOException("Read operation failed.");
-                        }
                         if (_bufferLen == 0)
                         {
                             break;
@@ -435,12 +429,6 @@ namespace Renci.SshNet.Sftp
                     Buffer.BlockCopy(data, 0, _readBuffer, 0, _readBufferSize);
                     _serverFilePosition = (ulong)_position;
 
-                    if (_bufferLen < 0)
-                    {
-                        _bufferLen = 0;
-                        //  TODO:   Add SFTP error code or message if possible
-                        throw new IOException("Read operation failed.");
-                    }
                     if (_bufferLen == 0)
                     {
                         // We've reached EOF.