Commit b9d4cc3
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 or WS_CHAN_RXD. A failed flush reaches the return
only when the receive reported nothing; a receive that reported
anything but WS_WANT_READ keeps ssh->error. Drops the second
DoReceive(), its WS_WINDOW_FULL case, and the
WOLFSSH_TEST_BLOCK fork.
- wolfSSH_SendPacket() records its code in ssh->error on every
failure path: a null send callback, a bad buffer state, the
connection-reset/close/general cases, and an out-of-bounds
read. Its header comment states that contract.
- tests cover the flush on an idle receive, the owed flush across
calls, a receive failure and a hard send failure each landing in
ssh->error, and that a disconnect on the same pass leaves queued
output unsent.1 parent bfe6fe0 commit b9d4cc3
4 files changed
Lines changed: 422 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4290 | 4290 | | |
4291 | 4291 | | |
4292 | 4292 | | |
4293 | | - | |
| 4293 | + | |
| 4294 | + | |
4294 | 4295 | | |
4295 | 4296 | | |
4296 | 4297 | | |
4297 | 4298 | | |
4298 | 4299 | | |
4299 | 4300 | | |
| 4301 | + | |
4300 | 4302 | | |
4301 | 4303 | | |
4302 | 4304 | | |
| |||
4307 | 4309 | | |
4308 | 4310 | | |
4309 | 4311 | | |
| 4312 | + | |
4310 | 4313 | | |
4311 | 4314 | | |
4312 | 4315 | | |
| |||
4332 | 4335 | | |
4333 | 4336 | | |
4334 | 4337 | | |
| 4338 | + | |
4335 | 4339 | | |
4336 | 4340 | | |
4337 | 4341 | | |
4338 | 4342 | | |
4339 | 4343 | | |
| 4344 | + | |
4340 | 4345 | | |
4341 | 4346 | | |
4342 | 4347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3614 | 3614 | | |
3615 | 3615 | | |
3616 | 3616 | | |
3617 | | - | |
3618 | | - | |
3619 | | - | |
3620 | | - | |
3621 | | - | |
3622 | | - | |
3623 | | - | |
3624 | | - | |
3625 | | - | |
3626 | | - | |
3627 | 3617 | | |
3628 | 3618 | | |
3629 | 3619 | | |
3630 | 3620 | | |
3631 | 3621 | | |
3632 | | - | |
3633 | | - | |
3634 | | - | |
3635 | | - | |
3636 | | - | |
3637 | | - | |
3638 | | - | |
| 3622 | + | |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
| 3626 | + | |
3639 | 3627 | | |
3640 | | - | |
3641 | | - | |
3642 | | - | |
3643 | | - | |
3644 | | - | |
3645 | | - | |
3646 | | - | |
3647 | | - | |
3648 | | - | |
3649 | | - | |
3650 | | - | |
3651 | | - | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
3652 | 3631 | | |
3653 | | - | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
3654 | 3638 | | |
3655 | 3639 | | |
3656 | | - | |
3657 | 3640 | | |
3658 | 3641 | | |
3659 | 3642 | | |
| |||
4074 | 4057 | | |
4075 | 4058 | | |
4076 | 4059 | | |
4077 | | - | |
4078 | | - | |
| 4060 | + | |
| 4061 | + | |
4079 | 4062 | | |
4080 | 4063 | | |
4081 | 4064 | | |
| |||
4135 | 4118 | | |
4136 | 4119 | | |
4137 | 4120 | | |
4138 | | - | |
4139 | | - | |
| 4121 | + | |
| 4122 | + | |
4140 | 4123 | | |
4141 | 4124 | | |
4142 | 4125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4499 | 4499 | | |
4500 | 4500 | | |
4501 | 4501 | | |
| 4502 | + | |
| 4503 | + | |
| 4504 | + | |
| 4505 | + | |
| 4506 | + | |
4502 | 4507 | | |
4503 | 4508 | | |
4504 | 4509 | | |
4505 | 4510 | | |
4506 | | - | |
| 4511 | + | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
4507 | 4515 | | |
4508 | 4516 | | |
4509 | 4517 | | |
| |||
0 commit comments