ICAP behaviour on noteMoreBodySpaceAvailable() can result in a parse
being attempted even if the read I/O buffer has not yet received any
new content to fill the available space. Handle this cleanly instead of
throwing parse errors and causing ICAP service disconnect.
bool
Http::One::ChunkedCodingParser::parse(const SBuf &aBuf)
{
- buf_ = aBuf;
+ buf_ = aBuf; // sync buffers first so calls to remaining() work properly if nothing done.
+
+ if (buf_.isEmpty()) // nothing to do (yet)
+ return false;
+
debugs(74, DBG_DATA, "Parse buf={length=" << aBuf.length() << ", data='" << aBuf << "'}");
+
Must(!buf_.isEmpty() && theOut);
if (parsingStage_ == Http1::HTTP_PARSE_NONE)