xmrig v6.3.2 merge
This commit is contained in:
commit
651306a57a
25 changed files with 473 additions and 57 deletions
|
@ -22,6 +22,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <IOKit/IOKitLib.h>
|
||||
#include <IOKit/ps/IOPowerSources.h>
|
||||
#include <mach/thread_act.h>
|
||||
#include <mach/thread_policy.h>
|
||||
#include <stdio.h>
|
||||
|
@ -111,15 +113,5 @@ void xmrig::Platform::setThreadPriority(int priority)
|
|||
|
||||
bool xmrig::Platform::isOnBatteryPower()
|
||||
{
|
||||
for (int i = 0; i <= 1; ++i) {
|
||||
char buf[64];
|
||||
snprintf(buf, 64, "/sys/class/power_supply/BAT%d/status", i);
|
||||
std::ifstream f(buf);
|
||||
if (f.is_open()) {
|
||||
std::string status;
|
||||
f >> status;
|
||||
return (status == "Discharging");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return IOPSGetTimeRemainingEstimate() != kIOPSTimeRemainingUnlimited;
|
||||
}
|
||||
|
|
|
@ -126,6 +126,10 @@ bool xmrig::HttpContext::isRequest() const
|
|||
|
||||
size_t xmrig::HttpContext::parse(const char *data, size_t size)
|
||||
{
|
||||
if (size == 0) {
|
||||
return size;
|
||||
}
|
||||
|
||||
return http_parser_execute(m_parser, &http_settings, data, size);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue