summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-09-16 13:29:08 +1100
committerDamien Miller <djm@mindrot.org>2000-09-16 13:29:08 +1100
commite4340be5b3ff16f4d9ba5e3ea7e449dc1b6fa7a8 (patch)
treeaba9e2ae234edeb888b922c6a13b755c1248deea /channels.c
parentf384c366d33cb435627743f7ea0ed3f966543d40 (diff)
- (djm) Merge OpenBSD changes:
- markus@cvs.openbsd.org 2000/09/05 02:59:57 [session.c] print hostname (not hushlogin) - markus@cvs.openbsd.org 2000/09/05 13:18:48 [authfile.c ssh-add.c] enable ssh-add -d for DSA keys - markus@cvs.openbsd.org 2000/09/05 13:20:49 [sftp-server.c] cleanup - markus@cvs.openbsd.org 2000/09/06 03:46:41 [authfile.h] prototype - deraadt@cvs.openbsd.org 2000/09/07 14:27:56 [ALL] cleanup copyright notices on all files. I have attempted to be accurate with the details. everything is now under Tatu's licence (which I copied from his readme), and/or the core-sdi bsd-ish thing for deattack, or various openbsd developers under a 2-term bsd licence. We're not changing any rules, just being accurate. - markus@cvs.openbsd.org 2000/09/07 14:40:30 [channels.c channels.h clientloop.c serverloop.c ssh.c] cleanup window and packet sizes for ssh2 flow control; ok niels - markus@cvs.openbsd.org 2000/09/07 14:53:00 [scp.c] typo - markus@cvs.openbsd.org 2000/09/07 15:13:37 [auth-options.c auth-options.h auth-rh-rsa.c auth-rsa.c auth.c] [authfile.h canohost.c channels.h compat.c hostfile.h log.c match.h] [pty.c readconf.c] some more Copyright fixes - markus@cvs.openbsd.org 2000/09/08 03:02:51 [README.openssh2] bye bye - deraadt@cvs.openbsd.org 2000/09/11 18:38:33 [LICENCE cipher.c] a few more comments about it being ARC4 not RC4 - markus@cvs.openbsd.org 2000/09/12 14:53:11 [log-client.c log-server.c log.c ssh.1 ssh.c ssh.h sshd.8 sshd.c] multiple debug levels - markus@cvs.openbsd.org 2000/09/14 14:25:15 [clientloop.c] typo - deraadt@cvs.openbsd.org 2000/09/15 01:13:51 [ssh-agent.c] check return value for setenv(3) for failure, and deal appropriately
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c47
1 files changed, 32 insertions, 15 deletions
diff --git a/channels.c b/channels.c
index 4ac48a77a..48479c456 100644
--- a/channels.c
+++ b/channels.c
@@ -1,23 +1,46 @@
1/* 1/*
2 *
3 * channels.c
4 *
5 * Author: Tatu Ylonen <ylo@cs.hut.fi> 2 * Author: Tatu Ylonen <ylo@cs.hut.fi>
6 *
7 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8 * All rights reserved 4 * All rights reserved
9 *
10 * Created: Fri Mar 24 16:35:24 1995 ylo
11 *
12 * This file contains functions for generic socket connection forwarding. 5 * This file contains functions for generic socket connection forwarding.
13 * There is also code for initiating connection forwarding for X11 connections, 6 * There is also code for initiating connection forwarding for X11 connections,
14 * arbitrary tcp/ip connections, and the authentication agent connection. 7 * arbitrary tcp/ip connections, and the authentication agent connection.
15 * 8 *
9 * As far as I am concerned, the code I have written for this software
10 * can be used freely for any purpose. Any derived versions of this
11 * software must be clearly marked as such, and if the derived work is
12 * incompatible with the protocol description in the RFC file, it must be
13 * called by a name other than "ssh" or "Secure Shell".
14 *
15 *
16 * SSH2 support added by Markus Friedl. 16 * SSH2 support added by Markus Friedl.
17 * Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
18 * Copyright (c) 1999 Dug Song. All rights reserved.
19 * Copyright (c) 1999 Theo de Raadt. All rights reserved.
20 *
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions
23 * are met:
24 * 1. Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
31 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
33 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
34 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
35 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
39 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 */ 40 */
18 41
19#include "includes.h" 42#include "includes.h"
20RCSID("$OpenBSD: channels.c,v 1.66 2000/08/19 21:55:51 markus Exp $"); 43RCSID("$OpenBSD: channels.c,v 1.68 2000/09/07 20:40:29 markus Exp $");
21 44
22#include "ssh.h" 45#include "ssh.h"
23#include "packet.h" 46#include "packet.h"
@@ -44,12 +67,6 @@ RCSID("$OpenBSD: channels.c,v 1.66 2000/08/19 21:55:51 markus Exp $");
44/* Max len of agent socket */ 67/* Max len of agent socket */
45#define MAX_SOCKET_NAME 100 68#define MAX_SOCKET_NAME 100
46 69
47/* default window/packet sizes for tcp/x11-fwd-channel */
48#define CHAN_TCP_WINDOW_DEFAULT (8*1024)
49#define CHAN_TCP_PACKET_DEFAULT (CHAN_TCP_WINDOW_DEFAULT/2)
50#define CHAN_X11_WINDOW_DEFAULT (4*1024)
51#define CHAN_X11_PACKET_DEFAULT (CHAN_X11_WINDOW_DEFAULT/2)
52
53/* 70/*
54 * Pointer to an array containing all allocated channels. The array is 71 * Pointer to an array containing all allocated channels. The array is
55 * dynamically extended as needed. 72 * dynamically extended as needed.
@@ -2340,7 +2357,7 @@ channel_set_fds(int id, int rfd, int wfd, int efd, int extusage)
2340 channel_register_fds(c, rfd, wfd, efd, extusage); 2357 channel_register_fds(c, rfd, wfd, efd, extusage);
2341 c->type = SSH_CHANNEL_OPEN; 2358 c->type = SSH_CHANNEL_OPEN;
2342 /* XXX window size? */ 2359 /* XXX window size? */
2343 c->local_window = c->local_window_max = c->local_maxpacket/2; 2360 c->local_window = c->local_window_max = c->local_maxpacket * 2;
2344 packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); 2361 packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST);
2345 packet_put_int(c->remote_id); 2362 packet_put_int(c->remote_id);
2346 packet_put_int(c->local_window); 2363 packet_put_int(c->local_window);