mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-24 07:28:02 +01:00
Merge bitcoin/bitcoin#31239: test: clarify log messages when handling SOCKS5 proxy connections
99d9a093cf
test: clarify log messages when handling SOCKS5 proxy connections (Vasil Dimov) Pull request description: Clarify log messages when handling SOCKS5 proxy connections. Suggested in https://github.com/bitcoin/bitcoin/pull/29420#discussion_r1815521913 ACKs for top commit: mzumsande: Code Review ACK99d9a093cf
tdb3: code review ACK99d9a093cf
Tree-SHA512: 06bc0e63fbc9fdd8144a161d65d02e6c99565960064e65782b9b4b2fdfdf18539a1cd9513e17a911eef1506525e411e8422b7b805ce4c2392fcca6620112e172
This commit is contained in:
commit
7a52665302
1 changed files with 4 additions and 2 deletions
|
@ -183,9 +183,9 @@ class Socks5Connection():
|
||||||
with socket.create_connection((dest["actual_to_addr"], dest["actual_to_port"])) as conn_to:
|
with socket.create_connection((dest["actual_to_addr"], dest["actual_to_port"])) as conn_to:
|
||||||
forward_sockets(self.conn, conn_to)
|
forward_sockets(self.conn, conn_to)
|
||||||
else:
|
else:
|
||||||
logger.debug(f"Closing connection to {requested_to}: the destinations factory returned None")
|
logger.debug(f"Can't serve the connection to {requested_to}: the destinations factory returned None")
|
||||||
else:
|
else:
|
||||||
logger.debug(f"Closing connection to {requested_to}: no destinations factory")
|
logger.debug(f"Can't serve the connection to {requested_to}: no destinations factory")
|
||||||
|
|
||||||
# Fall through to disconnect
|
# Fall through to disconnect
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -194,6 +194,8 @@ class Socks5Connection():
|
||||||
finally:
|
finally:
|
||||||
if not self.serv.keep_alive:
|
if not self.serv.keep_alive:
|
||||||
self.conn.close()
|
self.conn.close()
|
||||||
|
else:
|
||||||
|
logger.debug(f"Keeping client connection alive")
|
||||||
|
|
||||||
class Socks5Server():
|
class Socks5Server():
|
||||||
def __init__(self, conf):
|
def __init__(self, conf):
|
||||||
|
|
Loading…
Add table
Reference in a new issue