Skip to content

Commit 6ed8e12

Browse files
yosuke-wolfsslejohnstown
authored andcommitted
examples/echoserver, scripts: hold what a send did not take
- WS_AppCtx stages each direction on its own: buffer, bufferIdx and bufferOff from appFd to the channel; fdBuffer, fdIdx and fdOff from the channel to appFd. thread_ctx_t drops channelBuffer and eofBuffer. - app_drain_to_channel() advances bufferOff by what wolfSSH_ChannelIdSend() took, and holds the rest on WS_WANT_WRITE, WS_WINDOW_FULL, WS_REKEYING, WS_CHANNEL_NOT_CONF and WS_CHAN_RXD, putting back the ssh->error from before that send for all but WS_WANT_WRITE. A zero or over-reported send ends the session. - app_pump_to_fd() reads the channel into fdBuffer and writes it to the pty or forward socket, both now nonblocking, keeping what would block. - ssh_worker() leaves appFd out of the read set while buffer holds bytes, puts it in the write set while fdBuffer does, and runs both pumps on every pass. - A pty read of zero ends the loop whatever errno holds. - app_echo_pump() echoes the shell channel through shellCtx.buffer and then hands each new chunk to process_bytes(). It replaces the EOF drain along with eofOff and eofRead. A negative read ends the session. - app_flush_fd() gives a connected forward up to APP_FLUSH_SECS without progress after the loop to take what fdBuffer still holds. - The agent keeps blocking writes, through app_write_all(), which retries an interrupted send. - A forward clears both of its buffers as it connects. - fwd-bulk.test phase 3 logs in with a password and echoes 32 MB through ssh -L while the client keeps sending but stops reading for 10 s. Phase 4 ends a forward while bytes are held for its target and checks the next forward's target gets only its own. Issue: F-10544
1 parent 527e019 commit 6ed8e12

2 files changed

Lines changed: 629 additions & 157 deletions

File tree

0 commit comments

Comments
 (0)