Bläddra i källkod

Apply clang-format to test.cc and httplib.h

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Emre Ay 2 veckor sedan
förälder
incheckning
8bbfc90380
2 ändrade filer med 4 tillägg och 6 borttagningar
  1. 2 1
      httplib.h
  2. 2 5
      test/test.cc

+ 2 - 1
httplib.h

@@ -12724,7 +12724,8 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
       int dummy_status;
       if (!detail::read_content(
               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;
       }
     }

+ 2 - 5
test/test.cc

@@ -19921,8 +19921,7 @@ TEST(KeepAliveTest, UnconsumedChunkedBodyIsNotDrainedWhenResponseCloses) {
   Server svr;
   svr.Post("/ingest", [&](const Request &, Response &res,
                           const ContentReader &content_reader) {
-    auto consumed =
-        content_reader([](const char *, size_t) { return false; });
+    auto consumed = content_reader([](const char *, size_t) { return false; });
     EXPECT_FALSE(consumed);
     res.status = StatusCode::Conflict_409;
     res.set_header("Connection", "close");
@@ -19959,9 +19958,7 @@ TEST(KeepAliveTest, UnconsumedChunkedBodyIsNotDrainedWhenResponseCloses) {
   do {
     char buf[4096];
     received = recv(sock, buf, sizeof(buf), 0);
-    if (received > 0) {
-      response.append(buf, static_cast<size_t>(received));
-    }
+    if (received > 0) { response.append(buf, static_cast<size_t>(received)); }
   } while (received > 0);
 
   EXPECT_NE(std::string::npos, response.find("HTTP/1.1 409 Conflict"));