3rd-Eden/memcached-stream — pull request #5 by crash2burn (2013-03-05 20:40:47+00:00)
Title: Fixed invalid bytesRemaining during parse.

It was hard to write a test for this due to this being an internal variable, so in order to see the issue, just stick "console.log("bytesRemaining, actualBytesRemaining", bytesRemaining, Buffer.byteLength(data.slice(i)))" in line 333.

The discrepancy is not picked up until you have chunks that are very close to the wrong bytesRemaining number - generally under high load. With this fix, all tests pass, and all my external load tests now pass.