Enable logging of netpacket errors.
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
#include <net/receiverhelper.h>
|
#include <net/receiverhelper.h>
|
||||||
#include <net/socket_msg.h>
|
#include <net/socket_msg.h>
|
||||||
#include <net/netexception.h>
|
#include <net/netexception.h>
|
||||||
|
#include <core/loghelper.h>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -107,11 +108,11 @@ ReceiverHelper::InternalGetPackets(ReceiveBuffer &buf)
|
|||||||
// This call will also handle the memmove stuff, i.e.
|
// This call will also handle the memmove stuff, i.e.
|
||||||
// buffering for partial packets.
|
// buffering for partial packets.
|
||||||
tmpPacket = NetPacket::Create(buf.recvBuf, buf.recvBufUsed);
|
tmpPacket = NetPacket::Create(buf.recvBuf, buf.recvBufUsed);
|
||||||
} catch (const NetException &)
|
} catch (const NetException &e)
|
||||||
{
|
{
|
||||||
// Reset buffer on error.
|
// Reset buffer on error.
|
||||||
buf.recvBufUsed = 0;
|
buf.recvBufUsed = 0;
|
||||||
// TODO: log error/increase error counter.
|
LOG_ERR(e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tmpPacket.get())
|
if (tmpPacket.get())
|
||||||
|
|||||||
Reference in New Issue
Block a user