diff --git a/src/common/Platform_unix.cpp b/src/common/Platform_unix.cpp index 624594e9b..63cd1c8b2 100644 --- a/src/common/Platform_unix.cpp +++ b/src/common/Platform_unix.cpp @@ -4,8 +4,8 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2017-2018 XMR-Stak , + * Copyright 2016-2018 XMRig , * * 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 diff --git a/src/common/api/Httpd.cpp b/src/common/api/Httpd.cpp index 0cab01bfd..eb6a4ba61 100644 --- a/src/common/api/Httpd.cpp +++ b/src/common/api/Httpd.cpp @@ -81,7 +81,12 @@ bool Httpd::start() return false; } +# if MHD_VERSION >= 0x00093900 uv_timer_start(&m_timer, Httpd::onTimer, kIdleInterval, kIdleInterval); +# else + uv_timer_start(&m_timer, Httpd::onTimer, kActiveInterval, kActiveInterval); +# endif + return true; } @@ -107,6 +112,7 @@ void Httpd::run() { MHD_run(m_daemon); +# if MHD_VERSION >= 0x00093900 const MHD_DaemonInfo *info = MHD_get_daemon_info(m_daemon, MHD_DAEMON_INFO_CURRENT_CONNECTIONS); if (m_idle && info->num_connections) { uv_timer_set_repeat(&m_timer, kActiveInterval); @@ -116,6 +122,7 @@ void Httpd::run() uv_timer_set_repeat(&m_timer, kIdleInterval); m_idle = true; } +# endif } diff --git a/src/common/net/Pool.cpp b/src/common/net/Pool.cpp index f1dd1352c..3be491fb5 100644 --- a/src/common/net/Pool.cpp +++ b/src/common/net/Pool.cpp @@ -31,6 +31,11 @@ #include "common/net/Pool.h" +#ifdef APP_DEBUG +# include "common/log/Log.h" +#endif + + #ifdef _MSC_VER # define strncasecmp _strnicmp # define strcasecmp _stricmp @@ -290,6 +295,21 @@ xmrig::Variant Pool::variant() const } +#ifdef APP_DEBUG +void Pool::print() const +{ + LOG_NOTICE("url: %s", m_url.data()); + LOG_DEBUG ("host: %s", m_host.data()); + LOG_DEBUG ("port: %d", static_cast(m_port)); + LOG_DEBUG ("user: %s", m_user.data()); + LOG_DEBUG ("pass: %s", m_password.data()); + LOG_DEBUG ("algo: %s/%d", algoName(m_algorithm), static_cast(variant())); + LOG_DEBUG ("nicehash: %d", static_cast(m_nicehash)); + LOG_DEBUG ("keepAlive: %d", m_keepAlive); +} +#endif + + bool Pool::parseIPv6(const char *addr) { const char *end = strchr(addr, ']'); diff --git a/src/common/net/Pool.h b/src/common/net/Pool.h index a7e1ca8be..df8578bc8 100644 --- a/src/common/net/Pool.h +++ b/src/common/net/Pool.h @@ -80,6 +80,10 @@ public: void setVariant(int variant); xmrig::Variant variant() const; +# ifdef APP_DEBUG + void print() const; +# endif + private: bool parseIPv6(const char *addr);