Commit c547220
committed
ssh, internal: always flush the worker's output
- 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. ssh->error keeps
the receive's code when the receive failed, and the close's when
a WS_CHANNEL_CLOSED pass hard-failed its flush. Drops the second
DoReceive(), its WS_WINDOW_FULL case, the WOLFSSH_TEST_BLOCK
fork, and the separate WS_CHANNEL_CLOSED flush.
- sendRet moves to the top of wolfSSH_worker(), and the
WS_REKEYING report is skipped when the flush failed.
- SendPacketFlush() records its code in ssh->error on every
transport failure path, and wolfSSH_SendPacket() says so and
what a later write to that field owes it. The comments on
_ChannelRead(), _ChannelReadExt() and
test_ChannelReadExtHardFailureReported() drop the former
contract.
- wolfSSH_stream_read()'s note drops the receive-succeeded
precondition.
- 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 with and
without a rekey, a discarded buffer, an out-of-bounds send and a
close whose flush hard-failed, and queued output staying unsent
on the disconnect pass.1 parent addef17 commit c547220
5 files changed
Lines changed: 682 additions & 69 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4955 | 4955 | | |
4956 | 4956 | | |
4957 | 4957 | | |
| 4958 | + | |
4958 | 4959 | | |
4959 | 4960 | | |
4960 | 4961 | | |
| |||
4965 | 4966 | | |
4966 | 4967 | | |
4967 | 4968 | | |
| 4969 | + | |
4968 | 4970 | | |
4969 | 4971 | | |
4970 | 4972 | | |
| |||
5003 | 5005 | | |
5004 | 5006 | | |
5005 | 5007 | | |
| 5008 | + | |
5006 | 5009 | | |
5007 | 5010 | | |
5008 | 5011 | | |
5009 | 5012 | | |
5010 | 5013 | | |
| 5014 | + | |
5011 | 5015 | | |
5012 | 5016 | | |
5013 | 5017 | | |
| |||
5032 | 5036 | | |
5033 | 5037 | | |
5034 | 5038 | | |
5035 | | - | |
| 5039 | + | |
| 5040 | + | |
| 5041 | + | |
5036 | 5042 | | |
5037 | 5043 | | |
5038 | 5044 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3707 | 3707 | | |
3708 | 3708 | | |
3709 | 3709 | | |
| 3710 | + | |
3710 | 3711 | | |
3711 | 3712 | | |
3712 | 3713 | | |
| |||
3723 | 3724 | | |
3724 | 3725 | | |
3725 | 3726 | | |
3726 | | - | |
3727 | | - | |
3728 | | - | |
3729 | | - | |
3730 | | - | |
3731 | | - | |
3732 | | - | |
3733 | | - | |
3734 | | - | |
3735 | | - | |
3736 | 3727 | | |
3737 | 3728 | | |
3738 | 3729 | | |
3739 | 3730 | | |
3740 | 3731 | | |
3741 | | - | |
3742 | | - | |
3743 | | - | |
3744 | | - | |
3745 | | - | |
3746 | | - | |
3747 | | - | |
3748 | | - | |
3749 | | - | |
3750 | | - | |
3751 | | - | |
3752 | | - | |
3753 | | - | |
3754 | | - | |
3755 | | - | |
3756 | | - | |
3757 | | - | |
3758 | | - | |
3759 | | - | |
3760 | | - | |
3761 | | - | |
3762 | | - | |
3763 | | - | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
3764 | 3740 | | |
3765 | | - | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
3766 | 3749 | | |
3767 | 3750 | | |
3768 | | - | |
3769 | | - | |
3770 | | - | |
3771 | | - | |
3772 | | - | |
3773 | | - | |
3774 | | - | |
3775 | | - | |
3776 | | - | |
3777 | | - | |
3778 | | - | |
3779 | 3751 | | |
3780 | 3752 | | |
3781 | 3753 | | |
| |||
3785 | 3757 | | |
3786 | 3758 | | |
3787 | 3759 | | |
3788 | | - | |
3789 | | - | |
3790 | | - | |
3791 | | - | |
3792 | | - | |
3793 | | - | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
3794 | 3764 | | |
3795 | 3765 | | |
3796 | 3766 | | |
| |||
4228 | 4198 | | |
4229 | 4199 | | |
4230 | 4200 | | |
4231 | | - | |
4232 | | - | |
| 4201 | + | |
| 4202 | + | |
4233 | 4203 | | |
4234 | 4204 | | |
4235 | 4205 | | |
| |||
4289 | 4259 | | |
4290 | 4260 | | |
4291 | 4261 | | |
4292 | | - | |
4293 | | - | |
| 4262 | + | |
| 4263 | + | |
4294 | 4264 | | |
4295 | 4265 | | |
4296 | 4266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6770 | 6770 | | |
6771 | 6771 | | |
6772 | 6772 | | |
| 6773 | + | |
| 6774 | + | |
| 6775 | + | |
| 6776 | + | |
| 6777 | + | |
6773 | 6778 | | |
6774 | 6779 | | |
6775 | 6780 | | |
6776 | 6781 | | |
6777 | | - | |
| 6782 | + | |
| 6783 | + | |
| 6784 | + | |
| 6785 | + | |
6778 | 6786 | | |
6779 | 6787 | | |
6780 | 6788 | | |
| |||
0 commit comments