Mercurial > dropbear
comparison 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 |
comparison
equal
deleted
inserted
replaced
477:657c045054ab | 479:e3db1f7a2e43 |
---|---|
78 char* remotehost, char *addrstring) { | 78 char* remotehost, char *addrstring) { |
79 | 79 |
80 reseedrandom(); | 80 reseedrandom(); |
81 | 81 |
82 crypto_init(); | 82 crypto_init(); |
83 common_session_init(sock, remotehost); | 83 common_session_init(sock, sock, remotehost); |
84 | 84 |
85 /* Initialise server specific parts of the session */ | 85 /* Initialise server specific parts of the session */ |
86 svr_ses.childpipe = childpipe; | 86 svr_ses.childpipe = childpipe; |
87 svr_ses.addrstring = addrstring; | 87 svr_ses.addrstring = addrstring; |
88 svr_authinitialise(); | 88 svr_authinitialise(); |
181 if (local_tm == NULL | 181 if (local_tm == NULL |
182 || strftime(datestr, sizeof(datestr), "%b %d %H:%M:%S", | 182 || strftime(datestr, sizeof(datestr), "%b %d %H:%M:%S", |
183 localtime(×ec)) == 0) | 183 localtime(×ec)) == 0) |
184 { | 184 { |
185 /* upon failure, just print the epoch-seconds time. */ | 185 /* upon failure, just print the epoch-seconds time. */ |
186 snprintf(datestr, sizeof(datestr), "%d", timesec); | 186 snprintf(datestr, sizeof(datestr), "%d", (int)timesec); |
187 } | 187 } |
188 fprintf(stderr, "[%d] %s %s\n", getpid(), datestr, printbuf); | 188 fprintf(stderr, "[%d] %s %s\n", getpid(), datestr, printbuf); |
189 } | 189 } |
190 } | 190 } |
191 | 191 |
192 /* called when the remote side closes the connection */ | 192 /* called when the remote side closes the connection */ |
193 static void svr_remoteclosed() { | 193 static void svr_remoteclosed() { |
194 | 194 |
195 close(ses.sock); | 195 m_close(ses.sock_in); |
196 ses.sock = -1; | 196 m_close(ses.sock_out); |
197 ses.sock_in = -1; | |
198 ses.sock_out = -1; | |
197 dropbear_close("Exited normally"); | 199 dropbear_close("Exited normally"); |
198 | 200 |
199 } | 201 } |
200 | 202 |