1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-14 17:47:33 -05:00

Improve sk_peer_info.

Previously, it returned a human-readable string suitable for log
files, which tried to say something useful about the remote end of a
socket. Now it returns a whole SocketPeerInfo structure, of which that
human-friendly log string is just one field, but also some of the same
information - remote IP address and port, in particular - is provided
in machine-readable form where it's available.
This commit is contained in:
Simon Tatham
2018-10-18 20:06:42 +01:00
parent 1bde686945
commit 82c83c1894
16 changed files with 161 additions and 61 deletions

9
misc.c
View File

@ -1416,3 +1416,12 @@ const char *nullseat_get_x_display(Seat *seat) { return NULL; }
int nullseat_get_windowid(Seat *seat, long *id_out) { return FALSE; }
int nullseat_get_window_pixel_size(
Seat *seat, int *width, int *height) { return FALSE; }
void sk_free_peer_info(SocketPeerInfo *pi)
{
if (pi) {
sfree((char *)pi->addr_text);
sfree((char *)pi->log_text);
sfree(pi);
}
}