Commit 31f831b
portfwd: drain the buffer before leaving on EOF
A zero read on the local socket left the loop at once, and anything
read but not yet accepted by wolfSSH_ChannelSend() went with it. With
the peer's window full that tail is up to a buffer's worth, so a
transfer that ends while the window is being credited comes out short.
- stop polling the socket on end-of-input and keep looping until the
buffer is empty
- leave anyway once the channel is gone, so a forward whose open failed
cannot hold the loop on a buffer nothing can take1 parent ee7fa04 commit 31f831b
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| 435 | + | |
435 | 436 | | |
436 | 437 | | |
437 | 438 | | |
| |||
728 | 729 | | |
729 | 730 | | |
730 | 731 | | |
731 | | - | |
732 | | - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
733 | 738 | | |
734 | 739 | | |
735 | 740 | | |
| |||
868 | 873 | | |
869 | 874 | | |
870 | 875 | | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
871 | 881 | | |
872 | 882 | | |
873 | 883 | | |
| |||
0 commit comments