mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-26 12:24:46 +00:00
Send the Connection: close header the multipart test comment describes
expect_split_multipart_ok() carries a comment saying the request sends "Connection: close" so the response drain ends as soon as the server has answered, but the header itself never made it into the request, so both callers kept idling until the read timeout instead. Add the header. EpilogueSplitAcrossReadsIsIgnored and InitialBoundarySplitAfterLongPreamble each drop from about 3.1s to about 0.11s.
This commit is contained in:
1 parent
bc58e6e9ac
commit
2afe933103
1 file changed
+1
@@ -15474,6 +15474,7 @@ static void expect_split_multipart_ok(const std::string &body1,
|
|||||||
const std::string head =
|
const std::string head =
|
||||||
"POST /post HTTP/1.1\r\n"
|
"POST /post HTTP/1.1\r\n"
|
||||||
"Content-Type: multipart/form-data; boundary=zzzz\r\n"
|
"Content-Type: multipart/form-data; boundary=zzzz\r\n"
|
||||||
|
"Connection: close\r\n"
|
||||||
"Content-Length: " +
|
"Content-Length: " +
|
||||||
std::to_string(body1.size() + body2.size()) + "\r\n\r\n";
|
std::to_string(body1.size() + body2.size()) + "\r\n\r\n";
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user