summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2015-01-19 19:52:16 +0000
committerDamien Miller <djm@mindrot.org>2015-01-20 09:13:01 +1100
commit091c302829210c41e7f57c3f094c7b9c054306f0 (patch)
tree800de5dc85b877a85d1f269ae5bb09b0dc3fa7a7 /clientloop.c
parent4e62cc68ce4ba20245d208b252e74e91d3785b74 (diff)
upstream commit
update packet.c & isolate, introduce struct ssh a) switch packet.c to buffer api and isolate per-connection info into struct ssh b) (de)serialization of the state is moved from monitor to packet.c c) the old packet.c API is implemented in opacket.[ch] d) compress.c/h is removed and integrated into packet.c with and ok djm@
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/clientloop.c b/clientloop.c
index 2137a81ce..3b9700aa4 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.262 2015/01/14 20:05:27 djm Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.263 2015/01/19 19:52:16 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -192,9 +192,6 @@ TAILQ_HEAD(global_confirms, global_confirm);
192static struct global_confirms global_confirms = 192static struct global_confirms global_confirms =
193 TAILQ_HEAD_INITIALIZER(global_confirms); 193 TAILQ_HEAD_INITIALIZER(global_confirms);
194 194
195/*XXX*/
196extern Kex *xxx_kex;
197
198void ssh_process_session2_setup(int, int, int, Buffer *); 195void ssh_process_session2_setup(int, int, int, Buffer *);
199 196
200/* Restores stdin to blocking mode. */ 197/* Restores stdin to blocking mode. */
@@ -1416,7 +1413,7 @@ static void
1416client_process_buffered_input_packets(void) 1413client_process_buffered_input_packets(void)
1417{ 1414{
1418 dispatch_run(DISPATCH_NONBLOCK, &quit_pending, 1415 dispatch_run(DISPATCH_NONBLOCK, &quit_pending,
1419 compat20 ? xxx_kex : NULL); 1416 compat20 ? active_state->kex : NULL);
1420} 1417}
1421 1418
1422/* scan buf[] for '~' before sending data to the peer */ 1419/* scan buf[] for '~' before sending data to the peer */
@@ -1555,7 +1552,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1555 if (compat20 && session_closed && !channel_still_open()) 1552 if (compat20 && session_closed && !channel_still_open())
1556 break; 1553 break;
1557 1554
1558 rekeying = (xxx_kex != NULL && !xxx_kex->done); 1555 rekeying = (active_state->kex != NULL && !active_state->kex->done);
1559 1556
1560 if (rekeying) { 1557 if (rekeying) {
1561 debug("rekeying in progress"); 1558 debug("rekeying in progress");
@@ -1599,8 +1596,8 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1599 channel_after_select(readset, writeset); 1596 channel_after_select(readset, writeset);
1600 if (need_rekeying || packet_need_rekeying()) { 1597 if (need_rekeying || packet_need_rekeying()) {
1601 debug("need rekeying"); 1598 debug("need rekeying");
1602 xxx_kex->done = 0; 1599 active_state->kex->done = 0;
1603 kex_send_kexinit(xxx_kex); 1600 kex_send_kexinit(active_state->kex);
1604 need_rekeying = 0; 1601 need_rekeying = 0;
1605 } 1602 }
1606 } 1603 }
@@ -1729,8 +1726,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1729 1726
1730 /* Report bytes transferred, and transfer rates. */ 1727 /* Report bytes transferred, and transfer rates. */
1731 total_time = get_current_time() - start_time; 1728 total_time = get_current_time() - start_time;
1732 packet_get_state(MODE_IN, NULL, NULL, NULL, &ibytes); 1729 packet_get_bytes(&ibytes, &obytes);
1733 packet_get_state(MODE_OUT, NULL, NULL, NULL, &obytes);
1734 verbose("Transferred: sent %llu, received %llu bytes, in %.1f seconds", 1730 verbose("Transferred: sent %llu, received %llu bytes, in %.1f seconds",
1735 (unsigned long long)obytes, (unsigned long long)ibytes, total_time); 1731 (unsigned long long)obytes, (unsigned long long)ibytes, total_time);
1736 if (total_time > 0) 1732 if (total_time > 0)