diff cli-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 c216212001fc
children d59f628e7baa
line wrap: on
line diff
--- a/cli-session.c	Fri Sep 12 17:48:33 2008 +0000
+++ b/cli-session.c	Mon Sep 15 12:51:50 2008 +0000
@@ -74,13 +74,13 @@
 	NULL /* Null termination */
 };
 
-void cli_session(int sock, char* remotehost) {
+void cli_session(int sock_in, int sock_out, char* remotehost) {
 
 	seedrandom();
 
 	crypto_init();
 
-	common_session_init(sock, remotehost);
+	common_session_init(sock_in, sock_out, remotehost);
 
 	chaninitialise(cli_chantypes);
 
@@ -294,8 +294,10 @@
 
 	/* XXX TODO perhaps print a friendlier message if we get this but have
 	 * already sent/received disconnect message(s) ??? */
-	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_exit("remote closed the connection");
 }