| @@ -1414,12 +1414,9 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer, | |||||
| /* Number of bytes asked for that haven't been acked yet */ | /* Number of bytes asked for that haven't been acked yet */ | ||||
| size_t already = (size_t)(filep->offset_sent - filep->offset); | size_t already = (size_t)(filep->offset_sent - filep->offset); | ||||
| size_t max_read_ahead = buffer_size*4; | |||||
| size_t max_read_ahead = buffer_size; | |||||
| unsigned long recv_window; | unsigned long recv_window; | ||||
| if(max_read_ahead > LIBSSH2_CHANNEL_WINDOW_DEFAULT*4) | |||||
| max_read_ahead = LIBSSH2_CHANNEL_WINDOW_DEFAULT*4; | |||||
| /* if the buffer_size passed in now is smaller than what has | /* if the buffer_size passed in now is smaller than what has | ||||
| already been sent, we risk getting count become a very large | already been sent, we risk getting count become a very large | ||||
| number */ | number */ | ||||
| @@ -1472,8 +1469,8 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer, | |||||
| uint32_t request_id; | uint32_t request_id; | ||||
| uint32_t size = count; | uint32_t size = count; | ||||
| if(size < buffer_size) | |||||
| size = buffer_size; | |||||
| //if(size < buffer_size) | |||||
| // size = buffer_size; | |||||
| if(size > MAX_SFTP_READ_SIZE) | if(size > MAX_SFTP_READ_SIZE) | ||||
| size = MAX_SFTP_READ_SIZE; | size = MAX_SFTP_READ_SIZE; | ||||
| @@ -1576,7 +1573,7 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer, | |||||
| else { | else { | ||||
| /* we should never reach this point */ | /* we should never reach this point */ | ||||
| return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, | return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, | ||||
| "sftp_read() internal error"); | |||||
| "sftp_read() internal error a"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1722,7 +1719,7 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer, | |||||
| /* we should never reach this point */ | /* we should never reach this point */ | ||||
| return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, | return _libssh2_error(session, LIBSSH2_ERROR_SFTP_PROTOCOL, | ||||
| "sftp_read() internal error"); | |||||
| "sftp_read() internal error b"); | |||||
| } | } | ||||
| /* libssh2_sftp_read | /* libssh2_sftp_read | ||||