From: dweatherford Date: Tue, 11 Mar 2008 02:42:45 +0000 (+0000) Subject: [thrift] Move readMessageEnd inside of else block for accelerated protocol X-Git-Tag: 0.2.0~905 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=6b53bbb77881ceb149e468e7e5082f82b50c07d9;p=common%2Fthrift.git [thrift] Move readMessageEnd inside of else block for accelerated protocol Summary: Otherwise, readMessageEnd will be performed twice; once in the extension and once in PHP-land. Since TBinaryProtocol readMessageEnd is a no-op this isn't a huge deal, but it's bad style. Reviewed By: mcslee Test Plan: Inspect generated php code Revert: OK TracCamp Project: Thrift DiffCamp Revision: 9155 git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665567 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/compiler/cpp/src/generate/t_php_generator.cc b/compiler/cpp/src/generate/t_php_generator.cc index 0d2e31fe..99b207f9 100644 --- a/compiler/cpp/src/generate/t_php_generator.cc +++ b/compiler/cpp/src/generate/t_php_generator.cc @@ -1287,14 +1287,13 @@ void t_php_generator::_generate_service_client(ofstream& out, t_service* tservic indent() << "$result = new " << resultname << "();" << endl << indent() << "$result->read($this->input_);" << endl; - scope_down(out); - if (!binary_inline_) { out << - indent() << "$this->input_->readMessageEnd();" << endl << - endl; + indent() << "$this->input_->readMessageEnd();" << endl; } + scope_down(out); + // Careful, only return result if not a void function if (!(*f_iter)->get_returntype()->is_void()) { out <<