The various setup routines can only receive CHANNEL_SUCCESS or
CHANNEL_FAILURE, so there's no need for the to worry about receiving
anything else. Strange packets will end up in do_ssh2_authconn
instead.
git-svn-id: svn://svn.tartarus.org/sgt/putty@9619
cda61777-01e9-0310-a592-
d414129be87e
- if (pktin->type != SSH2_MSG_CHANNEL_SUCCESS) {
- if (pktin->type != SSH2_MSG_CHANNEL_FAILURE) {
- bombout(("Unexpected response to X11 forwarding request:"
- " packet type %d", pktin->type));
- sfree(s);
- crStopV;
- }
- logevent("X11 forwarding refused");
- } else {
+ if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS) {
logevent("X11 forwarding enabled");
ssh->X11_fwd_enabled = TRUE;
logevent("X11 forwarding enabled");
ssh->X11_fwd_enabled = TRUE;
+ } else
+ logevent("X11 forwarding refused");
- if (pktin->type != SSH2_MSG_CHANNEL_SUCCESS) {
- if (pktin->type != SSH2_MSG_CHANNEL_FAILURE) {
- bombout(("Unexpected response to agent forwarding request:"
- " packet type %d", pktin->type));
- crStopV;
- }
- logevent("Agent forwarding refused");
- } else {
+ if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS) {
logevent("Agent forwarding enabled");
ssh->agentfwd_enabled = TRUE;
logevent("Agent forwarding enabled");
ssh->agentfwd_enabled = TRUE;
+ } else
+ logevent("Agent forwarding refused");
- if (pktin->type != SSH2_MSG_CHANNEL_SUCCESS) {
- if (pktin->type != SSH2_MSG_CHANNEL_FAILURE) {
- bombout(("Unexpected response to pty request:"
- " packet type %d", pktin->type));
- crStopV;
- }
- c_write_str(ssh, "Server refused to allocate pty\r\n");
- ssh->editing = ssh->echoing = 1;
- } else {
+ if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS) {
logeventf(ssh, "Allocated pty (ospeed %dbps, ispeed %dbps)",
ssh->ospeed, ssh->ispeed);
ssh->got_pty = TRUE;
logeventf(ssh, "Allocated pty (ospeed %dbps, ispeed %dbps)",
ssh->ospeed, ssh->ispeed);
ssh->got_pty = TRUE;
+ } else {
+ c_write_str(ssh, "Server refused to allocate pty\r\n");
+ ssh->editing = ssh->echoing = 1;
}
} else {
ssh->editing = ssh->echoing = 1;
}
} else {
ssh->editing = ssh->echoing = 1;
while (s->env_left > 0) {
crWaitUntilV(pktin);
while (s->env_left > 0) {
crWaitUntilV(pktin);
-
- if (pktin->type != SSH2_MSG_CHANNEL_SUCCESS) {
- if (pktin->type != SSH2_MSG_CHANNEL_FAILURE) {
- bombout(("Unexpected response to environment request:"
- " packet type %d", pktin->type));
- crStopV;
- }
- } else {
+ if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS)