summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/channels.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>1999-12-27 09:48:39 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>1999-12-27 09:48:39 +0000
commit655b0cc6096a7fb8ae6f6c7b4e8e3aa833eae3f1 (patch)
treea7c1c34341014001c74dd9d3040d987f8c8b4431 /usr.bin/ssh/channels.c
parentd3695c0a9d05e2822daf33bf2a1e71f5a55795b6 (diff)
use packet_get_maxsize for channels. consistence.
Diffstat (limited to 'usr.bin/ssh/channels.c')
-rw-r--r--usr.bin/ssh/channels.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index 730253eaa62..d5b00329426 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -16,7 +16,7 @@
*/
#include "includes.h"
-RCSID("$Id: channels.c,v 1.33 1999/12/12 19:20:02 markus Exp $");
+RCSID("$Id: channels.c,v 1.34 1999/12/27 09:48:38 markus Exp $");
#include "ssh.h"
#include "packet.h"
@@ -251,7 +251,7 @@ redo:
packet_put_int(ch->remote_id);
packet_send();
ch->type = SSH_CHANNEL_CLOSED;
- debug("Closing channel %d after input drain.", i);
+ debug("Closing channel %d after input drain.", ch->self);
break;
}
break;
@@ -443,17 +443,16 @@ channel_after_select(fd_set * readset, fd_set * writeset)
* for connections from clients.
*/
if (FD_ISSET(ch->sock, readset)) {
- int nchan;
- len = sizeof(addr);
- newsock = accept(ch->sock, &addr, &len);
+ addrlen = sizeof(addr);
+ newsock = accept(ch->sock, &addr, &addrlen);
if (newsock < 0) {
error("accept from auth socket: %.100s", strerror(errno));
break;
}
- nchan = channel_allocate(SSH_CHANNEL_OPENING, newsock,
+ newch = channel_allocate(SSH_CHANNEL_OPENING, newsock,
xstrdup("accepted auth socket"));
packet_start(SSH_SMSG_AGENT_OPEN);
- packet_put_int(nchan);
+ packet_put_int(newch);
packet_send();
}
break;
@@ -547,8 +546,8 @@ channel_output_poll()
len = 512;
} else {
/* Keep the packets at reasonable size. */
- if (len > 16384)
- len = 16384;
+ if (len > packet_get_maxsize()/2)
+ len = packet_get_maxsize()/2;
}
packet_start(SSH_MSG_CHANNEL_DATA);
packet_put_int(ch->remote_id);