mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 19:42:48 -05:00
Log when a network connection succeeds.
Now I've got an enum for PlugLogType, it's easier to add things to it. We were giving a blow-by-blow account of each connection attempt, and when it failed, saying what went wrong before we moved on to the next candidate address, but when one finally succeeded, we never logged _that_. Now we do.
This commit is contained in:
11
unix/uxnet.c
11
unix/uxnet.c
@ -733,6 +733,10 @@ static int try_connect(NetSocket *sock)
|
||||
*/
|
||||
sock->connected = true;
|
||||
sock->writable = true;
|
||||
|
||||
SockAddr thisaddr = sk_extractaddr_tmp(sock->addr, &sock->step);
|
||||
plug_log(sock->plug, PLUGLOG_CONNECT_SUCCESS,
|
||||
&thisaddr, sock->port, NULL, 0);
|
||||
}
|
||||
|
||||
uxsel_tell(sock);
|
||||
@ -1435,6 +1439,13 @@ static void net_select_result(int fd, int event)
|
||||
}
|
||||
if (!s->connected)
|
||||
return; /* another async attempt in progress */
|
||||
} else {
|
||||
/*
|
||||
* The connection attempt succeeded.
|
||||
*/
|
||||
SockAddr thisaddr = sk_extractaddr_tmp(s->addr, &s->step);
|
||||
plug_log(s->plug, PLUGLOG_CONNECT_SUCCESS,
|
||||
&thisaddr, s->port, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user