Thrift: PeekProcessor - moving PeekEnd call after PeekBuffer
authorJames Wang <jwang@apache.org>
Wed, 28 Mar 2007 00:47:09 +0000 (00:47 +0000)
committerJames Wang <jwang@apache.org>
Wed, 28 Mar 2007 00:47:09 +0000 (00:47 +0000)
Reviewed by: boz

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

lib/cpp/src/processor/PeekProcessor.cpp

index a7c5571..d510a5d 100644 (file)
@@ -49,9 +49,6 @@ bool PeekProcessor::process(boost::shared_ptr<facebook::thrift::protocol::TProto
   in->readMessageEnd();
   in->getTransport()->readEnd();
 
-  // Done peeking at variables
-  peekEnd();
-
   //
   // All the data is now in memoryBuffer_ and ready to be processed
   //
@@ -62,6 +59,9 @@ bool PeekProcessor::process(boost::shared_ptr<facebook::thrift::protocol::TProto
   memoryBuffer_->getBuffer(&buffer, &size);
   peekBuffer(buffer, size);
   
+  // Done peeking at variables
+  peekEnd();
+
   bool ret = actualProcessor_->process(pipedProtocol_, out);
   memoryBuffer_->resetBuffer();
   return ret;