Fix socket remote address for accepted sockets

This commit is contained in:
Thulinma 2022-04-29 10:48:24 +02:00
parent 9f0b86108d
commit 6cb734357a

View file

@ -519,7 +519,8 @@ void Socket::Connection::setBoundAddr(){
// Otherwise, read from socket pointer. Works for both SSL and non-SSL sockets, and real sockets passed as fd's, but not for non-sockets (duh)
uint32_t boundport = 0;
getSocketName(getSocket(), boundaddr, boundport);
getPeerName(getSocket(), remotehost, boundport);
socklen_t aLen = sizeof(remoteaddr);
getPeerName(getSocket(), remotehost, boundport, (sockaddr *)&remoteaddr, &aLen);
}
// Cleans up the socket by dropping the connection.