diff options
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/channels.c b/channels.c index 539dff3a5..8455518e2 100644 --- a/channels.c +++ b/channels.c | |||
@@ -16,7 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "includes.h" | 18 | #include "includes.h" |
19 | RCSID("$Id: channels.c,v 1.13 1999/12/21 00:18:08 damien Exp $"); | 19 | RCSID("$Id: channels.c,v 1.14 1999/12/27 12:54:55 damien Exp $"); |
20 | 20 | ||
21 | #include "ssh.h" | 21 | #include "ssh.h" |
22 | #include "packet.h" | 22 | #include "packet.h" |
@@ -251,7 +251,7 @@ redo: | |||
251 | packet_put_int(ch->remote_id); | 251 | packet_put_int(ch->remote_id); |
252 | packet_send(); | 252 | packet_send(); |
253 | ch->type = SSH_CHANNEL_CLOSED; | 253 | ch->type = SSH_CHANNEL_CLOSED; |
254 | debug("Closing channel %d after input drain.", i); | 254 | debug("Closing channel %d after input drain.", ch->self); |
255 | break; | 255 | break; |
256 | } | 256 | } |
257 | break; | 257 | break; |
@@ -443,17 +443,16 @@ channel_after_select(fd_set * readset, fd_set * writeset) | |||
443 | * for connections from clients. | 443 | * for connections from clients. |
444 | */ | 444 | */ |
445 | if (FD_ISSET(ch->sock, readset)) { | 445 | if (FD_ISSET(ch->sock, readset)) { |
446 | int nchan; | 446 | addrlen = sizeof(addr); |
447 | len = sizeof(addr); | 447 | newsock = accept(ch->sock, &addr, &addrlen); |
448 | newsock = accept(ch->sock, &addr, &len); | ||
449 | if (newsock < 0) { | 448 | if (newsock < 0) { |
450 | error("accept from auth socket: %.100s", strerror(errno)); | 449 | error("accept from auth socket: %.100s", strerror(errno)); |
451 | break; | 450 | break; |
452 | } | 451 | } |
453 | nchan = channel_allocate(SSH_CHANNEL_OPENING, newsock, | 452 | newch = channel_allocate(SSH_CHANNEL_OPENING, newsock, |
454 | xstrdup("accepted auth socket")); | 453 | xstrdup("accepted auth socket")); |
455 | packet_start(SSH_SMSG_AGENT_OPEN); | 454 | packet_start(SSH_SMSG_AGENT_OPEN); |
456 | packet_put_int(nchan); | 455 | packet_put_int(newch); |
457 | packet_send(); | 456 | packet_send(); |
458 | } | 457 | } |
459 | break; | 458 | break; |
@@ -547,8 +546,8 @@ channel_output_poll() | |||
547 | len = 512; | 546 | len = 512; |
548 | } else { | 547 | } else { |
549 | /* Keep the packets at reasonable size. */ | 548 | /* Keep the packets at reasonable size. */ |
550 | if (len > 16384) | 549 | if (len > packet_get_maxsize()/2) |
551 | len = 16384; | 550 | len = packet_get_maxsize()/2; |
552 | } | 551 | } |
553 | packet_start(SSH_MSG_CHANNEL_DATA); | 552 | packet_start(SSH_MSG_CHANNEL_DATA); |
554 | packet_put_int(ch->remote_id); | 553 | packet_put_int(ch->remote_id); |