Added more validation code to the BSP tools. Now they will do a little more

to detect invalid serialization.
This commit is contained in:
Davis King 2012-10-22 19:30:10 -04:00
parent 23d1c1fa01
commit cbbd84479a
1 changed files with 4 additions and 0 deletions

View File

@ -453,6 +453,10 @@ namespace dlib
{
std::istringstream sin(*temp);
deserialize(item, sin);
if (sin.peek() != EOF)
throw serialization_error("deserialize() did not consume all bytes produced by serialize(). "
"This probably means you are calling a receive method with a different type "
"of object than the one which was sent.");
return true;
}
else