1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -05:00

Option to log proxy setup diagnostics to the terminal.

It has three settings: on, off, and 'only until session starts'. The
idea of the last one is that if you use something like 'ssh -v' as
your proxy command, you probably wanted to see the initial SSH
connection-setup messages while you were waiting to see if the
connection would be set up successfully at all, but probably _didn't_
want a slew of diagnostics from rekeys disrupting your terminal in
mid-emacs once the session had got properly under way.

Default is off, to avoid startling people used to the old behaviour. I
wonder if I should have set it more aggressively, though.
This commit is contained in:
Simon Tatham
2015-11-22 14:33:28 +00:00
parent 297efff303
commit 7c65b9c57a
10 changed files with 63 additions and 11 deletions

12
raw.c
View File

@ -25,7 +25,9 @@ typedef struct raw_backend_data {
int closed_on_socket_error;
int bufsize;
void *frontend;
int sent_console_eof, sent_socket_eof;
int sent_console_eof, sent_socket_eof, session_started;
Conf *conf;
} *Raw;
static void raw_size(void *handle, int width, int height);
@ -41,7 +43,7 @@ static void raw_log(Plug plug, int type, SockAddr addr, int port,
{
Raw raw = (Raw) plug;
backend_socket_log(raw->frontend, type, addr, port,
error_msg, error_code);
error_msg, error_code, raw->conf, raw->session_started);
}
static void raw_check_close(Raw raw)
@ -97,6 +99,9 @@ static int raw_receive(Plug plug, int urgent, char *data, int len)
{
Raw raw = (Raw) plug;
c_write(raw, data, len);
/* We count 'session start', for proxy logging purposes, as being
* when data is received from the network and printed. */
raw->session_started = TRUE;
return 1;
}
@ -138,6 +143,8 @@ static const char *raw_init(void *frontend_handle, void **backend_handle,
*backend_handle = raw;
raw->sent_console_eof = raw->sent_socket_eof = FALSE;
raw->bufsize = 0;
raw->session_started = FALSE;
raw->conf = conf_copy(conf);
raw->frontend = frontend_handle;
@ -184,6 +191,7 @@ static void raw_free(void *handle)
if (raw->s)
sk_close(raw->s);
conf_free(raw->conf);
sfree(raw);
}