Commit b9dcbe8
committed
Gate both send-EOF calls on confirm and disconnect
wolfSSH_stream_send_eof() went straight to SendChannelEof(), which
resolves its argument by peer id. An unconfirmed head has peerChannel 0,
so the lookup lands on whichever channel holds peer id 0 -- itself, in the
single-channel case -- and an EOF naming recipient channel 0 goes out
while eofTxd latches on the live channel, silencing its send direction.
- Mirror the openConfirmed guard from wolfSSH_ChannelSendEof() into
wolfSSH_stream_send_eof(), returning WS_CHANNEL_NOT_CONF.
- Add the SendAfterDisconnect() gate to both send-EOF entry points; they
were the only public senders without it, against what ssh.h promises.
- Order it ahead of the channel-list test, as the other stream calls do,
so a torn-down session reports the disconnect and not a bad argument.
- Name WS_DISCONNECT in the wolfSSH_ChannelSendEof() header contract.
- Cover the stream variant in test_SendEofUnconfirmedChannel() and add
test_SendEofAfterDisconnect(); both fail without the fix.1 parent 41d1e52 commit b9dcbe8
3 files changed
Lines changed: 100 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1580 | 1580 | | |
1581 | 1581 | | |
1582 | 1582 | | |
1583 | | - | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
1584 | 1592 | | |
1585 | 1593 | | |
1586 | 1594 | | |
| |||
1589 | 1597 | | |
1590 | 1598 | | |
1591 | 1599 | | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1592 | 1608 | | |
1593 | 1609 | | |
1594 | 1610 | | |
| |||
4379 | 4395 | | |
4380 | 4396 | | |
4381 | 4397 | | |
| 4398 | + | |
| 4399 | + | |
| 4400 | + | |
| 4401 | + | |
4382 | 4402 | | |
4383 | 4403 | | |
4384 | 4404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7245 | 7245 | | |
7246 | 7246 | | |
7247 | 7247 | | |
| 7248 | + | |
| 7249 | + | |
| 7250 | + | |
| 7251 | + | |
| 7252 | + | |
| 7253 | + | |
| 7254 | + | |
| 7255 | + | |
| 7256 | + | |
| 7257 | + | |
| 7258 | + | |
| 7259 | + | |
| 7260 | + | |
| 7261 | + | |
| 7262 | + | |
| 7263 | + | |
| 7264 | + | |
| 7265 | + | |
| 7266 | + | |
| 7267 | + | |
| 7268 | + | |
| 7269 | + | |
| 7270 | + | |
| 7271 | + | |
| 7272 | + | |
| 7273 | + | |
| 7274 | + | |
| 7275 | + | |
| 7276 | + | |
| 7277 | + | |
| 7278 | + | |
| 7279 | + | |
| 7280 | + | |
| 7281 | + | |
| 7282 | + | |
| 7283 | + | |
| 7284 | + | |
| 7285 | + | |
| 7286 | + | |
| 7287 | + | |
| 7288 | + | |
| 7289 | + | |
| 7290 | + | |
| 7291 | + | |
| 7292 | + | |
| 7293 | + | |
| 7294 | + | |
| 7295 | + | |
| 7296 | + | |
| 7297 | + | |
| 7298 | + | |
| 7299 | + | |
| 7300 | + | |
| 7301 | + | |
| 7302 | + | |
| 7303 | + | |
| 7304 | + | |
| 7305 | + | |
7248 | 7306 | | |
7249 | 7307 | | |
7250 | 7308 | | |
| |||
7303 | 7361 | | |
7304 | 7362 | | |
7305 | 7363 | | |
| 7364 | + | |
| 7365 | + | |
| 7366 | + | |
| 7367 | + | |
| 7368 | + | |
| 7369 | + | |
| 7370 | + | |
| 7371 | + | |
| 7372 | + | |
| 7373 | + | |
| 7374 | + | |
| 7375 | + | |
| 7376 | + | |
| 7377 | + | |
7306 | 7378 | | |
7307 | 7379 | | |
7308 | 7380 | | |
| |||
18374 | 18446 | | |
18375 | 18447 | | |
18376 | 18448 | | |
| 18449 | + | |
| 18450 | + | |
| 18451 | + | |
| 18452 | + | |
| 18453 | + | |
18377 | 18454 | | |
18378 | 18455 | | |
18379 | 18456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
333 | 334 | | |
334 | 335 | | |
335 | 336 | | |
| |||
0 commit comments