Fix the BodyReader read routine to only empty enough data to satisfy the
given Content-Length; rather than emptying the buffer entirely.
Some clients have a habit of stuffing a \r\n at the end of a POST body and
this was being (over)read and hitting an assertion.
debugs(32,3,HERE << this << " " << "data=" << read_func_data);
size_t size = theBuf.potentialSpaceSize();
+ debug(32, 3) ("BodyReader::read: available: %d, size %d, _remaining: %d\n", _available, size, _remaining);
+
if (size > _available)
size = _available;
+ if (size > _remaining)
+ size = _remaining;
+
if (size > 0) {
debugs(32,3,HERE << this << " " << "calling read_func for " << size << " bytes");