changeset 4534:121999244123

hg serve: don't lookup user-supplied names/addresses
author Matt Mackall <mpm@selenic.com>
date Sun, 10 Jun 2007 19:16:20 -0500
parents 36abb07c79d4
children 720ae5085ee3
files mercurial/hgweb/server.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/server.py	Sat Jun 09 13:25:54 2007 +0200
+++ b/mercurial/hgweb/server.py	Sun Jun 10 19:16:20 2007 -0500
@@ -216,14 +216,10 @@
                 return hgwebobj
             self.reqmaker = wsgiapplication(make_handler)
 
-            addr, port = self.socket.getsockname()[:2]
-            if addr in ('0.0.0.0', '::'):
+            addr = address
+            if addr in ('', '::'):
                 addr = socket.gethostname()
-            else:
-                try:
-                    addr = socket.gethostbyaddr(addr)[0]
-                except socket.error:
-                    pass
+
             self.addr, self.port = addr, port
 
     class IPv6HTTPServer(MercurialHTTPServer):