Sync changes.

This commit is contained in:
XMRig 2018-08-31 18:01:15 +03:00
parent f7b029eb05
commit 57479cef8c
7 changed files with 31 additions and 14 deletions

View file

@ -147,7 +147,7 @@ int xmrig::HttpRequest::end(int status, MHD_Response *rsp)
MHD_add_response_header(rsp, "Content-Type", "application/json"); MHD_add_response_header(rsp, "Content-Type", "application/json");
MHD_add_response_header(rsp, "Access-Control-Allow-Origin", "*"); MHD_add_response_header(rsp, "Access-Control-Allow-Origin", "*");
MHD_add_response_header(rsp, "Access-Control-Allow-Methods", "GET, PUT"); MHD_add_response_header(rsp, "Access-Control-Allow-Methods", "GET, PUT");
MHD_add_response_header(rsp, "Access-Control-Allow-Headers", "Authorization"); MHD_add_response_header(rsp, "Access-Control-Allow-Headers", "Authorization, Content-Type");
const int ret = MHD_queue_response(m_connection, status, rsp); const int ret = MHD_queue_response(m_connection, status, rsp);
MHD_destroy_response(rsp); MHD_destroy_response(rsp);

View file

@ -251,6 +251,10 @@ bool xmrig::CommonConfig::parseString(int key, const char *arg)
m_apiWorkerId = arg; m_apiWorkerId = arg;
break; break;
case ApiIdKey: /* --api-id */
m_apiId = arg;
break;
case UserAgentKey: /* --user-agent */ case UserAgentKey: /* --user-agent */
m_userAgent = arg; m_userAgent = arg;
break; break;

View file

@ -49,6 +49,7 @@ public:
inline bool isColors() const { return m_colors; } inline bool isColors() const { return m_colors; }
inline bool isDryRun() const { return m_dryRun; } inline bool isDryRun() const { return m_dryRun; }
inline bool isSyslog() const { return m_syslog; } inline bool isSyslog() const { return m_syslog; }
inline const char *apiId() const { return m_apiId.data(); }
inline const char *apiToken() const { return m_apiToken.data(); } inline const char *apiToken() const { return m_apiToken.data(); }
inline const char *apiWorkerId() const { return m_apiWorkerId.data(); } inline const char *apiWorkerId() const { return m_apiWorkerId.data(); }
inline const char *logFile() const { return m_logFile.data(); } inline const char *logFile() const { return m_logFile.data(); }
@ -97,6 +98,7 @@ protected:
State m_state; State m_state;
std::vector<Pool> m_activePools; std::vector<Pool> m_activePools;
std::vector<Pool> m_pools; std::vector<Pool> m_pools;
xmrig::c_str m_apiId;
xmrig::c_str m_apiToken; xmrig::c_str m_apiToken;
xmrig::c_str m_apiWorkerId; xmrig::c_str m_apiWorkerId;
xmrig::c_str m_fileName; xmrig::c_str m_fileName;

View file

@ -23,8 +23,8 @@
*/ */
#ifndef KECCAK_H_ #ifndef XMRIG_KECCAK_H
#define KECCAK_H_ #define XMRIG_KECCAK_H
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
@ -52,4 +52,4 @@ void keccakf(uint64_t st[25], int norounds);
} /* namespace xmrig */ } /* namespace xmrig */
#endif /* KECCAK_H_ */ #endif /* XMRIG_KECCAK_H */

View file

@ -20,8 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __ICONFIG_H__ #ifndef XMRIG_ICONFIG_H
#define __ICONFIG_H__ #define XMRIG_ICONFIG_H
#include "common/crypto/Algorithm.h" #include "common/crypto/Algorithm.h"
@ -42,6 +42,7 @@ public:
ApiPort = 4000, ApiPort = 4000,
ApiRestrictedKey = 4004, ApiRestrictedKey = 4004,
ApiWorkerIdKey = 4002, ApiWorkerIdKey = 4002,
ApiIdKey = 4005,
BackgroundKey = 'B', BackgroundKey = 'B',
ColorKey = 1002, ColorKey = 1002,
ConfigKey = 'c', ConfigKey = 'c',
@ -97,6 +98,16 @@ public:
PoolCoinKey = 'C', PoolCoinKey = 'C',
ReuseTimeoutKey = 1106, ReuseTimeoutKey = 1106,
WorkersKey = 1103, WorkersKey = 1103,
WorkersAdvKey = 1107,
// xmrig nvidia
CudaMaxThreadsKey = 1200,
CudaBFactorKey = 1201,
CudaBSleepKey = 1202,
CudaDevicesKey = 1203,
CudaLaunchKey = 1204,
CudaAffinityKey = 1205,
CudaMaxUsageKey = 1206,
}; };
virtual ~IConfig() {} virtual ~IConfig() {}
@ -118,4 +129,4 @@ public:
} /* namespace xmrig */ } /* namespace xmrig */
#endif // __ICONFIG_H__ #endif // XMRIG_ICONFIG_H

View file

@ -21,8 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __ICONTROLLERLISTENER_H__ #ifndef XMRIG_ICONTROLLERLISTENER_H
#define __ICONTROLLERLISTENER_H__ #define XMRIG_ICONTROLLERLISTENER_H
namespace xmrig { namespace xmrig {
@ -43,4 +43,4 @@ public:
} /* namespace xmrig */ } /* namespace xmrig */
#endif // __ICONTROLLERLISTENER_H__ #endif // XMRIG_ICONTROLLERLISTENER_H

View file

@ -21,8 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __TIMESTAMP_H__ #ifndef XMRIG_TIMESTAMP_H
#define __TIMESTAMP_H__ #define XMRIG_TIMESTAMP_H
#include <chrono> #include <chrono>
@ -31,7 +31,7 @@
namespace xmrig { namespace xmrig {
int64_t currentMSecsSinceEpoch() static inline int64_t currentMSecsSinceEpoch()
{ {
using namespace std::chrono; using namespace std::chrono;
if (high_resolution_clock::is_steady) { if (high_resolution_clock::is_steady) {
@ -44,4 +44,4 @@ int64_t currentMSecsSinceEpoch()
} /* namespace xmrig */ } /* namespace xmrig */
#endif /* __TIMESTAMP_H__ */ #endif /* XMRIG_TIMESTAMP_H */