From b619e88f5481649a480e133494caf27f8880437a Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 15 Sep 2008 12:51:50 +0000 Subject: - Split main socket var into ses.sock_in/ses.sock_out in preparation for -J proxy_cmd option (and some prelim options for that) --HG-- extra : convert_revision : 47cdea9a7d66c553c6f5eec43b899821939d4e4c --- svr-session.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'svr-session.c') diff --git a/svr-session.c b/svr-session.c index 5a8364a..658bc6e 100644 --- a/svr-session.c +++ b/svr-session.c @@ -80,7 +80,7 @@ void svr_session(int sock, int childpipe, 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 @@ void svr_dropbear_log(int priority, const char* format, va_list param) { localtime(×ec)) == 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 @@ void svr_dropbear_log(int priority, const char* format, va_list param) { /* 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"); } -- cgit v1.2.3