Sync changes with proxy.

This commit is contained in:
XMRig 2018-04-23 00:59:58 +07:00
parent 54c3cd5494
commit 6d40f2dd1a
4 changed files with 33 additions and 2 deletions

View file

@ -4,8 +4,8 @@
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2016-2017 XMRig <support@xmrig.com>
*
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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

View file

@ -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
}

View file

@ -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<int>(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<int>(variant()));
LOG_DEBUG ("nicehash: %d", static_cast<int>(m_nicehash));
LOG_DEBUG ("keepAlive: %d", m_keepAlive);
}
#endif
bool Pool::parseIPv6(const char *addr)
{
const char *end = strchr(addr, ']');

View file

@ -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);