mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
Match socket testing behavior to ACME standalone socket reuse behavior. Aggressively reuse ports, ignoring TIME_WAIT. (#3631)
This commit is contained in:
parent
47e129ddd8
commit
77ed0c35ea
1 changed files with 2 additions and 2 deletions
|
|
@ -91,6 +91,7 @@ def already_listening_socket(port, renewer=False):
|
|||
|
||||
try:
|
||||
testsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
|
||||
testsocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
try:
|
||||
testsocket.bind(("", port))
|
||||
except socket.error:
|
||||
|
|
@ -129,8 +130,7 @@ def already_listening_psutil(port, renewer=False):
|
|||
return False
|
||||
|
||||
listeners = [conn.pid for conn in net_connections
|
||||
if (conn.status == 'LISTEN' or
|
||||
conn.status == 'TIME_WAIT') and
|
||||
if conn.status == 'LISTEN' and
|
||||
conn.type == socket.SOCK_STREAM and
|
||||
conn.laddr[1] == port]
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue