HomePhabricator

net: use Sock in InterruptibleRecv() and Socks5()

Description

net: use Sock in InterruptibleRecv() and Socks5()

Summary:
Use the Sock class instead of SOCKET for InterruptibleRecv() and
Socks5().

This way the Socks5() function can be tested by giving it a mocked
instance of a socket.

Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>

Note: Apply the same changes to seeder/bitcoin.cpp

This is a backport of core#20788 [4/5]
https://github.com/bitcoin/bitcoin/pull/20788/commits/04ae8469049e1f14585aabfb618ae522150240a7

Depends on D11005

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11006

Details

Provenance
Vasil Dimov <vd@FreeBSD.org>Authored on Dec 28 2020, 15:57
PiRKCommitted on Feb 8 2022, 13:41
PiRKPushed on Feb 8 2022, 13:41
Reviewer
Restricted Project
Differential Revision
D11006: net: use Sock in InterruptibleRecv() and Socks5()
Parents
rABC5ef3fe294f9f: net: add RAII socket and use it instead of bare SOCKET, add Sock unit tests
Branches
Unknown
Tags
Unknown