Fix bugs exposed by test_TestServiceBenchmarks.

More bugs were lurking in this section of code. In some unknown way,
code I'm working on triggered frequent (9/10) failures of
test_TestServiceBenchmarks. These were all possible to be triggered on
HEAD, but for some unknown reason are not.

I am pretty certain we have at least one transport that handles
exceptions poorly, such as by throwing away the exception and not
informing the Operation of the error, which causes this test to time out.
Timeouts in this test are thus likely an indicator of a real bug, even
when it doesn't show any exception, because there was likely an exception
and it was eaten without logging.

Bugs fixed (in order of discovery):

1) In Deframer, currentLength and inFrame were not reset after
consuming a context or status message.

2) In consolidate(), if suffix was greater than the buffer and the
buffer contained data, the data would be lost.

3) In Deframer, some (unknown) Operation's addPayload() did not consume
all of the provided InputStream immediately (maybe it does so on
another thread), leaving those bytes in frame.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69402916
2 files changed
tree: c2a9c72d6bfb76cf70a79d358127228f7498bc33
  1. core/
  2. stub/
  3. testing/
  4. LICENSE