summaryrefslogtreecommitdiffhomepage
path: root/svr-session.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2008-09-15 12:51:50 +0000
committerMatt Johnston <matt@ucc.asn.au>2008-09-15 12:51:50 +0000
commitb619e88f5481649a480e133494caf27f8880437a (patch)
treed8410822e892282abc5cdcd804db031285fe613c /svr-session.c
parent460bf4382257a262fda862f66d6fe97c749f5bb7 (diff)
- 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
Diffstat (limited to 'svr-session.c')
-rw-r--r--svr-session.c10
1 files changed, 6 insertions, 4 deletions
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(&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 @@ 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");
}