From ace50b182f318b96a87505aa3d6b509959d49544 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 7 Sep 2007 20:27:47 +0000 Subject: The Bu::Socket::getAddress function was always getting the local name of the socket, i.e. your address, not the client's address. That's not what I had intended, but it'd be nice to have later. This is corrected now. --- src/socket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/socket.cpp b/src/socket.cpp index ce4ee82..94b4d60 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -304,7 +304,8 @@ void Bu::Socket::setAddress() struct sockaddr_in addr; socklen_t len = sizeof(addr); addr.sin_family = AF_INET; - getsockname( nSocket, (sockaddr *)(&addr), &len ); + // getsockname( nSocket, (sockaddr *)(&addr), &len ); + getpeername( nSocket, (sockaddr *)(&addr), &len ); char buf[150]; sprintf( buf, "%s", inet_ntoa( addr.sin_addr ) ); sAddress = buf; -- cgit v1.2.3