summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2015-01-19 20:07:45 +0000
committerDamien Miller <djm@mindrot.org>2015-01-20 09:14:16 +1100
commit3fdc88a0def4f86aa88a5846ac079dc964c0546a (patch)
treed26470c8ffb49bb4417af2b729d933d6ce3f75f8 /clientloop.c
parent091c302829210c41e7f57c3f094c7b9c054306f0 (diff)
upstream commit
move dispatch to struct ssh; ok djm@
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/clientloop.c b/clientloop.c
index 3b9700aa4..672d06989 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.263 2015/01/19 19:52:16 markus Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.264 2015/01/19 20:07:45 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
@@ -536,13 +536,13 @@ client_check_window_change(void)
536 } 536 }
537} 537}
538 538
539static void 539static int
540client_global_request_reply(int type, u_int32_t seq, void *ctxt) 540client_global_request_reply(int type, u_int32_t seq, void *ctxt)
541{ 541{
542 struct global_confirm *gc; 542 struct global_confirm *gc;
543 543
544 if ((gc = TAILQ_FIRST(&global_confirms)) == NULL) 544 if ((gc = TAILQ_FIRST(&global_confirms)) == NULL)
545 return; 545 return 0;
546 if (gc->cb != NULL) 546 if (gc->cb != NULL)
547 gc->cb(type, seq, gc->ctx); 547 gc->cb(type, seq, gc->ctx);
548 if (--gc->ref_count <= 0) { 548 if (--gc->ref_count <= 0) {
@@ -552,6 +552,7 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
552 } 552 }
553 553
554 packet_set_alive_timeouts(0); 554 packet_set_alive_timeouts(0);
555 return 0;
555} 556}
556 557
557static void 558static void
@@ -1739,7 +1740,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1739 1740
1740/*********/ 1741/*********/
1741 1742
1742static void 1743static int
1743client_input_stdout_data(int type, u_int32_t seq, void *ctxt) 1744client_input_stdout_data(int type, u_int32_t seq, void *ctxt)
1744{ 1745{
1745 u_int data_len; 1746 u_int data_len;
@@ -1748,8 +1749,9 @@ client_input_stdout_data(int type, u_int32_t seq, void *ctxt)
1748 buffer_append(&stdout_buffer, data, data_len); 1749 buffer_append(&stdout_buffer, data, data_len);
1749 explicit_bzero(data, data_len); 1750 explicit_bzero(data, data_len);
1750 free(data); 1751 free(data);
1752 return 0;
1751} 1753}
1752static void 1754static int
1753client_input_stderr_data(int type, u_int32_t seq, void *ctxt) 1755client_input_stderr_data(int type, u_int32_t seq, void *ctxt)
1754{ 1756{
1755 u_int data_len; 1757 u_int data_len;
@@ -1758,8 +1760,9 @@ client_input_stderr_data(int type, u_int32_t seq, void *ctxt)
1758 buffer_append(&stderr_buffer, data, data_len); 1760 buffer_append(&stderr_buffer, data, data_len);
1759 explicit_bzero(data, data_len); 1761 explicit_bzero(data, data_len);
1760 free(data); 1762 free(data);
1763 return 0;
1761} 1764}
1762static void 1765static int
1763client_input_exit_status(int type, u_int32_t seq, void *ctxt) 1766client_input_exit_status(int type, u_int32_t seq, void *ctxt)
1764{ 1767{
1765 exit_status = packet_get_int(); 1768 exit_status = packet_get_int();
@@ -1774,8 +1777,9 @@ client_input_exit_status(int type, u_int32_t seq, void *ctxt)
1774 packet_write_wait(); 1777 packet_write_wait();
1775 /* Flag that we want to exit. */ 1778 /* Flag that we want to exit. */
1776 quit_pending = 1; 1779 quit_pending = 1;
1780 return 0;
1777} 1781}
1778static void 1782static int
1779client_input_agent_open(int type, u_int32_t seq, void *ctxt) 1783client_input_agent_open(int type, u_int32_t seq, void *ctxt)
1780{ 1784{
1781 Channel *c = NULL; 1785 Channel *c = NULL;
@@ -1818,6 +1822,7 @@ client_input_agent_open(int type, u_int32_t seq, void *ctxt)
1818 packet_put_int(c->self); 1822 packet_put_int(c->self);
1819 } 1823 }
1820 packet_send(); 1824 packet_send();
1825 return 0;
1821} 1826}
1822 1827
1823static Channel * 1828static Channel *
@@ -1978,7 +1983,7 @@ client_request_tun_fwd(int tun_mode, int local_tun, int remote_tun)
1978} 1983}
1979 1984
1980/* XXXX move to generic input handler */ 1985/* XXXX move to generic input handler */
1981static void 1986static int
1982client_input_channel_open(int type, u_int32_t seq, void *ctxt) 1987client_input_channel_open(int type, u_int32_t seq, void *ctxt)
1983{ 1988{
1984 Channel *c = NULL; 1989 Channel *c = NULL;
@@ -2029,8 +2034,9 @@ client_input_channel_open(int type, u_int32_t seq, void *ctxt)
2029 packet_send(); 2034 packet_send();
2030 } 2035 }
2031 free(ctype); 2036 free(ctype);
2037 return 0;
2032} 2038}
2033static void 2039static int
2034client_input_channel_req(int type, u_int32_t seq, void *ctxt) 2040client_input_channel_req(int type, u_int32_t seq, void *ctxt)
2035{ 2041{
2036 Channel *c = NULL; 2042 Channel *c = NULL;
@@ -2075,8 +2081,9 @@ client_input_channel_req(int type, u_int32_t seq, void *ctxt)
2075 packet_send(); 2081 packet_send();
2076 } 2082 }
2077 free(rtype); 2083 free(rtype);
2084 return 0;
2078} 2085}
2079static void 2086static int
2080client_input_global_request(int type, u_int32_t seq, void *ctxt) 2087client_input_global_request(int type, u_int32_t seq, void *ctxt)
2081{ 2088{
2082 char *rtype; 2089 char *rtype;
@@ -2094,6 +2101,7 @@ client_input_global_request(int type, u_int32_t seq, void *ctxt)
2094 packet_write_wait(); 2101 packet_write_wait();
2095 } 2102 }
2096 free(rtype); 2103 free(rtype);
2104 return 0;
2097} 2105}
2098 2106
2099void 2107void