Mercurial > dropbear
comparison 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 |
comparison
equal
deleted
inserted
replaced
477:657c045054ab | 479:e3db1f7a2e43 |
---|---|
72 &cli_chan_tcpremote, | 72 &cli_chan_tcpremote, |
73 #endif | 73 #endif |
74 NULL /* Null termination */ | 74 NULL /* Null termination */ |
75 }; | 75 }; |
76 | 76 |
77 void cli_session(int sock, char* remotehost) { | 77 void cli_session(int sock_in, int sock_out, char* remotehost) { |
78 | 78 |
79 seedrandom(); | 79 seedrandom(); |
80 | 80 |
81 crypto_init(); | 81 crypto_init(); |
82 | 82 |
83 common_session_init(sock, remotehost); | 83 common_session_init(sock_in, sock_out, remotehost); |
84 | 84 |
85 chaninitialise(cli_chantypes); | 85 chaninitialise(cli_chantypes); |
86 | 86 |
87 /* Set up cli_ses vars */ | 87 /* Set up cli_ses vars */ |
88 cli_session_init(); | 88 cli_session_init(); |
292 /* called when the remote side closes the connection */ | 292 /* called when the remote side closes the connection */ |
293 static void cli_remoteclosed() { | 293 static void cli_remoteclosed() { |
294 | 294 |
295 /* XXX TODO perhaps print a friendlier message if we get this but have | 295 /* XXX TODO perhaps print a friendlier message if we get this but have |
296 * already sent/received disconnect message(s) ??? */ | 296 * already sent/received disconnect message(s) ??? */ |
297 close(ses.sock); | 297 m_close(ses.sock_in); |
298 ses.sock = -1; | 298 m_close(ses.sock_out); |
299 ses.sock_in = -1; | |
300 ses.sock_out = -1; | |
299 dropbear_exit("remote closed the connection"); | 301 dropbear_exit("remote closed the connection"); |
300 } | 302 } |
301 | 303 |
302 /* Operates in-place turning dirty (untrusted potentially containing control | 304 /* Operates in-place turning dirty (untrusted potentially containing control |
303 * characters) text into clean text. | 305 * characters) text into clean text. |