forked from xmrig/xmrig
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
19 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* XMRig | ||
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <[email protected]> | ||
* Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2024 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 | ||
|
@@ -25,6 +25,8 @@ | |
#include "base/crypto/keccak.h" | ||
#include "base/io/Env.h" | ||
#include "base/io/json/Json.h" | ||
#include "base/io/log/Log.h" | ||
#include "base/io/log/Tags.h" | ||
#include "base/kernel/Base.h" | ||
#include "base/tools/Chrono.h" | ||
#include "base/tools/Cvt.h" | ||
|
@@ -39,7 +41,6 @@ | |
|
||
|
||
#include <thread> | ||
#include <iostream> | ||
|
||
|
||
namespace xmrig { | ||
|
@@ -81,8 +82,7 @@ static rapidjson::Value getResources(rapidjson::Document &doc) | |
|
||
xmrig::Api::Api(Base *base) : | ||
m_base(base), | ||
m_timestamp(Chrono::currentMSecsSinceEpoch()), | ||
m_httpd(nullptr) | ||
m_timestamp(Chrono::currentMSecsSinceEpoch()) | ||
{ | ||
base->addListener(this); | ||
|
||
|
@@ -118,7 +118,8 @@ void xmrig::Api::start() | |
if (!m_httpd) { | ||
m_httpd = new Httpd(m_base); | ||
if (!m_httpd->start()) { | ||
std::cerr << "HTTP server failed to start." << std::endl; | ||
LOG_ERR("%s " RED_BOLD("HTTP API server failed to start."), Tags::network()); | ||
|
||
delete m_httpd; // Properly handle failure to start | ||
m_httpd = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* XMRig | ||
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <[email protected]> | ||
* Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh> | ||
* Copyright (c) 2016-2024 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 | ||
|
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
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