fix varint decoding in case the first buffer is smaller than encoded varint
authorMainak Mandal <mmandal@fb.com>
Wed, 26 Nov 2014 02:27:13 +0000 (18:27 -0800)
committerDave Watson <davejwatson@fb.com>
Thu, 11 Dec 2014 15:59:03 +0000 (07:59 -0800)
commit29ca6827b5387ebeeffcd1407492685a3327df25
treea57bf52e6d09a8fb04d5759c95b19fca58a52902
parent929e93d49bfe69a76b848c03aacf4164621dd3dd
fix varint decoding in case the first buffer is smaller than encoded varint

Summary: This is not a super clean solution, given that I have just copied the code over form Varint.h. Another way would be to add a peek(IOBuf&, size_t) method to CursorBase and use that to peek deeper into the chain.

Test Plan: unit tests

Reviewed By: tulloch@fb.com

Subscribers: trunkagent, njormrod, dcapel, benr, folly-diffs@

FB internal diff: D1689872

Signature: t1:1689872:1416964989:b7f12a2686233f161401288ffcb8c51926b01fdf
folly/Varint.h
folly/io/Compression.cpp
folly/io/test/CompressionTest.cpp