Fixed regression
__From origin__
This commit is contained in:
parent
9558a284b3
commit
528b705333
3 changed files with 8 additions and 12 deletions
|
@ -111,8 +111,8 @@ void Cpu::initCommon()
|
||||||
}
|
}
|
||||||
// Workaround for Intel Core Solo, Core Duo, Core 2 Duo, Core 2 Quad and their Xeon homologue
|
// 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.
|
// These processors have L2 cache shared by 2 cores.
|
||||||
else if(data.vendor == VENDOR_INTEL && data.family == 0x06 && (data.model == 0x0E || data.model == 0x0F ||
|
else if(data.vendor == VENDOR_INTEL && data.ext_family == 0x06 &&
|
||||||
data.model == 0x07))
|
(data.ext_model == 0x0E || data.ext_model == 0x0F || data.ext_model == 0x07))
|
||||||
{
|
{
|
||||||
int l2_count_per_socket = m_totalCores > 1 ? m_totalCores / 2 : 1;
|
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;
|
m_l2_cache = data.l2_cache > 0 ? data.l2_cache * l2_count_per_socket * m_sockets : 0;
|
||||||
|
|
|
@ -729,7 +729,7 @@ void Client::onRead(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf)
|
||||||
client->m_recvBufPos += nread;
|
client->m_recvBufPos += nread;
|
||||||
|
|
||||||
char* end;
|
char* end;
|
||||||
char* start = buf->base;
|
char* start = client->m_recvBuf.base;
|
||||||
size_t remaining = client->m_recvBufPos;
|
size_t remaining = client->m_recvBufPos;
|
||||||
|
|
||||||
if(client->m_encrypted)
|
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));
|
char* read_encr_hex = static_cast<char*>(malloc(nread * 2 + 1));
|
||||||
memset(read_encr_hex, 0, nread * 2 + 1);
|
memset(read_encr_hex, 0, nread * 2 + 1);
|
||||||
Job::toHex(std::string(start, nread), read_encr_hex);
|
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);
|
free(read_encr_hex);
|
||||||
|
|
||||||
// DeEncrypt
|
// DeEncrypt
|
||||||
|
@ -763,12 +763,12 @@ void Client::onRead(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(start == buf->base)
|
if(start == client->m_recvBuf.base)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(buf->base, start, remaining);
|
memcpy(client->m_recvBuf.base, start, remaining);
|
||||||
client->m_recvBufPos = remaining;
|
client->m_recvBufPos = remaining;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,6 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* 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
|
#ifndef _WIN32
|
||||||
#if __cplusplus <= 199711L
|
#if __cplusplus <= 199711L
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
@ -35,6 +29,7 @@
|
||||||
#define USE_CHRONO
|
#define USE_CHRONO
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
#define isnormal(x) (_fpclass(x) == _FPCLASS_NN || _fpclass(x) == _FPCLASS_PN)
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <stdint.h> // portable: uint64_t MSVC: __int64
|
#include <stdint.h> // portable: uint64_t MSVC: __int64
|
||||||
|
@ -63,6 +58,7 @@ static int gettimeofday(struct timeval* tp, struct timezone* tzp)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue