diff --git a/src/Cpu.cpp b/src/Cpu.cpp index a5243fe9..2ff1b56c 100644 --- a/src/Cpu.cpp +++ b/src/Cpu.cpp @@ -111,8 +111,8 @@ void Cpu::initCommon() } // Workaround for Intel Core Solo, Core Duo, Core 2 Duo, Core 2 Quad and their Xeon homologue // These processors have L2 cache shared by 2 cores. - else if(data.vendor == VENDOR_INTEL && data.family == 0x06 && (data.model == 0x0E || data.model == 0x0F || - data.model == 0x07)) + else if(data.vendor == VENDOR_INTEL && data.ext_family == 0x06 && + (data.ext_model == 0x0E || data.ext_model == 0x0F || data.ext_model == 0x07)) { int l2_count_per_socket = m_totalCores > 1 ? m_totalCores / 2 : 1; m_l2_cache = data.l2_cache > 0 ? data.l2_cache * l2_count_per_socket * m_sockets : 0; diff --git a/src/net/Client.cpp b/src/net/Client.cpp index ec250cb8..5367e37f 100644 --- a/src/net/Client.cpp +++ b/src/net/Client.cpp @@ -729,7 +729,7 @@ void Client::onRead(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) client->m_recvBufPos += nread; char* end; - char* start = buf->base; + char* start = client->m_recvBuf.base; size_t remaining = client->m_recvBufPos; if(client->m_encrypted) @@ -737,7 +737,7 @@ void Client::onRead(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) char* read_encr_hex = static_cast(malloc(nread * 2 + 1)); memset(read_encr_hex, 0, nread * 2 + 1); Job::toHex(std::string(start, nread), read_encr_hex); - LOG_DEBUG("[" << client->m_ip << "] read encr. (" << nread << " bytes): 0x\"" << read_encr_hex << "\""); + LOG_DEBUG("[" << client->m_ip << "] read encr. (" << nread << " bytes): \"0x" << read_encr_hex << "\""); free(read_encr_hex); // DeEncrypt @@ -763,12 +763,12 @@ void Client::onRead(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) return; } - if(start == buf->base) + if(start == client->m_recvBuf.base) { return; } - memcpy(buf->base, start, remaining); + memcpy(client->m_recvBuf.base, start, remaining); client->m_recvBufPos = remaining; } diff --git a/src/workers/Hashrate.cpp b/src/workers/Hashrate.cpp index 8a851477..ed4a4287 100644 --- a/src/workers/Hashrate.cpp +++ b/src/workers/Hashrate.cpp @@ -21,12 +21,6 @@ * along with this program. If not, see . */ -#ifdef _WIN32 -#define isnormal(x) (_fpclass(x) == _FPCLASS_NN || _fpclass(x) == _FPCLASS_PN) -#else -#include -#endif - #ifndef _WIN32 #if __cplusplus <= 199711L #include @@ -35,6 +29,7 @@ #define USE_CHRONO #endif #else +#define isnormal(x) (_fpclass(x) == _FPCLASS_NN || _fpclass(x) == _FPCLASS_PN) #define WIN32_LEAN_AND_MEAN #include #include // portable: uint64_t MSVC: __int64 @@ -63,6 +58,7 @@ static int gettimeofday(struct timeval* tp, struct timezone* tzp) #endif #include +#include #include #include