Commit d95204d
committed
ssh, internal: flush the worker's queued output on every call
- wolfSSH_worker() calls wolfSSH_SendPacket() whenever
ssh->outputBuffer holds bytes and the session is not
disconnected, in place of doing so only for WS_SUCCESS,
WS_WANT_READ, WS_CHAN_RXD or WS_EOF. A failed flush reaches the
return only when the receive reported nothing, and ssh->error
keeps the receive's code only when the receive itself failed.
Drops the second DoReceive(), its WS_WINDOW_FULL case, the
WOLFSSH_TEST_BLOCK fork, and the separate WS_CHANNEL_CLOSED
flush the gate used to need.
- wolfSSH_SendPacket() records its code in ssh->error on every
transport failure path, and the comments on _ChannelRead(),
_ChannelReadExt() and test_ChannelReadExtHardFailureReported()
no longer describe the former contract.
- The echoserver shell loop and the Windows wolfsshd shell loop
treat a WS_WANT_WRITE from wolfSSH_worker() as non-fatal.
- tests cover the flush on an idle receive, the owed flush across
calls, what ssh->error holds after a receive failure, a hard
send failure, channel data alongside a failed send, a discarded
buffer and an out-of-bounds send, and that queued output stays
unsent on the pass that receives a disconnect. ConnResetIoSend
moves to the shared doubles beside a new OobIoSend.1 parent d7b6e2a commit d95204d
2 files changed
Lines changed: 15 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3704 | 3704 | | |
3705 | 3705 | | |
3706 | 3706 | | |
3707 | | - | |
3708 | | - | |
3709 | | - | |
3710 | | - | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
3711 | 3710 | | |
3712 | 3711 | | |
3713 | 3712 | | |
3714 | 3713 | | |
3715 | 3714 | | |
3716 | | - | |
3717 | | - | |
3718 | | - | |
3719 | | - | |
3720 | | - | |
3721 | | - | |
3722 | | - | |
3723 | | - | |
3724 | | - | |
3725 | | - | |
3726 | 3715 | | |
3727 | 3716 | | |
3728 | 3717 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6571 | 6571 | | |
6572 | 6572 | | |
6573 | 6573 | | |
6574 | | - | |
6575 | | - | |
6576 | | - | |
6577 | | - | |
| 6574 | + | |
| 6575 | + | |
| 6576 | + | |
| 6577 | + | |
6578 | 6578 | | |
6579 | 6579 | | |
6580 | 6580 | | |
| |||
6614 | 6614 | | |
6615 | 6615 | | |
6616 | 6616 | | |
6617 | | - | |
| 6617 | + | |
| 6618 | + | |
| 6619 | + | |
| 6620 | + | |
| 6621 | + | |
6618 | 6622 | | |
6619 | 6623 | | |
6620 | | - | |
| 6624 | + | |
6621 | 6625 | | |
6622 | 6626 | | |
6623 | 6627 | | |
| |||
20498 | 20502 | | |
20499 | 20503 | | |
20500 | 20504 | | |
20501 | | - | |
20502 | | - | |
| 20505 | + | |
| 20506 | + | |
20503 | 20507 | | |
20504 | 20508 | | |
20505 | 20509 | | |
| |||
0 commit comments