Give clients more accurate names
This commit is contained in:
parent
0c526125c9
commit
3a7c4e0e28
|
@ -440,7 +440,9 @@ static int _tcp_server_add_client(TCP * tcp, TCPSocket * client)
|
|||
tcp->u.server.clients = p;
|
||||
/* XXX may not be instant */
|
||||
if(getnameinfo(client->sa, client->sa_len, host, sizeof(host), NULL, 0,
|
||||
0) != 0)
|
||||
NI_NAMEREQD) != 0
|
||||
&& getnameinfo(client->sa, client->sa_len, host,
|
||||
sizeof(host), NULL, 0, NI_NUMERICHOST) != 0)
|
||||
name = NULL;
|
||||
if((client->client = tcp->helper->client_new(tcp->helper->transport,
|
||||
name)) == NULL)
|
||||
|
|
|
@ -403,7 +403,10 @@ static int _udp_client_init(UDPClient * client, struct sockaddr * sa,
|
|||
return -1;
|
||||
/* XXX may not be instant */
|
||||
if(getnameinfo(client->sa, client->sa_len, host, sizeof(host), NULL, 0,
|
||||
NI_DGRAM) != 0)
|
||||
NI_NAMEREQD | NI_DGRAM) != 0
|
||||
&& getnameinfo(client->sa, client->sa_len, host,
|
||||
sizeof(host), NULL, 0,
|
||||
NI_NUMERICHOST | NI_DGRAM) != 0)
|
||||
name = NULL;
|
||||
if((client->client = helper->client_new(helper->transport, name))
|
||||
== NULL)
|
||||
|
|
Loading…
Reference in New Issue
Block a user