upstream commit

move dispatch to struct ssh; ok djm@
diff --git a/serverloop.c b/serverloop.c
index f1fbb05..edf6a81 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: serverloop.c,v 1.173 2015/01/19 19:52:16 markus Exp $ */
+/* $OpenBSD: serverloop.c,v 1.174 2015/01/19 20:07:45 markus Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -894,7 +894,7 @@
 	session_destroy_all(NULL);
 }
 
-static void
+static int
 server_input_keep_alive(int type, u_int32_t seq, void *ctxt)
 {
 	debug("Got %d/%u for keepalive", type, seq);
@@ -904,9 +904,10 @@
 	 * the bogus CHANNEL_REQUEST we send for keepalives.
 	 */
 	packet_set_alive_timeouts(0);
+	return 0;
 }
 
-static void
+static int
 server_input_stdin_data(int type, u_int32_t seq, void *ctxt)
 {
 	char *data;
@@ -915,15 +916,16 @@
 	/* Stdin data from the client.  Append it to the buffer. */
 	/* Ignore any data if the client has closed stdin. */
 	if (fdin == -1)
-		return;
+		return 0;
 	data = packet_get_string(&data_len);
 	packet_check_eom();
 	buffer_append(&stdin_buffer, data, data_len);
 	explicit_bzero(data, data_len);
 	free(data);
+	return 0;
 }
 
-static void
+static int
 server_input_eof(int type, u_int32_t seq, void *ctxt)
 {
 	/*
@@ -934,9 +936,10 @@
 	debug("EOF received for stdin.");
 	packet_check_eom();
 	stdin_eof = 1;
+	return 0;
 }
 
-static void
+static int
 server_input_window_size(int type, u_int32_t seq, void *ctxt)
 {
 	u_int row = packet_get_int();
@@ -948,6 +951,7 @@
 	packet_check_eom();
 	if (fdin != -1)
 		pty_change_window_size(fdin, row, col, xpixel, ypixel);
+	return 0;
 }
 
 static Channel *
@@ -1092,7 +1096,7 @@
 	return c;
 }
 
-static void
+static int
 server_input_channel_open(int type, u_int32_t seq, void *ctxt)
 {
 	Channel *c = NULL;
@@ -1142,9 +1146,10 @@
 		packet_send();
 	}
 	free(ctype);
+	return 0;
 }
 
-static void
+static int
 server_input_global_request(int type, u_int32_t seq, void *ctxt)
 {
 	char *rtype;
@@ -1239,9 +1244,10 @@
 		packet_write_wait();
 	}
 	free(rtype);
+	return 0;
 }
 
-static void
+static int
 server_input_channel_req(int type, u_int32_t seq, void *ctxt)
 {
 	Channel *c;
@@ -1271,6 +1277,7 @@
 		packet_send();
 	}
 	free(rtype);
+	return 0;
 }
 
 static void