Bug #1531963: Make SocketServer.TCPServer's server_address always be equal to calling getsockname() on the server's socket. Fixed by patch #1545011.
Backported from r54253.
This commit is contained in:
parent
8bf469ddc1
commit
86d8d3520d
|
@ -339,6 +339,7 @@ class TCPServer(BaseServer):
|
||||||
if self.allow_reuse_address:
|
if self.allow_reuse_address:
|
||||||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||||
self.socket.bind(self.server_address)
|
self.socket.bind(self.server_address)
|
||||||
|
self.server_address = self.socket.getsockname()
|
||||||
|
|
||||||
def server_activate(self):
|
def server_activate(self):
|
||||||
"""Called by constructor to activate the server.
|
"""Called by constructor to activate the server.
|
||||||
|
|
|
@ -84,6 +84,7 @@ class ServerThread(threading.Thread):
|
||||||
addr = getattr(svr, 'server_address')
|
addr = getattr(svr, 'server_address')
|
||||||
if addr:
|
if addr:
|
||||||
self.__addr = addr
|
self.__addr = addr
|
||||||
|
assert self.__addr == svr.socket.getsockname()
|
||||||
if verbose: print "thread: serving three times"
|
if verbose: print "thread: serving three times"
|
||||||
svr.serve_a_few()
|
svr.serve_a_few()
|
||||||
if verbose: print "thread: done"
|
if verbose: print "thread: done"
|
||||||
|
|
|
@ -196,6 +196,11 @@ Extension Modules
|
||||||
|
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Bug #1531963: Make SocketServer.TCPServer's server_address always
|
||||||
|
be equal to calling getsockname() on the server's socket. Fixed by patch
|
||||||
|
#1545011.
|
||||||
|
|
||||||
- Bug #1651235: When a tuple was passed to a ctypes function call,
|
- Bug #1651235: When a tuple was passed to a ctypes function call,
|
||||||
Python would crash instead of raising an error.
|
Python would crash instead of raising an error.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue