net: Fix small bug in PacketHeader

This prevented on_invalid_packet from being called
This commit is contained in:
Joshua Scott 2018-04-11 00:38:33 +01:00
parent e62f3e7647
commit 88f98fd84c
1 changed files with 1 additions and 1 deletions

View File

@ -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)");
}