6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
|
c ? "half-open" : "nonexistent", localid);
ssh_disconnect(ssh, NULL, buf, SSH2_DISCONNECT_PROTOCOL_ERROR, FALSE);
sfree(buf);
return NULL;
}
return c;
}
static void ssh2_msg_channel_failure(Ssh ssh, struct Packet *pktin)
{
/*
* The only time this should get called is for "winadj@putty"
* messages sent above. All other channel requests are either
* sent with want_reply false or are sent before this handler gets
* installed.
*/
struct ssh_channel *c;
struct winadj *wa;
c = ssh2_channel_msg(ssh, pktin);
if (!c)
return;
wa = c->v.v2.winadj_head;
if (!wa)
logevent("excess SSH_MSG_CHANNEL_FAILURE");
else {
c->v.v2.winadj_head = wa->next;
c->v.v2.remlocwin += wa->size;
sfree(wa);
/*
* winadj messages are only sent when the window is fully open,
* so if we get an ack of one, we know any pending unthrottle
* is complete.
*/
if (c->v.v2.throttle_state == UNTHROTTLING)
c->v.v2.throttle_state = UNTHROTTLED;
}
}
static void ssh2_msg_channel_window_adjust(Ssh ssh, struct Packet *pktin)
{
struct ssh_channel *c;
c = ssh2_channel_msg(ssh, pktin);
if (!c)
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
>
|
>
|
|
|
|
|
|
|
|
|
|
<
|
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
|
c ? "half-open" : "nonexistent", localid);
ssh_disconnect(ssh, NULL, buf, SSH2_DISCONNECT_PROTOCOL_ERROR, FALSE);
sfree(buf);
return NULL;
}
return c;
}
static void ssh2_msg_channel_success(Ssh ssh, struct Packet *pktin)
{
/*
* This should never get called. All channel requests are either
* sent with want_reply false or are sent before this handler gets
* installed.
*/
struct ssh_channel *c;
struct winadj *wa;
c = ssh2_channel_msg(ssh, pktin);
if (!c)
return;
wa = c->v.v2.winadj_head;
if (wa)
ssh_disconnect(ssh, NULL, "Received SSH_MSG_CHANNEL_SUCCESS for "
"\"winadj@putty.projects.tartarus.org\"",
SSH2_DISCONNECT_PROTOCOL_ERROR, FALSE);
else
ssh_disconnect(ssh, NULL,
"Received unsolicited SSH_MSG_CHANNEL_SUCCESS",
SSH2_DISCONNECT_PROTOCOL_ERROR, FALSE);
}
static void ssh2_msg_channel_failure(Ssh ssh, struct Packet *pktin)
{
/*
* The only time this should get called is for "winadj@putty"
* messages sent above. All other channel requests are either
* sent with want_reply false or are sent before this handler gets
* installed.
*/
struct ssh_channel *c;
struct winadj *wa;
c = ssh2_channel_msg(ssh, pktin);
if (!c)
return;
wa = c->v.v2.winadj_head;
if (!wa) {
ssh_disconnect(ssh, NULL,
"Received unsolicited SSH_MSG_CHANNEL_FAILURE",
SSH2_DISCONNECT_PROTOCOL_ERROR, FALSE);
return;
}
c->v.v2.winadj_head = wa->next;
c->v.v2.remlocwin += wa->size;
sfree(wa);
/*
* winadj messages are only sent when the window is fully open, so
* if we get an ack of one, we know any pending unthrottle is
* complete.
*/
if (c->v.v2.throttle_state == UNTHROTTLING)
c->v.v2.throttle_state = UNTHROTTLED;
}
static void ssh2_msg_channel_window_adjust(Ssh ssh, struct Packet *pktin)
{
struct ssh_channel *c;
c = ssh2_channel_msg(ssh, pktin);
if (!c)
|
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
|
if (ssh->eof_needed)
ssh_special(ssh, TS_EOF);
/*
* All the initial channel requests are done, so install the default
* failure handler.
*/
ssh->packet_dispatch[SSH2_MSG_CHANNEL_FAILURE] = ssh2_msg_channel_failure;
/*
* Transfer data!
*/
if (ssh->ldisc)
ldisc_send(ssh->ldisc, NULL, 0, 0);/* cause ldisc to notice changes */
|
>
|
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
|
if (ssh->eof_needed)
ssh_special(ssh, TS_EOF);
/*
* All the initial channel requests are done, so install the default
* failure handler.
*/
ssh->packet_dispatch[SSH2_MSG_CHANNEL_SUCCESS] = ssh2_msg_channel_success;
ssh->packet_dispatch[SSH2_MSG_CHANNEL_FAILURE] = ssh2_msg_channel_failure;
/*
* Transfer data!
*/
if (ssh->ldisc)
ldisc_send(ssh->ldisc, NULL, 0, 0);/* cause ldisc to notice changes */
|