summaryrefslogtreecommitdiff
path: root/src/net/messagein.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r--src/net/messagein.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 92447cde2..0c7f9cb7e 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -47,6 +47,26 @@ MessageIn::MessageIn(const char *const data, const unsigned int length) :
DEBUGLOG("MessageIn");
}
+MessageIn::~MessageIn()
+{
+ if (mLength)
+ {
+ if (mPos != mLength && mPos != 2)
+ {
+ logger->log("Wrong actual or planned inbound packet size!");
+ logger->log(" packet id: %d 0x%x",
+ static_cast<int>(mId),
+ static_cast<int>(mId));
+ logger->log(" planned size: %u", mLength);
+ logger->log(" read size: %u", mPos);
+ }
+ }
+ else
+ {
+ logger->log("Zero packet size: %d", static_cast<int>(mId));
+ }
+}
+
unsigned char MessageIn::readUInt8(const char *const str)
{
unsigned char value = static_cast<unsigned char>(-1);