Fix socket remote address for accepted sockets
This commit is contained in:
parent
9f0b86108d
commit
6cb734357a
1 changed files with 2 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue