THRIFT-840. perl: Perl protocol handler could be more robust against unrecognised types
This patch causes the protocol to throw an exception when it sees an unrecognized type instead of silently doing nothing.
Patch: Conrad Hughes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991778 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/perl/lib/Thrift/Protocol.pm b/lib/perl/lib/Thrift/Protocol.pm
index 034711f..e2801fe 100644
--- a/lib/perl/lib/Thrift/Protocol.pm
+++ b/lib/perl/lib/Thrift/Protocol.pm
@@ -399,8 +399,7 @@
return $result;
}
-
- return 0;
+ die new Thrift::TException("Type $type not recognised --- corrupt data?");
}
@@ -511,8 +510,7 @@
return $result;
}
- return 0;
-
+ die new Thrift::TException("Type $type not recognised --- corrupt data?");
}
#