mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
ssh2_try_send: don't try sending if a channel is half-open.
When ssh2_connection_filter_queue is _receiving_ messages about a channel from the other end, it carefully checks if the channel referred to is half-open. But we weren't exercising the same caution before beginning to _send_ channel data, and we should, because in that situation important fields like c->remwinsize aren't even initialised yet. This can come up, for example, due to typeahead in the main session window before the server has sent OPEN_CONFIRMATION.
This commit is contained in:
parent
8c366766ae
commit
deafaa811e
@ -1060,6 +1060,7 @@ static size_t ssh2_try_send(struct ssh2_channel *c)
|
|||||||
PktOut *pktout;
|
PktOut *pktout;
|
||||||
size_t bufsize;
|
size_t bufsize;
|
||||||
|
|
||||||
|
if (!c->halfopen) {
|
||||||
while (c->remwindow > 0 &&
|
while (c->remwindow > 0 &&
|
||||||
(bufchain_size(&c->outbuffer) > 0 ||
|
(bufchain_size(&c->outbuffer) > 0 ||
|
||||||
bufchain_size(&c->errbuffer) > 0)) {
|
bufchain_size(&c->errbuffer) > 0)) {
|
||||||
@ -1085,6 +1086,7 @@ static size_t ssh2_try_send(struct ssh2_channel *c)
|
|||||||
bufchain_consume(buf, data.len);
|
bufchain_consume(buf, data.len);
|
||||||
c->remwindow -= data.len;
|
c->remwindow -= data.len;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* After having sent as much data as we can, return the amount
|
* After having sent as much data as we can, return the amount
|
||||||
|
Loading…
x
Reference in New Issue
Block a user