Thrift-1220: TRpocessor::process never returns false
authorJake Farrell <jfarrell@apache.org>
Mon, 27 Jun 2011 18:44:04 +0000 (18:44 +0000)
committerJake Farrell <jfarrell@apache.org>
Mon, 27 Jun 2011 18:44:04 +0000 (18:44 +0000)
Client: c++
Patch: Diwaker Gupta

Fixes issue with return values always returning true from process method when an exception or error occurs.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1140262 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_cpp_generator.cc

index ec2e15b..d79b587 100644 (file)
@@ -2652,7 +2652,7 @@ void t_cpp_generator::generate_service_processor(t_service* tservice, string sty
     indent() << "  oprot->writeMessageEnd();" << endl <<
     indent() << "  oprot->getTransport()->writeEnd();" << endl <<
     indent() << "  oprot->getTransport()->flush();" << endl <<
-    indent() << (style == "Cob" ? "  return cob(true);" : "  return true;") << endl <<
+    indent() << (style == "Cob" ? "  return cob(false);" : "  return false;") << endl <<
     indent() << "}" << endl <<
     endl <<
     indent() << "return process_fn(" << (style == "Cob" ? "cob, " : "")
@@ -2692,7 +2692,7 @@ void t_cpp_generator::generate_service_processor(t_service* tservice, string sty
       indent() << "  oprot->writeMessageEnd();" << endl <<
       indent() << "  oprot->getTransport()->writeEnd();" << endl <<
       indent() << "  oprot->getTransport()->flush();" << endl <<
-      indent() << (style == "Cob" ? "  return cob(true);" : "  return true;") << endl;
+      indent() << (style == "Cob" ? "  return cob(false);" : "  return false;") << endl;
   } else {
     out <<
       indent() << "  return "