diff svr-session.c @ 479:e3db1f7a2e43

- Split main socket var into ses.sock_in/ses.sock_out in preparation for -J proxy_cmd option (and some prelim options for that)
author Matt Johnston <matt@ucc.asn.au>
date Mon, 15 Sep 2008 12:51:50 +0000
parents 4317be8b7cf9
children 9f583f4d59a6
line wrap: on
line diff
--- a/svr-session.c	Fri Sep 12 17:48:33 2008 +0000
+++ b/svr-session.c	Mon Sep 15 12:51:50 2008 +0000
@@ -80,7 +80,7 @@
     reseedrandom();
 
 	crypto_init();
-	common_session_init(sock, remotehost);
+	common_session_init(sock, sock, remotehost);
 
 	/* Initialise server specific parts of the session */
 	svr_ses.childpipe = childpipe;
@@ -183,7 +183,7 @@
 						localtime(&timesec)) == 0)
 		{
 			/* upon failure, just print the epoch-seconds time. */
-			snprintf(datestr, sizeof(datestr), "%d", timesec);
+			snprintf(datestr, sizeof(datestr), "%d", (int)timesec);
 		}
 		fprintf(stderr, "[%d] %s %s\n", getpid(), datestr, printbuf);
 	}
@@ -192,8 +192,10 @@
 /* called when the remote side closes the connection */
 static void svr_remoteclosed() {
 
-	close(ses.sock);
-	ses.sock = -1;
+	m_close(ses.sock_in);
+	m_close(ses.sock_out);
+	ses.sock_in = -1;
+	ses.sock_out = -1;
 	dropbear_close("Exited normally");
 
 }