mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-07-06 04:01:13 +02:00
9a8ef9b0a3test: SOCKS5 proxy: expect that connection may be reset during handshake (Vasil Dimov)eb3208364atest: SOCKS5 proxy: expect that connection may be reset when forwarding (Vasil Dimov) Pull request description: The `forward_sockets()` function used by the SOCKS5 proxy forwards data between two connected sockets. It might happen that one of those sockets gets closed/reset abruptly, without sending EOF first. This is to be expected if e.g. `bitcoind` is shutdown and shouldn't result in noisy harmless messages like: ``` 2026-06-03T13:23:56.966859Z TestFramework.socks5 (ERROR): socks5 request handling failed (running True) Traceback (most recent call last): File ".../socks5.py", line 199, in handle forward_sockets(self.conn, conn_to, self.wakeup_socket_pair[1], self.serv) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".../socks5.py", line 76, in forward_sockets data = s.recv(4096) ConnectionResetError: [Errno 104] Connection reset by peer ``` Instead turn this into a debug log message with a nice prefix containing enough information to identify the two forwarded sockets. --- Also expect that the connection might be closed during the SOCKS5 handshake and only log a debug message if that happens. ACKs for top commit: optout21: crACK9a8ef9b0a3danielabrozzoni: reACK9a8ef9b0a3sedited: ACK9a8ef9b0a3Tree-SHA512: 24e25a30529eda3536ebf472f63a93fd80fff46273054a7075490c88737f8870c0141b2bc99d9ef39e6b4f592af2801350fdfbc71927f573738b4a14f5fd7ce0