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;
|