mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
net: remove CloseSocket()
Do the closing in `Sock::Reset()` and remove the standalone `CloseSocket()`. This reduces the exposure of low-level sockets (i.e. integer file descriptors) outside of the `Sock` class.
This commit is contained in:
@@ -24,7 +24,7 @@ FuzzedSock::FuzzedSock(FuzzedDataProvider& fuzzed_data_provider)
|
||||
FuzzedSock::~FuzzedSock()
|
||||
{
|
||||
// Sock::~Sock() will be called after FuzzedSock::~FuzzedSock() and it will call
|
||||
// Sock::Reset() (not FuzzedSock::Reset()!) which will call CloseSocket(m_socket).
|
||||
// Sock::Reset() (not FuzzedSock::Reset()!) which will call close(m_socket).
|
||||
// Avoid closing an arbitrary file descriptor (m_socket is just a random very high number which
|
||||
// theoretically may concide with a real opened file descriptor).
|
||||
Reset();
|
||||
|
||||
Reference in New Issue
Block a user