Compare commits
2 Commits
a066bc6896
...
b49604a238
Author | SHA1 | Date |
---|---|---|
Yat Ho | b49604a238 | |
Yat Ho | 53e4c80459 |
|
@ -572,6 +572,13 @@ std::optional<unsigned> tr_address::to_interface_index() const noexcept
|
|||
|
||||
#ifdef _WIN32
|
||||
auto p_addresses = std::unique_ptr<void, void (*)(void*)>{ nullptr, operator delete };
|
||||
|
||||
// The recommended method of calling the GetAdaptersAddresses function is to
|
||||
// pre-allocate a 15KB working buffer pointed to by the AdapterAddresses parameter.
|
||||
// On typical computers, this dramatically reduces the chances that the
|
||||
// GetAdaptersAddresses function returns ERROR_BUFFER_OVERFLOW, which would require
|
||||
// calling GetAdaptersAddresses function multiple times.
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses
|
||||
for (auto p_addresses_size = ULONG{ 15000 } /* 15KB */;;)
|
||||
{
|
||||
p_addresses.reset(operator new(p_addresses_size, std::nothrow));
|
||||
|
|
|
@ -655,7 +655,7 @@ private:
|
|||
|
||||
std::string const cookie_ = makeCookie();
|
||||
Mediator& mediator_;
|
||||
std::array<tr_socket_t, NUM_TR_AF_INET_TYPES> mcast_sockets_ = { TR_BAD_SOCKET, TR_BAD_SOCKET }; /**multicast sockets */
|
||||
std::array<tr_socket_t, NUM_TR_AF_INET_TYPES> mcast_sockets_ = { TR_BAD_SOCKET, TR_BAD_SOCKET }; // multicast sockets
|
||||
std::array<libtransmission::evhelpers::event_unique_ptr, NUM_TR_AF_INET_TYPES> events_;
|
||||
|
||||
static auto constexpr MaxDatagramLength = size_t{ 1400 };
|
||||
|
|
Loading…
Reference in New Issue