Fixed regression

__From origin__
This commit is contained in:
enWILLYado 2018-03-07 00:17:14 +01:00
parent 9558a284b3
commit 528b705333
3 changed files with 8 additions and 12 deletions

View file

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

View file

@ -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<char*>(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;
}

View file

@ -21,12 +21,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _WIN32
#define isnormal(x) (_fpclass(x) == _FPCLASS_NN || _fpclass(x) == _FPCLASS_PN)
#else
#include <math.h>
#endif
#ifndef _WIN32
#if __cplusplus <= 199711L
#include <sys/time.h>
@ -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 <Windows.h>
#include <stdint.h> // portable: uint64_t MSVC: __int64
@ -63,6 +58,7 @@ static int gettimeofday(struct timeval* tp, struct timezone* tzp)
#endif
#include <math.h>
#include <limits.h>
#include <memory.h>
#include <stdio.h>