mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -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:
@ -1914,7 +1914,7 @@ static int share_listen_accepting(Plug *plug,
|
||||
plug, struct ssh_sharing_state, plug);
|
||||
struct ssh_sharing_connstate *cs;
|
||||
const char *err;
|
||||
char *peerinfo;
|
||||
SocketPeerInfo *peerinfo;
|
||||
|
||||
/*
|
||||
* A new downstream has connected to us.
|
||||
@ -1959,9 +1959,9 @@ static int share_listen_accepting(Plug *plug,
|
||||
|
||||
peerinfo = sk_peer_info(cs->sock);
|
||||
log_downstream(cs, "connected%s%s",
|
||||
peerinfo ? " from " : "", peerinfo ? peerinfo : "");
|
||||
|
||||
sfree(peerinfo);
|
||||
(peerinfo && peerinfo->log_text ? " from " : ""),
|
||||
(peerinfo && peerinfo->log_text ? peerinfo->log_text : ""));
|
||||
sk_free_peer_info(peerinfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user