mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
Pass the calling Socket to plug_log.
This enables plug_log to run query methods on the socket in order to find out useful information to log. I don't expect it's sensible to do anything else with it.
This commit is contained in:
@ -96,13 +96,15 @@ static void free_portlistener_state(struct PortListener *pl)
|
||||
sfree(pl);
|
||||
}
|
||||
|
||||
static void pfd_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
|
||||
static void pfd_log(Plug *plug, Socket *s, PlugLogType type,
|
||||
SockAddr *addr, int port,
|
||||
const char *error_msg, int error_code)
|
||||
{
|
||||
/* we have to dump these since we have no interface to logging.c */
|
||||
}
|
||||
|
||||
static void pfl_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
|
||||
static void pfl_log(Plug *plug, Socket *s, PlugLogType type,
|
||||
SockAddr *addr, int port,
|
||||
const char *error_msg, int error_code)
|
||||
{
|
||||
/* we have to dump these since we have no interface to logging.c */
|
||||
|
@ -138,8 +138,9 @@ static const SeatVtable server_seat_vt = {
|
||||
.get_cursor_position = nullseat_get_cursor_position,
|
||||
};
|
||||
|
||||
static void server_socket_log(Plug *plug, PlugLogType type, SockAddr *addr,
|
||||
int port, const char *error_msg, int error_code)
|
||||
static void server_socket_log(Plug *plug, Socket *s, PlugLogType type,
|
||||
SockAddr *addr, int port,
|
||||
const char *error_msg, int error_code)
|
||||
{
|
||||
/* server *srv = container_of(plug, server, plug); */
|
||||
/* FIXME */
|
||||
|
@ -371,8 +371,8 @@ bool sesschan_run_subsystem(Channel *chan, ptrlen subsys)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void fwd_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
|
||||
const char *error_msg, int error_code)
|
||||
static void fwd_log(Plug *plug, Socket *s, PlugLogType type, SockAddr *addr,
|
||||
int port, const char *error_msg, int error_code)
|
||||
{ /* don't expect any weirdnesses from a listening socket */ }
|
||||
static void fwd_closing(Plug *plug, PlugCloseType type, const char *error_msg)
|
||||
{ /* not here, either */ }
|
||||
|
@ -600,8 +600,9 @@ void ssh_sw_abort_deferred(Ssh *ssh, const char *fmt, ...)
|
||||
}
|
||||
}
|
||||
|
||||
static void ssh_socket_log(Plug *plug, PlugLogType type, SockAddr *addr,
|
||||
int port, const char *error_msg, int error_code)
|
||||
static void ssh_socket_log(Plug *plug, Socket *s, PlugLogType type,
|
||||
SockAddr *addr, int port,
|
||||
const char *error_msg, int error_code)
|
||||
{
|
||||
Ssh *ssh = container_of(plug, Ssh, plug);
|
||||
|
||||
@ -615,7 +616,7 @@ static void ssh_socket_log(Plug *plug, PlugLogType type, SockAddr *addr,
|
||||
*/
|
||||
|
||||
if (!ssh->attempting_connshare)
|
||||
backend_socket_log(ssh->seat, ssh->logctx, type, addr, port,
|
||||
backend_socket_log(ssh->seat, ssh->logctx, s, type, addr, port,
|
||||
error_msg, error_code, ssh->conf,
|
||||
ssh->session_started);
|
||||
}
|
||||
|
@ -318,8 +318,9 @@ static bool ssh2_userauth_signflags(struct ssh2_userauth_state *s,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void authplugin_plug_log(Plug *plug, PlugLogType type, SockAddr *addr,
|
||||
int port, const char *err_msg, int err_code)
|
||||
static void authplugin_plug_log(Plug *plug, Socket *sock, PlugLogType type,
|
||||
SockAddr *addr, int port,
|
||||
const char *err_msg, int err_code)
|
||||
{
|
||||
struct ssh2_userauth_state *s = container_of(
|
||||
plug, struct ssh2_userauth_state, authplugin_plug);
|
||||
|
@ -277,8 +277,8 @@ static char *x11_verify(unsigned long peer_ip, int peer_port,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void x11_log(Plug *p, PlugLogType type, SockAddr *addr, int port,
|
||||
const char *error_msg, int error_code)
|
||||
static void x11_log(Plug *p, Socket *s, PlugLogType type, SockAddr *addr,
|
||||
int port, const char *error_msg, int error_code)
|
||||
{
|
||||
/* We have no interface to the logging module here, so we drop these. */
|
||||
}
|
||||
|
Reference in New Issue
Block a user