mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[3.14] gh-127319: Disable port reuse on HTTP, XMLRPC, and logging TCP servers (GH-135405) (GH-135538)
(cherry picked from commit 2bd3895fca)
This commit is contained in:
parent
e89c7f1fc0
commit
43bf8b30f9
5 changed files with 7 additions and 4 deletions
|
|
@ -137,7 +137,7 @@
|
|||
class HTTPServer(socketserver.TCPServer):
|
||||
|
||||
allow_reuse_address = True # Seems to make sense in testing environment
|
||||
allow_reuse_port = True
|
||||
allow_reuse_port = False
|
||||
|
||||
def server_bind(self):
|
||||
"""Override server_bind to store the server name."""
|
||||
|
|
|
|||
|
|
@ -1018,7 +1018,7 @@ class ConfigSocketReceiver(ThreadingTCPServer):
|
|||
"""
|
||||
|
||||
allow_reuse_address = True
|
||||
allow_reuse_port = True
|
||||
allow_reuse_port = False
|
||||
|
||||
def __init__(self, host='localhost', port=DEFAULT_LOGGING_CONFIG_PORT,
|
||||
handler=None, ready=None, verify=None):
|
||||
|
|
|
|||
|
|
@ -1036,7 +1036,7 @@ class TestTCPServer(ControlMixin, ThreadingTCPServer):
|
|||
"""
|
||||
|
||||
allow_reuse_address = True
|
||||
allow_reuse_port = True
|
||||
allow_reuse_port = False
|
||||
|
||||
def __init__(self, addr, handler, poll_interval=0.5,
|
||||
bind_and_activate=True):
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@ class SimpleXMLRPCServer(socketserver.TCPServer,
|
|||
"""
|
||||
|
||||
allow_reuse_address = True
|
||||
allow_reuse_port = True
|
||||
allow_reuse_port = False
|
||||
|
||||
# Warning: this is for debugging purposes only! Never set this to True in
|
||||
# production code, as will be sending out sensitive information (exception
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
Set the ``allow_reuse_port`` class variable to ``False`` on the XMLRPC,
|
||||
logging, and HTTP servers. This matches the behavior in prior Python
|
||||
releases, which is to not allow port reuse.
|
||||
Loading…
Add table
Add a link
Reference in a new issue