The following fix was tweaked
- Fixed a compatibility issue with OpenSSH+HPN on FreeBSD.
Originally the code specifically applied to OpenSSH+HPN servers running on FreeBSD but after additional testing I discovered that the issue was not FreeBSD specific.
The main deciding factor appears to be whether the server is running on a local network with 0 latency and the size of the HPNBuffer set on the server. It appears to be a bad configuration on the server where the HPNBuffer is too big and the OS doesn't scale the TCP buffer big enough or fast enough.
This causes the TCP packet to fail triggering a TCP retransmission which eventually leads to an error on the server and the upload fails. (increasing the server OS TCP buffers or lowering the HPNBuffer in OpenSSH is another way to avoid this problem.)
Instead of specifically checking for FreeBSD the modified fix checks the latency (delay) between the client/server, if the latency is low then then the fix applied which basically reduces the size of the SSH packets, since the latency is low the impact is minimal.