| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import atexit | 5 import atexit |
| 6 import datetime | 6 import datetime |
| 7 import email.utils | 7 import email.utils |
| 8 import hashlib | 8 import hashlib |
| 9 import logging | 9 import logging |
| 10 import math | 10 import math |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 (system-allocated) port. Returns the server address. | 131 (system-allocated) port. Returns the server address. |
| 132 """ | 132 """ |
| 133 assert path | 133 assert path |
| 134 httpd = _SilentTCPServer(('127.0.0.1', 0), _GetHandlerClassForPath(path)) | 134 httpd = _SilentTCPServer(('127.0.0.1', 0), _GetHandlerClassForPath(path)) |
| 135 atexit.register(httpd.shutdown) | 135 atexit.register(httpd.shutdown) |
| 136 | 136 |
| 137 http_thread = threading.Thread(target=httpd.serve_forever) | 137 http_thread = threading.Thread(target=httpd.serve_forever) |
| 138 http_thread.daemon = True | 138 http_thread.daemon = True |
| 139 http_thread.start() | 139 http_thread.start() |
| 140 return httpd.server_address | 140 return httpd.server_address |
| OLD | NEW |