wsd: http: use writeData to serialize http::Request

Change-Id: Ib67f92c34d42d7cdb922cbfc47222040a6deb603
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This commit is contained in:
Ashod Nakashian 2021-03-20 17:06:41 -04:00 committed by Ashod Nakashian
parent 40b1aa1077
commit 4bda1ff1d1

View file

@ -490,14 +490,18 @@ public:
{
if (_stage == Stage::Header)
{
std::ostringstream oss;
oss << getVerb() << ' ' << getUrl() << ' ' << getVersion() << "\r\n";
_header.serialize(oss);
oss << "\r\n";
const std::string headerStr = oss.str();
LOG_TRC("performWrites (header).");
out.append(getVerb());
out.append(' ');
out.append(getUrl());
out.append(' ');
out.append(getVersion());
out.append("\r\n", 2);
_header.writeData(out);
out.append("\r\n", 2);
out.append(headerStr.data(), headerStr.size());
LOG_TRC("performWrites (header): " << headerStr.size() << ": " << headerStr);
_stage = Stage::Body;
}