Add forwarding gather() function to IOBufQueue
authorDaniel Sommermann <dcsommer@whatsapp.com>
Fri, 9 Sep 2016 20:50:08 +0000 (13:50 -0700)
committerFacebook Github Bot 2 <facebook-github-bot-2-bot@fb.com>
Fri, 9 Sep 2016 20:53:28 +0000 (13:53 -0700)
commit2f028f63edda391482083792f61bda841f471d07
tree564a0eb193dfaf46759e8b0d275aab1570b6d4db
parent0c723a6045a185e4cae76ca42520e1274648be3c
Add forwarding gather() function to IOBufQueue

Summary:
I'm working with a parser that requires a certain number of
contiguous bytes to be able to make forward progress. I'm also using
IOBufQueue to receive data from an AsyncReader::ReadCallback with
pre/postallocate. So, I need to call gather() to ensure that the queue's
front IOBuf has the right number of contiguous bytes available.

Reviewed By: djwatson

Differential Revision: D3838079

fbshipit-source-id: 9f1ec5c86895eb1b2b109f9f145ca42d2dbba4c6
folly/io/IOBufQueue.cpp
folly/io/IOBufQueue.h
folly/io/test/IOBufQueueTest.cpp