DESCRIPTION

JVMCBC-143: Handle query chunking everywhere

Motivation
----------
In some cases where the response is aggressively chunked, the parsing
fails because the split occurs before signature section (eg. requestId).
Late phases of the parsing are also a bit less resilient to such chunks
than errors/result section parsing.

Modifications
-------------
The parser now waits for more data if needed, at every step. It can also
detect that a section was not fully parsed and restart at correct state.
Initial parsing is also doing that.

Result parsing is less aggressively discarding read bytes, but marking a
section as done will discard its bytes.

Last section can be split across multiple chunks.

Added a test json that has every sections possible (even though in real
life this wouldn't happen). Added a test that split this response almost
at every possible position (leaving out the possibility of an empty
chunk) to validate that the parser is extra resilient.

Results
-------
Parser is now extra resilient to all kind of chunking.

Change-Id: I9f256c41e6ace8ea504353f513f042332a4e9429
Reviewed-on: http://review.couchbase.org/46442
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Estrella Humphrey
date: 2015-02-09 08:53:24.357000000

Change has been successfully cherry-picked as 7d1ade023fa7d35764a8dc26cc1d8cbf2dd01f3b

-------------------------------------
