diff options
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 47 |
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" |
20 | RCSID("$OpenBSD: channels.c,v 1.66 2000/08/19 21:55:51 markus Exp $"); | 43 | RCSID("$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); |