1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -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:
Simon Tatham
2024-06-26 08:29:39 +01:00
parent 23b15dbc77
commit c1d9da67a2
27 changed files with 94 additions and 80 deletions

View File

@ -36,12 +36,13 @@ static void c_write(Raw *raw, const void *buf, size_t len)
sk_set_frozen(raw->s, backlog > RAW_MAX_BACKLOG);
}
static void raw_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
const char *error_msg, int error_code)
static void raw_log(Plug *plug, Socket *s, PlugLogType type, SockAddr *addr,
int port, const char *error_msg, int error_code)
{
Raw *raw = container_of(plug, Raw, plug);
backend_socket_log(raw->seat, raw->logctx, type, addr, port, error_msg,
error_code, raw->conf, raw->socket_connected);
backend_socket_log(raw->seat, raw->logctx, s, type, addr, port,
error_msg, error_code, raw->conf,
raw->socket_connected);
if (type == PLUGLOG_CONNECT_SUCCESS) {
raw->socket_connected = true;
if (raw->ldisc)

View File

@ -45,11 +45,11 @@ static void c_write(Rlogin *rlogin, const void *buf, size_t len)
sk_set_frozen(rlogin->s, backlog > RLOGIN_MAX_BACKLOG);
}
static void rlogin_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
const char *error_msg, int error_code)
static void rlogin_log(Plug *plug, Socket *s, PlugLogType type, SockAddr *addr,
int port, const char *error_msg, int error_code)
{
Rlogin *rlogin = container_of(plug, Rlogin, plug);
backend_socket_log(rlogin->seat, rlogin->logctx, type, addr, port,
backend_socket_log(rlogin->seat, rlogin->logctx, s, type, addr, port,
error_msg, error_code,
rlogin->conf, rlogin->socket_connected);
if (type == PLUGLOG_CONNECT_SUCCESS) {

View File

@ -559,11 +559,11 @@ static void do_supdup_read(Supdup *supdup, const char *buf, size_t len)
strbuf_free(outbuf);
}
static void supdup_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
const char *error_msg, int error_code)
static void supdup_log(Plug *plug, Socket *s, PlugLogType type, SockAddr *addr,
int port, const char *error_msg, int error_code)
{
Supdup *supdup = container_of(plug, Supdup, plug);
backend_socket_log(supdup->seat, supdup->logctx, type, addr, port,
backend_socket_log(supdup->seat, supdup->logctx, s, type, addr, port,
error_msg, error_code,
supdup->conf, supdup->socket_connected);
if (type == PLUGLOG_CONNECT_SUCCESS) {

View File

@ -604,11 +604,11 @@ static void do_telnet_read(Telnet *telnet, const char *buf, size_t len)
strbuf_free(outbuf);
}
static void telnet_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
const char *error_msg, int error_code)
static void telnet_log(Plug *plug, Socket *s, PlugLogType type, SockAddr *addr,
int port, const char *error_msg, int error_code)
{
Telnet *telnet = container_of(plug, Telnet, plug);
backend_socket_log(telnet->seat, telnet->logctx, type, addr, port,
backend_socket_log(telnet->seat, telnet->logctx, s, type, addr, port,
error_msg, error_code, telnet->conf,
telnet->socket_connected);
if (type == PLUGLOG_CONNECT_SUCCESS) {