Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-932

BodyLength is zero when receive buffer tries read from it

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.1.3
    • Component/s: library
    • Labels:
      None

      Description

      In certain situations, the first receive call will only get part of the memcached header (less than 24 bytes). When the SDK tries to pull the bodylength from the header, it gets a value of zero, since the header is incomplete.

      This is a partial fix for the issue (but doesn't address why):

      var bufferSize = state.BodyLength < Configuration.BufferSize 
                                  ? state.BodyLength
                                  : Configuration.BufferSize;
      //this is the fixed code
      var bufferSize = state.BodyLength < Configuration.BufferSize && state.BytesReceived > 8
                                  ? state.BodyLength
                                  : Configuration.BufferSize;
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          Hide
          jmorris Jeff Morris added a comment -

          Patch is in gerrit.

          Show
          jmorris Jeff Morris added a comment - Patch is in gerrit.

            People

            • Assignee:
              jmorris Jeff Morris
              Reporter:
              jmorris Jeff Morris
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.