From 88f98fd84c63307e7bdfd4cc2ef2c9926ce28659 Mon Sep 17 00:00:00 2001 From: Joshua Scott Date: Wed, 11 Apr 2018 00:38:33 +0100 Subject: [PATCH] net: Fix small bug in PacketHeader This prevented on_invalid_packet from being called --- src/protocol/net/PacketHeader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol/net/PacketHeader.cpp b/src/protocol/net/PacketHeader.cpp index db64ae0..e1091f8 100644 --- a/src/protocol/net/PacketHeader.cpp +++ b/src/protocol/net/PacketHeader.cpp @@ -51,7 +51,7 @@ namespace net if (istream.fail()) throw parse_error("Not enough data was available to read packet header. (m_opcode)"); istream.ignore(2); - if (istream.fail()) + if (istream.eof()) throw parse_error("Not enough data was available to read packet header. (ignored bytes)"); }