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

Make the plug_log type code into an enum.

Those magic numbers have been annoying for ages. Now they have names
that I havea fighting chance of remembering the meanings of.
This commit is contained in:
Simon Tatham
2020-02-07 19:17:45 +00:00
parent 06531c3b61
commit 91bb475087
17 changed files with 59 additions and 46 deletions

View File

@ -908,7 +908,8 @@ static DWORD try_connect(NetSocket *sock)
{
SockAddr thisaddr = sk_extractaddr_tmp(
sock->addr, &sock->step);
plug_log(sock->plug, 0, &thisaddr, sock->port, NULL, 0);
plug_log(sock->plug, PLUGLOG_CONNECT_TRYING,
&thisaddr, sock->port, NULL, 0);
}
/*
@ -1081,7 +1082,8 @@ static DWORD try_connect(NetSocket *sock)
if (err) {
SockAddr thisaddr = sk_extractaddr_tmp(
sock->addr, &sock->step);
plug_log(sock->plug, 1, &thisaddr, sock->port, sock->error, err);
plug_log(sock->plug, PLUGLOG_CONNECT_FAILED,
&thisaddr, sock->port, sock->error, err);
}
return err;
}
@ -1527,7 +1529,7 @@ void select_result(WPARAM wParam, LPARAM lParam)
if (s->addr) {
SockAddr thisaddr = sk_extractaddr_tmp(
s->addr, &s->step);
plug_log(s->plug, 1, &thisaddr, s->port,
plug_log(s->plug, PLUGLOG_CONNECT_FAILED, &thisaddr, s->port,
winsock_error_string(err), err);
while (err && s->addr && sk_nextaddr(s->addr, &s->step)) {
err = try_connect(s);

View File

@ -35,7 +35,7 @@ Socket *platform_new_connection(SockAddr *addr, const char *hostname,
{
char *msg = dupprintf("Starting local proxy command: %s", cmd);
plug_log(plug, 2, NULL, 0, msg, 0);
plug_log(plug, PLUGLOG_PROXY_MSG, NULL, 0, msg, 0);
sfree(msg);
}