summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-23 02:18:44 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-23 02:18:44 +0200
commitcf94994f8e3b34bc871e2c3b2558f8301146810c (patch)
tree4af0a1b7161e077689f077bb5e14083b8c51b638 /source/cClientHandle.cpp
parentFound something that calls a function when a segfault happens, might be useful. (diff)
downloadcuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.gz
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.bz2
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.lz
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.xz
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.tar.zst
cuberite-cf94994f8e3b34bc871e2c3b2558f8301146810c.zip
Diffstat (limited to 'source/cClientHandle.cpp')
-rw-r--r--source/cClientHandle.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 68a70715e..d2d71a9e5 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -1,11 +1,3 @@
-#ifndef _WIN32
-#include <cstring>
-#include <semaphore.h>
-#include <errno.h>
-#endif
-
-#include "MCSocket.h"
-
#include "cClientHandle.h"
#include "cServer.h"
#include "cWorld.h"
@@ -1023,7 +1015,7 @@ void cClientHandle::ReceiveThread( void *lpParam )
while( self->m_bKeepThreadGoing )
{
- iStat = recv(socket, &temp, 1, 0);
+ iStat = socket.Receive( &temp, 1, 0 );
if( cSocket::IsSocketError(iStat) || iStat == 0 )
{
LOG("CLIENT DISCONNECTED (%i bytes):%s", iStat, GetWSAError().c_str() );
@@ -1041,11 +1033,7 @@ void cClientHandle::ReceiveThread( void *lpParam )
}
else
{
-#ifndef _WIN32
- LOGERROR("Something went wrong during PacketID 0x%02x (%i)", temp, errno );
-#else
- LOGERROR("Something went wrong during PacketID 0x%02x (%s)", temp, GetWSAError().c_str() );
-#endif
+ LOGERROR("Something went wrong during PacketID 0x%02x (%s)", temp, cSocket::GetLastErrorString() );
LOG("CLIENT %s DISCONNECTED", self->GetUsername() );
break;
}
@@ -1056,11 +1044,7 @@ void cClientHandle::ReceiveThread( void *lpParam )
char c_Str[128];
-#ifdef _WIN32
- sprintf_s( c_Str, "[C->S] Unknown PacketID: 0x%2x", (unsigned char)temp );
-#else
- sprintf( c_Str, "[C->S] Unknown PacketID: 0x%2x", (unsigned char)temp );
-#endif
+ sprintf_s( c_Str, 128, "[C->S] Unknown PacketID: 0x%2x", (unsigned char)temp );
cPacket_Disconnect DC(c_Str);
DC.Send( socket );