mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 09:12:24 +00:00
Over-enthusiastic assertions in the port forwarding code removed.
Port forwardings are set up before initialising the last few details of the main shell session, so ssh->state can reasonably hold values other than SSH_STATE_SESSION and SSH_STATE_CLOSED during calls to sshfwd_*. [originally from svn r5446]
This commit is contained in:
parent
f76c35b4b7
commit
0fbab7b041
12
ssh.c
12
ssh.c
@ -3682,10 +3682,8 @@ void sshfwd_close(struct ssh_channel *c)
|
|||||||
{
|
{
|
||||||
Ssh ssh = c->ssh;
|
Ssh ssh = c->ssh;
|
||||||
|
|
||||||
if (ssh->state != SSH_STATE_SESSION) {
|
if (ssh->state == SSH_STATE_CLOSED)
|
||||||
assert(ssh->state == SSH_STATE_CLOSED);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (c && !c->closes) {
|
if (c && !c->closes) {
|
||||||
/*
|
/*
|
||||||
@ -3722,10 +3720,8 @@ int sshfwd_write(struct ssh_channel *c, char *buf, int len)
|
|||||||
{
|
{
|
||||||
Ssh ssh = c->ssh;
|
Ssh ssh = c->ssh;
|
||||||
|
|
||||||
if (ssh->state != SSH_STATE_SESSION) {
|
if (ssh->state == SSH_STATE_CLOSED)
|
||||||
assert(ssh->state == SSH_STATE_CLOSED);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
if (ssh->version == 1) {
|
if (ssh->version == 1) {
|
||||||
send_packet(ssh, SSH1_MSG_CHANNEL_DATA,
|
send_packet(ssh, SSH1_MSG_CHANNEL_DATA,
|
||||||
@ -3751,10 +3747,8 @@ void sshfwd_unthrottle(struct ssh_channel *c, int bufsize)
|
|||||||
{
|
{
|
||||||
Ssh ssh = c->ssh;
|
Ssh ssh = c->ssh;
|
||||||
|
|
||||||
if (ssh->state != SSH_STATE_SESSION) {
|
if (ssh->state == SSH_STATE_CLOSED)
|
||||||
assert(ssh->state == SSH_STATE_CLOSED);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (ssh->version == 1) {
|
if (ssh->version == 1) {
|
||||||
if (c->v.v1.throttling && bufsize < SSH1_BUFFER_LIMIT) {
|
if (c->v.v1.throttling && bufsize < SSH1_BUFFER_LIMIT) {
|
||||||
|
Loading…
Reference in New Issue
Block a user