# HG changeset patch # User Matt Mackall # Date 1181520980 18000 # Node ID 121999244123cdb8723b28c7777cfe2a771df03f # Parent 36abb07c79d4ea808f2145f9a4d3e13ade9296be hg serve: don't lookup user-supplied names/addresses diff -r 36abb07c79d4 -r 121999244123 mercurial/hgweb/server.py --- 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):