Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/server.py @ 4130:178007785be8
web/server: disable address reuse option for BaseHTTPServer on windows
On windows, a socket with the SO_REUSEADDR option set is able to bind to
any port, even if there's already an active socket listening on it.
test-http: check server address cannot be reused.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 19 Feb 2007 10:08:59 +0100 |
parents | 3d7480ada3e5 |
children | 9dc64c8414ca bd46b83b9692 |
comparison
equal
deleted
inserted
replaced
4129:e817c68edfed | 4130:178007785be8 |
---|---|
195 else: | 195 else: |
196 class _mixin: | 196 class _mixin: |
197 pass | 197 pass |
198 | 198 |
199 class MercurialHTTPServer(object, _mixin, BaseHTTPServer.HTTPServer): | 199 class MercurialHTTPServer(object, _mixin, BaseHTTPServer.HTTPServer): |
200 | |
201 # SO_REUSEADDR has broken semantics on windows | |
202 if os.name == 'nt': | |
203 allow_reuse_address = 0 | |
204 | |
200 def __init__(self, *args, **kargs): | 205 def __init__(self, *args, **kargs): |
201 BaseHTTPServer.HTTPServer.__init__(self, *args, **kargs) | 206 BaseHTTPServer.HTTPServer.__init__(self, *args, **kargs) |
202 self.accesslog = accesslog | 207 self.accesslog = accesslog |
203 self.errorlog = errorlog | 208 self.errorlog = errorlog |
204 self.repo = repo | 209 self.repo = repo |