Github user ben-craig commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/357#discussion_r23507848
  
    --- Diff: lib/cpp/src/thrift/server/TNonblockingServer.cpp ---
    @@ -547,12 +553,18 @@ void TNonblockingServer::TConnection::transition() {
       case APP_READ_REQUEST:
         // We are done reading the request, package the read buffer into 
transport
         // and get back some data from the dispatch function
    -    inputTransport_->resetBuffer(readBuffer_, readBufferPos_);
    -    outputTransport_->resetBuffer();
    -    // Prepend four bytes of blank space to the buffer so we can
    -    // write the frame size there later.
    -    outputTransport_->getWritePtr(4);
    -    outputTransport_->wroteBytes(4);
    +    if (!server_->getOutputProtocolFactory()) {
    +      inputTransport_->resetBuffer(readBuffer_, readBufferPos_);
    +      outputTransport_->resetBuffer();
    +    } else {
    +      inputTransport_->resetBuffer(readBuffer_ + 4, readBufferPos_ - 4);
    --- End diff --
    
    I believe this is the 'legacy' branch.  Is there a compelling reason to 
change this code from how it was?  I'm not sure why the +/- 4 is necessary now, 
but for some reason wasn't necessary before.  Maybe this isn't a legacy branch 
and I'm just misunderstanding things?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to