forked from cory/tildefriends
Populate host and port for incoming SSB connections, too.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4457 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
e83e665db9
commit
85ac6c215a
@ -2670,6 +2670,14 @@ static void _tf_ssb_on_connection(uv_stream_t* stream, int status)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct sockaddr_storage addr = { 0 };
|
||||||
|
int size = sizeof(addr);
|
||||||
|
if (uv_tcp_getpeername(&connection->tcp, (struct sockaddr*)&addr, &size) == 0)
|
||||||
|
{
|
||||||
|
uv_ip_name((struct sockaddr*)&addr, connection->host, sizeof(connection->host));
|
||||||
|
connection->port = ntohs(((struct sockaddr_in*)&addr)->sin_port);
|
||||||
|
}
|
||||||
|
|
||||||
connection->next = ssb->connections;
|
connection->next = ssb->connections;
|
||||||
ssb->connections = connection;
|
ssb->connections = connection;
|
||||||
ssb->connections_count++;
|
ssb->connections_count++;
|
||||||
|
Loading…
Reference in New Issue
Block a user