]> andersk Git - gssapi-openssh.git/blobdiff - openssh/clientloop.c
merge hpn12v17
[gssapi-openssh.git] / openssh / clientloop.c
index 4a614d9ee13d221fad4d367916ff3c8e76258610..ac87de57308cb2fcf468becdb090bf5308636e84 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.175 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: clientloop.c,v 1.178 2007/02/20 10:25:14 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -464,8 +464,10 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
 static void
 server_alive_check(void)
 {
-       if (++server_alive_timeouts > options.server_alive_count_max)
-               packet_disconnect("Timeout, server not responding.");
+       if (++server_alive_timeouts > options.server_alive_count_max) {
+               logit("Timeout, server not responding.");
+               cleanup_exit(255);
+       }
        packet_start(SSH2_MSG_GLOBAL_REQUEST);
        packet_put_cstring("keepalive@openssh.com");
        packet_put_char(1);     /* boolean: want reply */
@@ -705,7 +707,7 @@ client_process_control(fd_set *readset)
 {
        Buffer m;
        Channel *c;
-       int client_fd, new_fd[3], ver, allowed;
+       int client_fd, new_fd[3], ver, allowed, window, packetmax;
        socklen_t addrlen;
        struct sockaddr_storage addr;
        struct confirm_ctx *cctx;
@@ -935,15 +937,19 @@ client_process_control(fd_set *readset)
        set_nonblock(client_fd);
 
        if (options.hpn_disabled) 
-               c = channel_new("session", SSH_CHANNEL_OPENING,
-                   new_fd[0], new_fd[1], new_fd[2],
-                   CHAN_SES_WINDOW_DEFAULT, CHAN_SES_PACKET_DEFAULT,
-                   CHAN_EXTENDED_WRITE, "client-session", /*nonblock*/0);
-       else 
-               c = channel_new("session", SSH_CHANNEL_OPENING,
-                   new_fd[0], new_fd[1], new_fd[2],
-                   options.hpn_buffer_size, CHAN_SES_PACKET_DEFAULT,
-                   CHAN_EXTENDED_WRITE, "client-session", /*nonblock*/0);
+         window = options.hpn_buffer_size;
+       else
+         window = CHAN_SES_WINDOW_DEFAULT;
+       packetmax = CHAN_SES_PACKET_DEFAULT;
+       if (cctx->want_tty) {
+               window >>= 1;
+               packetmax >>= 1;
+       }
+
+       c = channel_new("session", SSH_CHANNEL_OPENING,
+           new_fd[0], new_fd[1], new_fd[2], window, packetmax,
+           CHAN_EXTENDED_WRITE, "client-session", /*nonblock*/0);
+
        /* XXX */
        c->ctl_fd = client_fd;
 
@@ -1808,7 +1814,7 @@ client_request_agent(const char *request_type, int rchan)
                error("Warning: this is probably a break-in attempt by a malicious server.");
                return NULL;
        }
-       sock =  ssh_get_authentication_socket();
+       sock = ssh_get_authentication_socket();
        if (sock < 0)
                return NULL;
        if (options.hpn_disabled) 
This page took 0.036015 seconds and 4 git commands to generate.