channel: use a larger window size to increase receive throughput.
The window size controls how much data the peer can send before
we send back a message to to increase the window.
This changes the default window from 1.28MB to 2MiB. 2MiB matches
the OpenSSH default session size.
The code is also refactored to grow the windows on code paths
where data is consumed, and move the condition that checks
if the growing the window is needed into the grow method.
@jjelen @cryptomilk ptal
Checklist
-
Commits have Signed-off-by:with name/author being identical to the commit author -
Code modified for feature -
Test suite updated with functionality tests -
Test suite updated with negative tests -
Documentation updated
Reviewer's checklist:
-
Any issues marked for closing are addressed -
There is a test suite reasonably covering new functionality or modifications -
Function naming, parameters, return values, types, etc., are consistent and according to CONTRIBUTING.md -
This feature/change has adequate documentation added -
No obvious mistakes in the code