summaryrefslogtreecommitdiff
path: root/serverloop.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 /serverloop.c
parent091c302829210c41e7f57c3f094c7b9c054306f0 (diff)
upstream commit
move dispatch to struct ssh; ok djm@
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/serverloop.c b/serverloop.c
index f1fbb0512..edf6a813f 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: serverloop.c,v 1.173 2015/01/19 19:52:16 markus Exp $ */ 1/* $OpenBSD: serverloop.c,v 1.174 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
@@ -894,7 +894,7 @@ server_loop2(Authctxt *authctxt)
894 session_destroy_all(NULL); 894 session_destroy_all(NULL);
895} 895}
896 896
897static void 897static int
898server_input_keep_alive(int type, u_int32_t seq, void *ctxt) 898server_input_keep_alive(int type, u_int32_t seq, void *ctxt)
899{ 899{
900 debug("Got %d/%u for keepalive", type, seq); 900 debug("Got %d/%u for keepalive", type, seq);
@@ -904,9 +904,10 @@ server_input_keep_alive(int type, u_int32_t seq, void *ctxt)
904 * the bogus CHANNEL_REQUEST we send for keepalives. 904 * the bogus CHANNEL_REQUEST we send for keepalives.
905 */ 905 */
906 packet_set_alive_timeouts(0); 906 packet_set_alive_timeouts(0);
907 return 0;
907} 908}
908 909
909static void 910static int
910server_input_stdin_data(int type, u_int32_t seq, void *ctxt) 911server_input_stdin_data(int type, u_int32_t seq, void *ctxt)
911{ 912{
912 char *data; 913 char *data;
@@ -915,15 +916,16 @@ server_input_stdin_data(int type, u_int32_t seq, void *ctxt)
915 /* Stdin data from the client. Append it to the buffer. */ 916 /* Stdin data from the client. Append it to the buffer. */
916 /* Ignore any data if the client has closed stdin. */ 917 /* Ignore any data if the client has closed stdin. */
917 if (fdin == -1) 918 if (fdin == -1)
918 return; 919 return 0;
919 data = packet_get_string(&data_len); 920 data = packet_get_string(&data_len);
920 packet_check_eom(); 921 packet_check_eom();
921 buffer_append(&stdin_buffer, data, data_len); 922 buffer_append(&stdin_buffer, data, data_len);
922 explicit_bzero(data, data_len); 923 explicit_bzero(data, data_len);
923 free(data); 924 free(data);
925 return 0;
924} 926}
925 927
926static void 928static int
927server_input_eof(int type, u_int32_t seq, void *ctxt) 929server_input_eof(int type, u_int32_t seq, void *ctxt)
928{ 930{
929 /* 931 /*
@@ -934,9 +936,10 @@ server_input_eof(int type, u_int32_t seq, void *ctxt)
934 debug("EOF received for stdin."); 936 debug("EOF received for stdin.");
935 packet_check_eom(); 937 packet_check_eom();
936 stdin_eof = 1; 938 stdin_eof = 1;
939 return 0;
937} 940}
938 941
939static void 942static int
940server_input_window_size(int type, u_int32_t seq, void *ctxt) 943server_input_window_size(int type, u_int32_t seq, void *ctxt)
941{ 944{
942 u_int row = packet_get_int(); 945 u_int row = packet_get_int();
@@ -948,6 +951,7 @@ server_input_window_size(int type, u_int32_t seq, void *ctxt)
948 packet_check_eom(); 951 packet_check_eom();
949 if (fdin != -1) 952 if (fdin != -1)
950 pty_change_window_size(fdin, row, col, xpixel, ypixel); 953 pty_change_window_size(fdin, row, col, xpixel, ypixel);
954 return 0;
951} 955}
952 956
953static Channel * 957static Channel *
@@ -1092,7 +1096,7 @@ server_request_session(void)
1092 return c; 1096 return c;
1093} 1097}
1094 1098
1095static void 1099static int
1096server_input_channel_open(int type, u_int32_t seq, void *ctxt) 1100server_input_channel_open(int type, u_int32_t seq, void *ctxt)
1097{ 1101{
1098 Channel *c = NULL; 1102 Channel *c = NULL;
@@ -1142,9 +1146,10 @@ server_input_channel_open(int type, u_int32_t seq, void *ctxt)
1142 packet_send(); 1146 packet_send();
1143 } 1147 }
1144 free(ctype); 1148 free(ctype);
1149 return 0;
1145} 1150}
1146 1151
1147static void 1152static int
1148server_input_global_request(int type, u_int32_t seq, void *ctxt) 1153server_input_global_request(int type, u_int32_t seq, void *ctxt)
1149{ 1154{
1150 char *rtype; 1155 char *rtype;
@@ -1239,9 +1244,10 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
1239 packet_write_wait(); 1244 packet_write_wait();
1240 } 1245 }
1241 free(rtype); 1246 free(rtype);
1247 return 0;
1242} 1248}
1243 1249
1244static void 1250static int
1245server_input_channel_req(int type, u_int32_t seq, void *ctxt) 1251server_input_channel_req(int type, u_int32_t seq, void *ctxt)
1246{ 1252{
1247 Channel *c; 1253 Channel *c;
@@ -1271,6 +1277,7 @@ server_input_channel_req(int type, u_int32_t seq, void *ctxt)
1271 packet_send(); 1277 packet_send();
1272 } 1278 }
1273 free(rtype); 1279 free(rtype);
1280 return 0;
1274} 1281}
1275 1282
1276static void 1283static void