nb: clear the input buffer only on success

With multipart streams the parsing isn't
done until all parts are in. We will need
to reparse the header when more data comes in
until we can parse all parts. Otherwise we
end up removing the header and losing it
when we can't find all parts in the body.

This fixes convert-to requests.

Change-Id: Ic1d5ccbd00fd6763eb91fdda35177f6df847f100
This commit is contained in:
Ashod Nakashian 2017-02-28 23:40:09 -05:00 committed by Jan Holesovsky
parent 4abf706af6
commit 28b3813249

View file

@ -2710,10 +2710,6 @@ private:
LOG_DBG("Not enough content yet: ContentLength: " << contentLength << ", available: " << available);
return;
}
// if we succeeded - remove the request from our input buffer
// we expect one request per socket
in.clear();
}
catch (const std::exception& exc)
{
@ -2782,6 +2778,10 @@ private:
socket->shutdown();
}
}
// if we succeeded - remove the request from our input buffer
// we expect one request per socket
in.clear();
}
catch (const std::exception& exc)
{