diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2020-12-28 16:57:10 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-02-10 13:30:08 +0100 |
commit | 04ae8469049e1f14585aabfb618ae522150240a7 (patch) | |
tree | 80472dda64d7565ea923d84a9f11b60e243609d6 /src/netbase.h | |
parent | ba9d73268f9585d4b9254adcf54708f88222798b (diff) |
net: use Sock in InterruptibleRecv() and Socks5()
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>
Diffstat (limited to 'src/netbase.h')
-rw-r--r-- | src/netbase.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/netbase.h b/src/netbase.h index d906888235..9ad9a864d8 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -68,7 +68,7 @@ std::unique_ptr<Sock> CreateSockTCP(const CService& address_family); extern std::function<std::unique_ptr<Sock>(const CService&)> CreateSock; bool ConnectSocketDirectly(const CService &addrConnect, const SOCKET& hSocketRet, int nTimeout, bool manual_connection); -bool ConnectThroughProxy(const proxyType &proxy, const std::string& strDest, int port, const SOCKET& hSocketRet, int nTimeout, bool& outProxyConnectionFailed); +bool ConnectThroughProxy(const proxyType& proxy, const std::string& strDest, int port, const Sock& hSocketRet, int nTimeout, bool& outProxyConnectionFailed); /** Disable or enable blocking-mode for a socket */ bool SetSocketNonBlocking(const SOCKET& hSocket, bool fNonBlocking); /** Set the TCP_NODELAY flag on a socket */ |