From e63bd7b843b8a635e9e50880870f68d324ddd1e6 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Thu, 11 Feb 2010 19:57:02 -0500 Subject: [PATCH] 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. --- gunicorn/sock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/sock.py b/gunicorn/sock.py index 77054193..5fb68ea3 100644 --- a/gunicorn/sock.py +++ b/gunicorn/sock.py @@ -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"):