Reserve enough buffer space according to response content size

This commit is contained in:
Chocobo1 2021-12-13 01:39:39 +08:00
parent ece92a886a
commit 3c5688c6f6
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -42,7 +42,7 @@ QByteArray Http::toByteArray(Response response)
response.headers[HEADER_DATE] = httpDate();
QByteArray buf;
buf.reserve(10 * 1024);
buf.reserve(1024 + response.content.length());
// Status Line
buf += QString("HTTP/%1 %2 %3")