common/iobuf.c: Improve iobuf_peek.
authorNeal H. Walfield <neal@g10code.com>
Wed, 12 Aug 2015 20:57:58 +0000 (22:57 +0200)
committerNeal H. Walfield <neal@g10code.com>
Thu, 20 Aug 2015 12:16:20 +0000 (14:16 +0200)
commita250f73783c06d7789ac65a395d9247f4ab44c26
treea4e983ddf17be92588f11c73bf6a04873a5cf8b3
parentc7ad36eb0d7f872fc15e793aa1d0b6b89bc471d6
common/iobuf.c: Improve iobuf_peek.

* common/iobuf.c (underflow): Take additional parameter
clear_pending_eof.  If not set, don't clear a pending eof when
returning EOF.  Update callers.
(iobuf_peek): Fill the internal buffer, if needed, to be able to
better satisfy any request.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
common/iobuf.c