mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-17 11:00:59 -05:00
sshproxy: share the caller's LogPolicy.
Now new_connection() takes an optional LogPolicy * argument, and passes it on to the SshProxy setup. This means that SshProxy's implementation of the LogPolicy trait can answer queries like askappend() and logging_error() by passing them on to the same LogPolicy used by the main backend. Not all callers of new_connection have a LogPolicy, so we still have to fall back to the previous conservative default behaviour if SshProxy doesn't have a LogPolicy it can ask. The main backend implementations didn't _quite_ have access to a LogPolicy already, but they do have a LogContext, which has a LogPolicy vtable pointer inside it; so I've added a query function log_get_policy() which allows them to extract that pointer to pass to new_connection. This is the first step of fixing the non-interactivity limitations of SshProxy. But it's also the easiest step: the next ones will be more involved.
This commit is contained in:
@ -564,7 +564,7 @@ static size_t x11_send(
|
||||
xconn->s = new_connection(sk_addr_dup(xconn->disp->addr),
|
||||
xconn->disp->realhost, xconn->disp->port,
|
||||
false, true, false, false, &xconn->plug,
|
||||
sshfwd_get_conf(xconn->c));
|
||||
sshfwd_get_conf(xconn->c), NULL);
|
||||
if ((err = sk_socket_error(xconn->s)) != NULL) {
|
||||
char *err_message = dupprintf("unable to connect to"
|
||||
" forwarded X server: %s", err);
|
||||
|
Reference in New Issue
Block a user