HTTP subsystem refactoring, fixed possible crashes shortly after destroying daemon or self-select client.
This commit is contained in:
parent
23c51c9a11
commit
1ee27a564b
16 changed files with 129 additions and 58 deletions
|
@ -63,7 +63,8 @@ static const char * const required_fields[] = { kBlocktemplateBlob, kBlockhashin
|
|||
xmrig::SelfSelectClient::SelfSelectClient(int id, const char *agent, IClientListener *listener) :
|
||||
m_listener(listener)
|
||||
{
|
||||
m_client = new Client(id, agent, this);
|
||||
m_httpListener = std::make_shared<HttpListener>(this);
|
||||
m_client = new Client(id, agent, this);
|
||||
}
|
||||
|
||||
|
||||
|
@ -181,12 +182,12 @@ void xmrig::SelfSelectClient::send(int method, const char *url, const char *data
|
|||
HttpClient *client;
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
if (pool().daemon().isTLS()) {
|
||||
client = new HttpsClient(method, url, this, data, size, String());
|
||||
client = new HttpsClient(method, url, m_httpListener, data, size, String());
|
||||
}
|
||||
else
|
||||
# endif
|
||||
{
|
||||
client = new HttpClient(method, url, this, data, size);
|
||||
client = new HttpClient(method, url, m_httpListener, data, size);
|
||||
}
|
||||
|
||||
client->setQuiet(isQuiet());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue