forked from xmrig/xmrig-proxy
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge xmrig-proxy v6.19.2 into master
- Loading branch information
Showing
31 changed files
with
263 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* XMRig | ||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <[email protected]> | ||
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -16,7 +16,6 @@ | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#include "base/kernel/Platform.h" | ||
|
||
|
||
|
@@ -42,9 +41,12 @@ void xmrig::Platform::init(const char *userAgent) | |
# ifdef XMRIG_FEATURE_TLS | ||
SSL_library_init(); | ||
SSL_load_error_strings(); | ||
|
||
# if OPENSSL_VERSION_NUMBER < 0x30000000L || defined(LIBRESSL_VERSION_NUMBER) | ||
ERR_load_BIO_strings(); | ||
ERR_load_crypto_strings(); | ||
SSL_load_error_strings(); | ||
# endif | ||
|
||
OpenSSL_add_all_digests(); | ||
# endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* XMRig | ||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <[email protected]> | ||
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -46,11 +46,11 @@ xmrig::String xmrig::DnsRecord::ip() const | |
|
||
if (m_type == AAAA) { | ||
buf = new char[45](); | ||
uv_ip6_name(reinterpret_cast<sockaddr_in6*>(m_data), buf, 45); | ||
uv_ip6_name(reinterpret_cast<const sockaddr_in6*>(m_data), buf, 45); | ||
} | ||
else { | ||
buf = new char[16](); | ||
uv_ip4_name(reinterpret_cast<sockaddr_in*>(m_data), buf, 16); | ||
uv_ip4_name(reinterpret_cast<const sockaddr_in*>(m_data), buf, 16); | ||
} | ||
|
||
return buf; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* XMRig | ||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <[email protected]> | ||
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -28,18 +28,19 @@ | |
|
||
namespace xmrig { | ||
|
||
static Storage<DnsUvBackend>* storage = nullptr; | ||
|
||
Storage<DnsUvBackend>& DnsUvBackend::getStorage() | ||
static Storage<DnsUvBackend> *storage = nullptr; | ||
|
||
|
||
Storage<DnsUvBackend> &DnsUvBackend::getStorage() | ||
{ | ||
if (storage == nullptr) storage = new Storage<DnsUvBackend>(); | ||
if (storage == nullptr) { | ||
storage = new Storage<DnsUvBackend>(); | ||
} | ||
|
||
return *storage; | ||
} | ||
|
||
void DnsUvBackend::releaseStorage() | ||
{ | ||
delete storage; | ||
} | ||
|
||
static addrinfo hints{}; | ||
|
||
|
@@ -61,8 +62,14 @@ xmrig::DnsUvBackend::DnsUvBackend() | |
|
||
xmrig::DnsUvBackend::~DnsUvBackend() | ||
{ | ||
getStorage().release(m_key); | ||
releaseStorage(); | ||
assert(storage); | ||
|
||
storage->release(m_key); | ||
|
||
if (storage->isEmpty()) { | ||
delete storage; | ||
storage = nullptr; | ||
} | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.