Use getsockname for logging TCP socket info.

When a user wants the kernel to choose a random port we need to display
which port was chosen.
This commit is contained in:
Paul J. Davis 2010-02-11 19:57:02 -05:00 committed by Benoit Chesneau
parent 61b31994d1
commit e63bd7b843

View File

@ -38,7 +38,7 @@ class TCPSocket(BaseSocket):
FAMILY = socket.AF_INET
def __str__(self):
return "http://%s:%d" % self.address
return "http://%s:%d" % self.sock.getsockname()
def set_options(self, sock, bound=False):
if hasattr(socket, "TCP_CORK"):