mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-15 10:39:37 +00:00
Apply clang-format to test.cc and httplib.h
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f3e9a4d887
commit
8bbfc90380
2 files changed
+4
-6
No files matched your search
@@ -12724,7 +12724,8 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
|
|||||||
int dummy_status;
|
int dummy_status;
|
||||||
if (!detail::read_content(
|
if (!detail::read_content(
|
||||||
strm, req, payload_max_length_, dummy_status, nullptr,
|
strm, req, payload_max_length_, dummy_status, nullptr,
|
||||||
[](const char *, size_t, size_t, size_t) { return true; }, false)) {
|
[](const char *, size_t, size_t, size_t) { return true; },
|
||||||
|
false)) {
|
||||||
connection_closed = true;
|
connection_closed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-5
@@ -19921,8 +19921,7 @@ TEST(KeepAliveTest, UnconsumedChunkedBodyIsNotDrainedWhenResponseCloses) {
|
|||||||
Server svr;
|
Server svr;
|
||||||
svr.Post("/ingest", [&](const Request &, Response &res,
|
svr.Post("/ingest", [&](const Request &, Response &res,
|
||||||
const ContentReader &content_reader) {
|
const ContentReader &content_reader) {
|
||||||
auto consumed =
|
auto consumed = content_reader([](const char *, size_t) { return false; });
|
||||||
content_reader([](const char *, size_t) { return false; });
|
|
||||||
EXPECT_FALSE(consumed);
|
EXPECT_FALSE(consumed);
|
||||||
res.status = StatusCode::Conflict_409;
|
res.status = StatusCode::Conflict_409;
|
||||||
res.set_header("Connection", "close");
|
res.set_header("Connection", "close");
|
||||||
@@ -19959,9 +19958,7 @@ TEST(KeepAliveTest, UnconsumedChunkedBodyIsNotDrainedWhenResponseCloses) {
|
|||||||
do {
|
do {
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
received = recv(sock, buf, sizeof(buf), 0);
|
received = recv(sock, buf, sizeof(buf), 0);
|
||||||
if (received > 0) {
|
if (received > 0) { response.append(buf, static_cast<size_t>(received)); }
|
||||||
response.append(buf, static_cast<size_t>(received));
|
|
||||||
}
|
|
||||||
} while (received > 0);
|
} while (received > 0);
|
||||||
|
|
||||||
EXPECT_NE(std::string::npos, response.find("HTTP/1.1 409 Conflict"));
|
EXPECT_NE(std::string::npos, response.find("HTTP/1.1 409 Conflict"));
|
||||||
|
|||||||
Reference in new issue
Block a user