From a55f51d8709582e1d054844c17c554e8d124b394 Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Thu, 2 Sep 2010 00:24:50 +0000 Subject: [PATCH] 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 --- lib/perl/lib/Thrift/Protocol.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/perl/lib/Thrift/Protocol.pm b/lib/perl/lib/Thrift/Protocol.pm index 034711f3..e2801fee 100644 --- a/lib/perl/lib/Thrift/Protocol.pm +++ b/lib/perl/lib/Thrift/Protocol.pm @@ -399,8 +399,7 @@ sub skip return $result; } - - return 0; + die new Thrift::TException("Type $type not recognised --- corrupt data?"); } @@ -511,8 +510,7 @@ sub skipBinary return $result; } - return 0; - + die new Thrift::TException("Type $type not recognised --- corrupt data?"); } # -- 2.17.1