_ZN7httplib6detail17gzip_decompressorD2Ev:
 6901|    125|inline gzip_decompressor::~gzip_decompressor() { inflateEnd(&strm_); }
_ZN7httplib10ClientImplD2Ev:
12741|  3.22k|inline ClientImpl::~ClientImpl() {
12742|       |  // Wait until all the requests in flight are handled.
12743|  3.22k|  size_t retry_count = 10;
12744|  3.22k|  while (retry_count-- > 0) {
  ------------------
  |  Branch (12744:10): [True: 3.22k, False: 0]
  ------------------
12745|  3.22k|    {
12746|  3.22k|      std::lock_guard<std::mutex> guard(socket_mutex_);
12747|  3.22k|      if (socket_requests_in_flight_ == 0) { break; }
  ------------------
  |  Branch (12747:11): [True: 3.22k, False: 0]
  ------------------
12748|  3.22k|    }
12749|      0|    std::this_thread::sleep_for(std::chrono::milliseconds{1});
12750|      0|  }
12751|       |
12752|  3.22k|  std::lock_guard<std::mutex> guard(socket_mutex_);
12753|  3.22k|  shutdown_socket(socket_);
12754|  3.22k|  close_socket(socket_);
12755|  3.22k|}
_ZN7httplib6detail12decompressorD2Ev:
 3227|    125|  virtual ~decompressor() = default;
_ZN7httplib6StreamD2Ev:
 1516|  6.45k|  virtual ~Stream() = default;
_ZNK7httplib10ClientImpl15shutdown_socketERNS0_6SocketE:
12870|  3.22k|inline void ClientImpl::shutdown_socket(Socket &socket) const {
12871|  3.22k|  if (socket.sock == INVALID_SOCKET) { return; }
  ------------------
  |  |  300|  3.22k|#define INVALID_SOCKET (-1)
  ------------------
  |  Branch (12871:7): [True: 3.22k, False: 0]
  ------------------
12872|      0|  detail::shutdown_socket(socket.sock);
12873|      0|}
_ZN7httplib10ClientImpl12close_socketERNS0_6SocketE:
12875|  3.22k|inline void ClientImpl::close_socket(Socket &socket) {
12876|       |  // If there are requests in flight in another thread, usually closing
12877|       |  // the socket will be fine and they will simply receive an error when
12878|       |  // using the closed socket, but it is still a bug since rarely the OS
12879|       |  // may reassign the socket id to be used for a new socket, and then
12880|       |  // suddenly they will be operating on a live socket that is different
12881|       |  // than the one they intended!
12882|  3.22k|  assert(socket_requests_in_flight_ == 0 ||
  ------------------
  |  Branch (12882:3): [True: 3.22k, False: 0]
  |  Branch (12882:3): [True: 0, False: 0]
  |  Branch (12882:3): [True: 3.22k, False: 0]
  ------------------
12883|  3.22k|         socket_requests_are_from_thread_ == std::this_thread::get_id());
12884|       |
12885|       |  // It is also a bug if this happens while SSL is still active
12886|       |#ifdef CPPHTTPLIB_SSL_ENABLED
12887|       |  assert(socket.ssl == nullptr);
12888|       |#endif
12889|       |
12890|  3.22k|  if (socket.sock == INVALID_SOCKET) { return; }
  ------------------
  |  |  300|  3.22k|#define INVALID_SOCKET (-1)
  ------------------
  |  Branch (12890:7): [True: 3.22k, False: 0]
  ------------------
12891|      0|  detail::close_socket(socket.sock);
12892|      0|  socket.sock = INVALID_SOCKET;
  ------------------
  |  |  300|      0|#define INVALID_SOCKET (-1)
  ------------------
12893|      0|}
_ZN7httplib10ClientImplC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEi:
12733|  3.22k|    : ClientImpl(host, port, std::string(), std::string()) {}
_ZN7httplib10ClientImplC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiS9_S9_:
12738|  3.22k|    : host_(detail::escape_abstract_namespace_unix_domain(host)), port_(port),
12739|  3.22k|      client_cert_path_(client_cert_path), client_key_path_(client_key_path) {}
_ZN7httplib6detail37escape_abstract_namespace_unix_domainERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5825|  3.22k|inline std::string escape_abstract_namespace_unix_domain(const std::string &s) {
 5826|  3.22k|  if (s.size() > 1 && s[0] == '\0') {
  ------------------
  |  Branch (5826:7): [True: 3.22k, False: 0]
  |  Branch (5826:23): [True: 0, False: 3.22k]
  ------------------
 5827|      0|    auto ret = s;
 5828|      0|    ret[0] = '@';
 5829|      0|    return ret;
 5830|      0|  }
 5831|  3.22k|  return s;
 5832|  3.22k|}
_ZN7httplib6detail13write_headersERNS_6StreamERKNSt3__118unordered_multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS0_11case_ignore4hashENSB_8equal_toENS8_INS3_4pairIKSA_SA_EEEEEE:
 7523|  3.22k|inline ssize_t write_headers(Stream &strm, const Headers &headers) {
 7524|  3.22k|  ssize_t write_len = 0;
 7525|  14.8k|  for (const auto &x : headers) {
  ------------------
  |  Branch (7525:22): [True: 14.8k, False: 3.22k]
  ------------------
 7526|  14.8k|    std::string s;
 7527|  14.8k|    s = x.first;
 7528|  14.8k|    s += ": ";
 7529|  14.8k|    s += x.second;
 7530|  14.8k|    s += "\r\n";
 7531|       |
 7532|  14.8k|    auto len = strm.write(s.data(), s.size());
 7533|  14.8k|    if (len < 0) { return len; }
  ------------------
  |  Branch (7533:9): [True: 0, False: 14.8k]
  ------------------
 7534|  14.8k|    write_len += len;
 7535|  14.8k|  }
 7536|  3.22k|  auto len = strm.write("\r\n");
 7537|  3.22k|  if (len < 0) { return len; }
  ------------------
  |  Branch (7537:7): [True: 0, False: 3.22k]
  ------------------
 7538|  3.22k|  write_len += len;
 7539|  3.22k|  return write_len;
 7540|  3.22k|}
_ZN7httplib6Stream5writeEPKc:
10246|  3.22k|inline ssize_t Stream::write(const char *ptr) {
10247|  3.22k|  return write(ptr, strlen(ptr));
10248|  3.22k|}
_ZN7httplib8ResponseC2Ev:
 1449|  3.22k|  Response() = default;
_ZN7httplib8UserDataC2Ev:
 1002|  3.22k|  UserData() = default;
_ZN7httplib10ClientImpl15process_requestERNS_6StreamERNS_7RequestERNS_8ResponseEbRNS_5ErrorE:
14057|  3.22k|                                        Error &error) {
14058|       |  // Auto-add Expect: 100-continue for large bodies
14059|  3.22k|  if (CPPHTTPLIB_EXPECT_100_THRESHOLD > 0 && !req.has_header("Expect")) {
  ------------------
  |  |   82|  3.22k|#define CPPHTTPLIB_EXPECT_100_THRESHOLD 1024
  ------------------
  |  Branch (14059:7): [True: 3.22k, Folded]
  |  Branch (14059:7): [True: 3.22k, False: 0]
  |  Branch (14059:46): [True: 3.22k, False: 0]
  ------------------
14060|  3.22k|    auto body_size = req.body.empty() ? req.content_length_ : req.body.size();
  ------------------
  |  Branch (14060:22): [True: 3.22k, False: 0]
  ------------------
14061|  3.22k|    if (body_size >= CPPHTTPLIB_EXPECT_100_THRESHOLD) {
  ------------------
  |  |   82|  3.22k|#define CPPHTTPLIB_EXPECT_100_THRESHOLD 1024
  ------------------
  |  Branch (14061:9): [True: 0, False: 3.22k]
  ------------------
14062|      0|      req.set_header("Expect", "100-continue");
14063|      0|    }
14064|  3.22k|  }
14065|       |
14066|       |  // Check for Expect: 100-continue
14067|  3.22k|  auto expect_100_continue = req.get_header_value("Expect") == "100-continue";
14068|       |
14069|       |  // Send request (skip body if using Expect: 100-continue)
14070|  3.22k|  auto write_request_success =
14071|  3.22k|      write_request(strm, req, close_connection, error, expect_100_continue);
14072|       |
14073|       |#ifdef CPPHTTPLIB_SSL_ENABLED
14074|       |  if (is_ssl() && !expect_100_continue) {
14075|       |    auto is_proxy_enabled = is_proxy_enabled_for_host(host_);
14076|       |    if (!is_proxy_enabled) {
14077|       |      if (tls::is_peer_closed(socket_.ssl, socket_.sock)) {
14078|       |        error = Error::SSLPeerCouldBeClosed_;
14079|       |        output_error_log(error, &req);
14080|       |        return false;
14081|       |      }
14082|       |    }
14083|       |  }
14084|       |#endif
14085|       |
14086|       |  // Handle Expect: 100-continue.
14087|       |  //
14088|       |  // Wait for an interim/early response by attempting to read the status line
14089|       |  // under a short timeout, instead of trusting raw socket readability. Over
14090|       |  // TLS, post-handshake records (e.g. session tickets) make the socket
14091|       |  // readable without any HTTP response being available; relying on
14092|       |  // `select_read` there caused the body to be withheld forever and the
14093|       |  // request to fail with `Read` (#2458). If no status line arrives within the
14094|       |  // timeout, send the body anyway (matching curl's behavior).
14095|  3.22k|  auto status_line_read = false;
14096|  3.22k|  if (expect_100_continue && write_request_success) {
  ------------------
  |  Branch (14096:7): [True: 0, False: 3.22k]
  |  Branch (14096:30): [True: 0, False: 0]
  ------------------
14097|      0|    if (CPPHTTPLIB_EXPECT_100_TIMEOUT_MSECOND > 0) {
  ------------------
  |  |   86|      0|#define CPPHTTPLIB_EXPECT_100_TIMEOUT_MSECOND 1000
  ------------------
  |  Branch (14097:9): [True: 0, Folded]
  ------------------
14098|      0|      time_t sec = CPPHTTPLIB_EXPECT_100_TIMEOUT_MSECOND / 1000;
  ------------------
  |  |   86|      0|#define CPPHTTPLIB_EXPECT_100_TIMEOUT_MSECOND 1000
  ------------------
14099|      0|      time_t usec = (CPPHTTPLIB_EXPECT_100_TIMEOUT_MSECOND % 1000) * 1000;
  ------------------
  |  |   86|      0|#define CPPHTTPLIB_EXPECT_100_TIMEOUT_MSECOND 1000
  ------------------
14100|      0|      strm.set_read_timeout(sec, usec);
14101|      0|      status_line_read = read_response_line(strm, req, res, false);
14102|      0|      strm.set_read_timeout(read_timeout_sec_, read_timeout_usec_);
14103|      0|    }
14104|       |
14105|      0|    if (!status_line_read) {
  ------------------
  |  Branch (14105:9): [True: 0, False: 0]
  ------------------
14106|       |      // No interim response within the timeout: send the body and handle the
14107|       |      // response as usual.
14108|      0|      if (!write_request_body(strm, req, error)) { return false; }
  ------------------
  |  Branch (14108:11): [True: 0, False: 0]
  ------------------
14109|      0|      expect_100_continue = false; // Switch to normal response handling
14110|      0|    }
14111|      0|  }
14112|       |
14113|       |  // Receive response and headers
14114|       |  // When using Expect: 100-continue, don't auto-skip `100 Continue` response
14115|  3.22k|  if ((!status_line_read &&
  ------------------
  |  Branch (14115:8): [True: 3.22k, False: 0]
  ------------------
14116|  3.22k|       !read_response_line(strm, req, res, !expect_100_continue)) ||
  ------------------
  |  Branch (14116:8): [True: 408, False: 2.82k]
  ------------------
14117|  2.82k|      !detail::read_headers(strm, res.headers)) {
  ------------------
  |  Branch (14117:7): [True: 1.12k, False: 1.70k]
  ------------------
14118|  1.52k|    if (write_request_success) { error = Error::Read; }
  ------------------
  |  Branch (14118:9): [True: 1.52k, False: 0]
  ------------------
14119|  1.52k|    output_error_log(error, &req);
14120|  1.52k|    return false;
14121|  1.52k|  }
14122|       |
14123|  1.70k|  if (!write_request_success) { return false; }
  ------------------
  |  Branch (14123:7): [True: 0, False: 1.70k]
  ------------------
14124|       |
14125|       |  // Handle Expect: 100-continue response
14126|  1.70k|  if (expect_100_continue) {
  ------------------
  |  Branch (14126:7): [True: 0, False: 1.70k]
  ------------------
14127|      0|    if (res.status == StatusCode::Continue_100) {
  ------------------
  |  Branch (14127:9): [True: 0, False: 0]
  ------------------
14128|       |      // Server accepted, send the body
14129|      0|      if (!write_request_body(strm, req, error)) { return false; }
  ------------------
  |  Branch (14129:11): [True: 0, False: 0]
  ------------------
14130|       |
14131|       |      // Read the actual response
14132|      0|      res.headers.clear();
14133|      0|      res.body.clear();
14134|      0|      if (!read_response_line(strm, req, res) ||
  ------------------
  |  Branch (14134:11): [True: 0, False: 0]
  ------------------
14135|      0|          !detail::read_headers(strm, res.headers)) {
  ------------------
  |  Branch (14135:11): [True: 0, False: 0]
  ------------------
14136|      0|        error = Error::Read;
14137|      0|        output_error_log(error, &req);
14138|      0|        return false;
14139|      0|      }
14140|      0|    }
14141|       |    // If not 100 Continue, server returned an error; proceed with that response
14142|      0|  }
14143|       |
14144|       |  // Body
14145|  1.70k|  if ((res.status != StatusCode::NoContent_204) && req.method != "HEAD" &&
  ------------------
  |  Branch (14145:7): [True: 1.69k, False: 4]
  |  Branch (14145:52): [True: 1.69k, False: 0]
  ------------------
14146|  1.69k|      req.method != "CONNECT") {
  ------------------
  |  Branch (14146:7): [True: 1.69k, False: 0]
  ------------------
14147|  1.69k|    auto redirect = 300 < res.status && res.status < 400 &&
  ------------------
  |  Branch (14147:21): [True: 433, False: 1.26k]
  |  Branch (14147:41): [True: 176, False: 257]
  ------------------
14148|    176|                    res.status != StatusCode::NotModified_304 &&
  ------------------
  |  Branch (14148:21): [True: 155, False: 21]
  ------------------
14149|    155|                    follow_location_;
  ------------------
  |  Branch (14149:21): [True: 0, False: 155]
  ------------------
14150|       |
14151|  1.69k|    if (req.response_handler && !redirect) {
  ------------------
  |  Branch (14151:9): [True: 0, False: 1.69k]
  |  Branch (14151:33): [True: 0, False: 0]
  ------------------
14152|      0|      if (!req.response_handler(res)) {
  ------------------
  |  Branch (14152:11): [True: 0, False: 0]
  ------------------
14153|      0|        error = Error::Canceled;
14154|      0|        output_error_log(error, &req);
14155|      0|        return false;
14156|      0|      }
14157|      0|    }
14158|       |
14159|  1.69k|    auto out =
14160|  1.69k|        req.content_receiver
  ------------------
  |  Branch (14160:9): [True: 0, False: 1.69k]
  ------------------
14161|  1.69k|            ? static_cast<ContentReceiverWithProgress>(
14162|      0|                  [&](const char *buf, size_t n, size_t off, size_t len) {
14163|      0|                    if (redirect) { return true; }
14164|      0|                    auto ret = req.content_receiver(buf, n, off, len);
14165|      0|                    if (!ret) {
14166|      0|                      error = Error::Canceled;
14167|      0|                      output_error_log(error, &req);
14168|      0|                    }
14169|      0|                    return ret;
14170|      0|                  })
14171|  1.69k|            : static_cast<ContentReceiverWithProgress>(
14172|  1.69k|                  [&](const char *buf, size_t n, size_t /*off*/,
14173|  1.69k|                      size_t /*len*/) {
14174|  1.69k|                    assert(res.body.size() + n <= res.body.max_size());
14175|  1.69k|                    if (payload_max_length_ > 0 &&
14176|  1.69k|                        (res.body.size() >= payload_max_length_ ||
14177|  1.69k|                         n > payload_max_length_ - res.body.size())) {
14178|  1.69k|                      return false;
14179|  1.69k|                    }
14180|  1.69k|                    res.body.append(buf, n);
14181|  1.69k|                    return true;
14182|  1.69k|                  });
14183|       |
14184|  1.69k|    auto progress = [&](size_t current, size_t total) {
14185|  1.69k|      if (!req.download_progress || redirect) { return true; }
14186|  1.69k|      auto ret = req.download_progress(current, total);
14187|  1.69k|      if (!ret) {
14188|  1.69k|        error = Error::Canceled;
14189|  1.69k|        output_error_log(error, &req);
14190|  1.69k|      }
14191|  1.69k|      return ret;
14192|  1.69k|    };
14193|       |
14194|  1.69k|    if (res.has_header("Content-Length")) {
  ------------------
  |  Branch (14194:9): [True: 483, False: 1.21k]
  ------------------
14195|    483|      if (!req.content_receiver) {
  ------------------
  |  Branch (14195:11): [True: 483, False: 0]
  ------------------
14196|    483|        auto len = res.get_header_value_u64("Content-Length");
14197|    483|        if (len > res.body.max_size()) {
  ------------------
  |  Branch (14197:13): [True: 3, False: 480]
  ------------------
14198|      3|          error = Error::Read;
14199|      3|          output_error_log(error, &req);
14200|      3|          return false;
14201|      3|        }
14202|       |        // Cap the reservation by payload_max_length_ to avoid OOM when a
14203|       |        // hostile or malformed server sends an enormous Content-Length.
14204|       |        // The actual body read below is bounded by payload_max_length_,
14205|       |        // so reserving more than that is never useful.
14206|    480|        auto reserve_len = static_cast<size_t>(len);
14207|    480|        if (payload_max_length_ > 0 && reserve_len > payload_max_length_) {
  ------------------
  |  Branch (14207:13): [True: 480, False: 0]
  |  Branch (14207:40): [True: 310, False: 170]
  ------------------
14208|    310|          reserve_len = payload_max_length_;
14209|    310|        }
14210|    480|        res.body.reserve(reserve_len);
14211|    480|      }
14212|    483|    }
14213|       |
14214|  1.69k|    if (res.status != StatusCode::NotModified_304) {
  ------------------
  |  Branch (14214:9): [True: 1.67k, False: 21]
  ------------------
14215|  1.67k|      int dummy_status;
14216|  1.67k|      auto max_length = (!has_payload_max_length_ && req.content_receiver)
  ------------------
  |  Branch (14216:26): [True: 1.67k, False: 0]
  |  Branch (14216:54): [True: 0, False: 1.67k]
  ------------------
14217|  1.67k|                            ? (std::numeric_limits<size_t>::max)()
14218|  1.67k|                            : payload_max_length_;
14219|  1.67k|      if (!detail::read_content(strm, res, max_length, dummy_status,
  ------------------
  |  Branch (14219:11): [True: 1.27k, False: 402]
  ------------------
14220|  1.67k|                                std::move(progress), std::move(out),
14221|  1.67k|                                decompress_)) {
14222|  1.27k|        if (error != Error::Canceled) { error = Error::Read; }
  ------------------
  |  Branch (14222:13): [True: 1.27k, False: 0]
  ------------------
14223|  1.27k|        output_error_log(error, &req);
14224|  1.27k|        return false;
14225|  1.27k|      }
14226|  1.67k|    }
14227|  1.69k|  }
14228|       |
14229|       |  // Log
14230|    427|  output_log(req, res);
14231|       |
14232|    427|  return true;
14233|  1.70k|}
_ZNK7httplib7Request10has_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 9953|  19.3k|inline bool Request::has_header(const std::string &key) const {
 9954|  19.3k|  return detail::has_header(headers, key);
 9955|  19.3k|}
_ZN7httplib6detail10has_headerERKNSt3__118unordered_multimapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS0_11case_ignore4hashENS9_8equal_toENS6_INS1_4pairIKS8_S8_EEEEEERSD_:
 7138|  20.2k|inline bool has_header(const Headers &headers, const std::string &key) {
 7139|  20.2k|  if (is_prohibited_header_name(key)) { return false; }
  ------------------
  |  Branch (7139:7): [True: 0, False: 20.2k]
  ------------------
 7140|  20.2k|  return headers.find(key) != headers.end();
 7141|  20.2k|}
_ZN7httplib6detail25is_prohibited_header_nameERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7126|  26.8k|inline bool is_prohibited_header_name(const std::string &name) {
 7127|  26.8k|  using udl::operator""_t;
 7128|       |
 7129|  26.8k|  switch (str2tag(name)) {
 7130|      0|  case "REMOTE_ADDR"_t:
  ------------------
  |  Branch (7130:3): [True: 0, False: 26.8k]
  ------------------
 7131|      0|  case "REMOTE_PORT"_t:
  ------------------
  |  Branch (7131:3): [True: 0, False: 26.8k]
  ------------------
 7132|      0|  case "LOCAL_ADDR"_t:
  ------------------
  |  Branch (7132:3): [True: 0, False: 26.8k]
  ------------------
 7133|      0|  case "LOCAL_PORT"_t: return true;
  ------------------
  |  Branch (7133:3): [True: 0, False: 26.8k]
  ------------------
 7134|  26.8k|  default: return false;
  ------------------
  |  Branch (7134:3): [True: 26.8k, False: 0]
  ------------------
 7135|  26.8k|  }
 7136|  26.8k|}
_ZN7httplib6detail7str2tagERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 6544|  26.8k|inline unsigned int str2tag(const std::string &s) {
 6545|       |  // Iterative form of str2tag_core: the recursive constexpr version is kept
 6546|       |  // for compile-time UDL evaluation of short string literals, but at runtime
 6547|       |  // we may receive arbitrarily long inputs (e.g. fuzzed Content-Type) that
 6548|       |  // would blow the stack with one frame per character.
 6549|  26.8k|  unsigned int h = 0;
 6550|   256k|  for (auto c : s) {
  ------------------
  |  Branch (6550:15): [True: 256k, False: 26.8k]
  ------------------
 6551|   256k|    h = (((std::numeric_limits<unsigned int>::max)() >> 6) & h * 33) ^
 6552|   256k|        static_cast<unsigned char>(c);
 6553|   256k|  }
 6554|  26.8k|  return h;
 6555|  26.8k|}
_ZNK7httplib6detail11case_ignore4hashclERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  605|  70.4k|  size_t operator()(const std::string &key) const {
  606|  70.4k|    return hash_core(key.data(), key.size(), 0);
  607|  70.4k|  }
_ZNK7httplib6detail11case_ignore4hash9hash_coreEPKcmm:
  609|   946k|  size_t hash_core(const char *s, size_t l, size_t h) const {
  610|   946k|    return (l == 0) ? h
  ------------------
  |  Branch (610:12): [True: 70.4k, False: 876k]
  ------------------
  611|   946k|                    : hash_core(s + 1, l - 1,
  612|       |                                // Unsets the 6 high bits of h, therefore no
  613|       |                                // overflow happens
  614|   876k|                                (((std::numeric_limits<size_t>::max)() >> 6) &
  615|   876k|                                 h * 33) ^
  616|   876k|                                    static_cast<unsigned char>(to_lower(*s)));
  617|   946k|  }
_ZN7httplib6detail11case_ignore8to_lowerEi:
  559|  1.66M|inline unsigned char to_lower(int c) {
  560|  1.66M|  const static unsigned char table[256] = {
  561|  1.66M|      0,   1,   2,   3,   4,   5,   6,   7,   8,   9,   10,  11,  12,  13,  14,
  562|  1.66M|      15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,
  563|  1.66M|      30,  31,  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,
  564|  1.66M|      45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,
  565|  1.66M|      60,  61,  62,  63,  64,  97,  98,  99,  100, 101, 102, 103, 104, 105, 106,
  566|  1.66M|      107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
  567|  1.66M|      122, 91,  92,  93,  94,  95,  96,  97,  98,  99,  100, 101, 102, 103, 104,
  568|  1.66M|      105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
  569|  1.66M|      120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
  570|  1.66M|      135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
  571|  1.66M|      150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
  572|  1.66M|      165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
  573|  1.66M|      180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 224, 225, 226,
  574|  1.66M|      227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241,
  575|  1.66M|      242, 243, 244, 245, 246, 215, 248, 249, 250, 251, 252, 253, 254, 223, 224,
  576|  1.66M|      225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  577|  1.66M|      240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
  578|  1.66M|      255,
  579|  1.66M|  };
  580|  1.66M|  return table[(unsigned char)(char)c];
  581|  1.66M|}
_ZNK7httplib6detail11case_ignore8equal_toclERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_:
  599|   145k|  bool operator()(const std::string &a, const std::string &b) const {
  600|   145k|    return equal(a, b);
  601|   145k|  }
_ZN7httplib6detail11case_ignore5equalERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_:
  591|   147k|inline bool equal(const std::string &a, const std::string &b) {
  592|   147k|  return a.size() == b.size() &&
  ------------------
  |  Branch (592:10): [True: 146k, False: 1.19k]
  ------------------
  593|   146k|         std::equal(a.begin(), a.end(), b.begin(), [](char ca, char cb) {
  ------------------
  |  Branch (593:10): [True: 144k, False: 1.19k]
  ------------------
  594|   146k|           return to_lower(ca) == to_lower(cb);
  595|   146k|         });
  596|   147k|}
_ZZN7httplib6detail11case_ignore5equalERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_ENKUlccE_clEcc:
  593|   392k|         std::equal(a.begin(), a.end(), b.begin(), [](char ca, char cb) {
  594|   392k|           return to_lower(ca) == to_lower(cb);
  595|   392k|         });
_ZN7httplib7Request10set_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
 9967|  8.41k|                                const std::string &val) {
 9968|  8.41k|  detail::set_header(headers, key, val);
 9969|  8.41k|}
_ZN7httplib6detail10set_headerERNSt3__118unordered_multimapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS0_11case_ignore4hashENS9_8equal_toENS6_INS1_4pairIKS8_S8_EEEEEERSD_SI_:
 7179|  8.41k|                       const std::string &val) {
 7180|  8.41k|  if (fields::is_field_name(key) && fields::is_field_value(val)) {
  ------------------
  |  Branch (7180:7): [True: 8.41k, False: 0]
  |  Branch (7180:37): [True: 8.41k, False: 0]
  ------------------
 7181|  8.41k|    headers.emplace(key, val);
 7182|  8.41k|  }
 7183|  8.41k|}
_ZN7httplib6detail6fields13is_field_nameERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 8891|  38.0k|inline bool is_field_name(const std::string &s) { return is_token(s); }
_ZN7httplib6detail6fields8is_tokenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 8883|  38.0k|inline bool is_token(const std::string &s) {
 8884|  38.0k|  if (s.empty()) { return false; }
  ------------------
  |  Branch (8884:7): [True: 54, False: 38.0k]
  ------------------
 8885|   461k|  for (auto c : s) {
  ------------------
  |  Branch (8885:15): [True: 461k, False: 37.8k]
  ------------------
 8886|   461k|    if (!is_token_char(c)) { return false; }
  ------------------
  |  Branch (8886:9): [True: 131, False: 461k]
  ------------------
 8887|   461k|  }
 8888|  37.8k|  return true;
 8889|  38.0k|}
_ZN7httplib6detail6fields13is_token_charEc:
 8877|   461k|inline bool is_token_char(char c) {
 8878|   461k|  return is_ascii_alnum(c) || c == '!' || c == '#' || c == '$' || c == '%' ||
  ------------------
  |  Branch (8878:10): [True: 408k, False: 53.2k]
  |  Branch (8878:31): [True: 709, False: 52.5k]
  |  Branch (8878:43): [True: 4.17k, False: 48.3k]
  |  Branch (8878:55): [True: 2.32k, False: 46.0k]
  |  Branch (8878:67): [True: 535, False: 45.5k]
  ------------------
 8879|  45.5k|         c == '&' || c == '\'' || c == '*' || c == '+' || c == '-' ||
  ------------------
  |  Branch (8879:10): [True: 1.95k, False: 43.5k]
  |  Branch (8879:22): [True: 516, False: 43.0k]
  |  Branch (8879:35): [True: 6.47k, False: 36.5k]
  |  Branch (8879:47): [True: 2.03k, False: 34.5k]
  |  Branch (8879:59): [True: 22.3k, False: 12.2k]
  ------------------
 8880|  12.2k|         c == '.' || c == '^' || c == '_' || c == '`' || c == '|' || c == '~';
  ------------------
  |  Branch (8880:10): [True: 2.07k, False: 10.1k]
  |  Branch (8880:22): [True: 959, False: 9.18k]
  |  Branch (8880:34): [True: 6.50k, False: 2.68k]
  |  Branch (8880:46): [True: 791, False: 1.88k]
  |  Branch (8880:58): [True: 629, False: 1.26k]
  |  Branch (8880:70): [True: 1.12k, False: 131]
  ------------------
 8881|   461k|}
_ZN7httplib6detail14is_ascii_alnumEc:
  553|   461k|inline bool is_ascii_alnum(char c) {
  554|   461k|  return is_ascii_digit(c) || is_ascii_alpha(c);
  ------------------
  |  Branch (554:10): [True: 11.3k, False: 450k]
  |  Branch (554:31): [True: 397k, False: 53.2k]
  ------------------
  555|   461k|}
_ZN7httplib6detail14is_ascii_digitEc:
  547|   492k|inline bool is_ascii_digit(char c) { return '0' <= c && c <= '9'; }
  ------------------
  |  Branch (547:45): [True: 445k, False: 47.7k]
  |  Branch (547:57): [True: 33.9k, False: 411k]
  ------------------
_ZN7httplib6detail14is_ascii_alphaEc:
  549|   450k|inline bool is_ascii_alpha(char c) {
  550|   450k|  return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
  ------------------
  |  Branch (550:11): [True: 256k, False: 194k]
  |  Branch (550:23): [True: 254k, False: 1.76k]
  |  Branch (550:37): [True: 152k, False: 43.2k]
  |  Branch (550:49): [True: 142k, False: 10.0k]
  ------------------
  551|   450k|}
_ZN7httplib6detail6fields14is_field_valueERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 8924|  37.6k|inline bool is_field_value(const std::string &s) { return is_field_content(s); }
_ZN7httplib6detail6fields16is_field_contentERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 8899|  37.6k|inline bool is_field_content(const std::string &s) {
 8900|  37.6k|  if (s.empty()) { return true; }
  ------------------
  |  Branch (8900:7): [True: 10.3k, False: 27.3k]
  ------------------
 8901|       |
 8902|  27.3k|  if (s.size() == 1) {
  ------------------
  |  Branch (8902:7): [True: 4.70k, False: 22.6k]
  ------------------
 8903|  4.70k|    return is_field_vchar(s[0]);
 8904|  22.6k|  } else if (s.size() == 2) {
  ------------------
  |  Branch (8904:14): [True: 479, False: 22.1k]
  ------------------
 8905|    479|    return is_field_vchar(s[0]) && is_field_vchar(s[1]);
  ------------------
  |  Branch (8905:12): [True: 478, False: 1]
  |  Branch (8905:36): [True: 477, False: 1]
  ------------------
 8906|  22.1k|  } else {
 8907|  22.1k|    size_t i = 0;
 8908|       |
 8909|  22.1k|    if (!is_field_vchar(s[i])) { return false; }
  ------------------
  |  Branch (8909:9): [True: 4, False: 22.1k]
  ------------------
 8910|  22.1k|    i++;
 8911|       |
 8912|   360k|    while (i < s.size() - 1) {
  ------------------
  |  Branch (8912:12): [True: 338k, False: 22.1k]
  ------------------
 8913|   338k|      auto c = s[i++];
 8914|   338k|      if (c == ' ' || c == '\t' || is_field_vchar(c)) {
  ------------------
  |  Branch (8914:11): [True: 8.77k, False: 329k]
  |  Branch (8914:23): [True: 514, False: 329k]
  |  Branch (8914:36): [True: 328k, False: 26]
  ------------------
 8915|   338k|      } else {
 8916|     26|        return false;
 8917|     26|      }
 8918|   338k|    }
 8919|       |
 8920|  22.1k|    return is_field_vchar(s[i]);
 8921|  22.1k|  }
 8922|  27.3k|}
_ZN7httplib6detail6fields14is_field_vcharEc:
 8897|   379k|inline bool is_field_vchar(char c) { return is_vchar(c) || is_obs_text(c); }
  ------------------
  |  Branch (8897:45): [True: 346k, False: 32.8k]
  |  Branch (8897:60): [True: 32.7k, False: 61]
  ------------------
_ZN7httplib6detail6fields8is_vcharEc:
 8893|   379k|inline bool is_vchar(char c) { return c >= 33 && c <= 126; }
  ------------------
  |  Branch (8893:39): [True: 346k, False: 32.8k]
  |  Branch (8893:50): [True: 346k, False: 1]
  ------------------
_ZN7httplib6detail6fields11is_obs_textEc:
 8895|  32.8k|inline bool is_obs_text(char c) { return 128 <= static_cast<unsigned char>(c); }
_ZNK7httplib7Request16get_header_valueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKcm:
 9958|  3.22k|                                             const char *def, size_t id) const {
 9959|  3.22k|  return detail::get_header_value(headers, key, def, id);
 9960|  3.22k|}
_ZN7httplib6detail16get_header_valueERKNSt3__118unordered_multimapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS0_11case_ignore4hashENS9_8equal_toENS6_INS1_4pairIKS8_S8_EEEEEERSD_PKcm:
 7145|  6.58k|                                    size_t id) {
 7146|  6.58k|  if (is_prohibited_header_name(key)) {
  ------------------
  |  Branch (7146:7): [True: 0, False: 6.58k]
  ------------------
 7147|      0|#ifndef CPPHTTPLIB_NO_EXCEPTIONS
 7148|      0|    std::string msg = "Prohibited header name '" + key + "' is specified.";
 7149|      0|    throw std::invalid_argument(msg);
 7150|       |#else
 7151|       |    return "";
 7152|       |#endif
 7153|      0|  }
 7154|       |
 7155|  6.58k|  auto rng = headers.equal_range(key);
 7156|  6.58k|  auto it = rng.first;
 7157|  6.58k|  std::advance(it, static_cast<ssize_t>(id));
 7158|  6.58k|  if (it != rng.second) { return it->second.c_str(); }
  ------------------
  |  Branch (7158:7): [True: 934, False: 5.65k]
  ------------------
 7159|  5.65k|  return def;
 7160|  6.58k|}
_ZN7httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorEb:
13701|  3.22k|                                      bool skip_body) {
13702|       |  // Prepare additional headers
13703|  3.22k|  if (close_connection) {
  ------------------
  |  Branch (13703:7): [True: 0, False: 3.22k]
  ------------------
13704|      0|    if (!req.has_header("Connection")) {
  ------------------
  |  Branch (13704:9): [True: 0, False: 0]
  ------------------
13705|      0|      req.set_header("Connection", "close");
13706|      0|    }
13707|      0|  }
13708|       |
13709|  3.22k|  std::string ct_for_defaults;
13710|  3.22k|  if (!req.has_header("Content-Type") && !req.body.empty()) {
  ------------------
  |  Branch (13710:7): [True: 3.22k, False: 0]
  |  Branch (13710:7): [True: 0, False: 3.22k]
  |  Branch (13710:42): [True: 0, False: 3.22k]
  ------------------
13711|      0|    ct_for_defaults = "text/plain";
13712|      0|  }
13713|  3.22k|  prepare_default_headers(req, false, ct_for_defaults);
13714|       |
13715|  3.22k|  if (req.body.empty()) {
  ------------------
  |  Branch (13715:7): [True: 3.22k, False: 0]
  ------------------
13716|  3.22k|    if (req.content_provider_) {
  ------------------
  |  Branch (13716:9): [True: 0, False: 3.22k]
  ------------------
13717|      0|      if (!req.is_chunked_content_provider_) {
  ------------------
  |  Branch (13717:11): [True: 0, False: 0]
  ------------------
13718|      0|        if (!req.has_header("Content-Length")) {
  ------------------
  |  Branch (13718:13): [True: 0, False: 0]
  ------------------
13719|      0|          auto length = std::to_string(req.content_length_);
13720|      0|          req.set_header("Content-Length", length);
13721|      0|        }
13722|      0|      }
13723|  3.22k|    } else {
13724|  3.22k|      if (req.method == "POST" || req.method == "PUT" ||
  ------------------
  |  Branch (13724:11): [True: 810, False: 2.41k]
  |  Branch (13724:35): [True: 797, False: 1.62k]
  ------------------
13725|  1.95k|          req.method == "PATCH") {
  ------------------
  |  Branch (13725:11): [True: 350, False: 1.27k]
  ------------------
13726|  1.95k|        req.set_header("Content-Length", "0");
13727|  1.95k|      }
13728|  3.22k|    }
13729|  3.22k|  }
13730|       |
13731|  3.22k|  if (!basic_auth_password_.empty() || !basic_auth_username_.empty()) {
  ------------------
  |  Branch (13731:7): [True: 0, False: 3.22k]
  |  Branch (13731:40): [True: 0, False: 3.22k]
  ------------------
13732|      0|    if (!req.has_header("Authorization")) {
  ------------------
  |  Branch (13732:9): [True: 0, False: 0]
  ------------------
13733|      0|      req.headers.insert(make_basic_authentication_header(
13734|      0|          basic_auth_username_, basic_auth_password_, false));
13735|      0|    }
13736|      0|  }
13737|       |
13738|  3.22k|  if (!bearer_token_auth_token_.empty()) {
  ------------------
  |  Branch (13738:7): [True: 0, False: 3.22k]
  ------------------
13739|      0|    if (!req.has_header("Authorization")) {
  ------------------
  |  Branch (13739:9): [True: 0, False: 0]
  ------------------
13740|      0|      req.headers.insert(make_bearer_token_authentication_header(
13741|      0|          bearer_token_auth_token_, false));
13742|      0|    }
13743|      0|  }
13744|       |
13745|       |  // Proxy-Authorization is only sent when the proxy is actually used for
13746|       |  // this target — otherwise NO_PROXY-matched requests would leak proxy
13747|       |  // credentials directly to the destination server.
13748|  3.22k|  if (is_proxy_enabled_for_host(host_)) {
  ------------------
  |  Branch (13748:7): [True: 0, False: 3.22k]
  ------------------
13749|      0|    if (!proxy_basic_auth_username_.empty() &&
  ------------------
  |  Branch (13749:9): [True: 0, False: 0]
  |  Branch (13749:9): [True: 0, False: 0]
  ------------------
13750|      0|        !proxy_basic_auth_password_.empty() &&
  ------------------
  |  Branch (13750:9): [True: 0, False: 0]
  ------------------
13751|      0|        !req.has_header("Proxy-Authorization")) {
  ------------------
  |  Branch (13751:9): [True: 0, False: 0]
  ------------------
13752|      0|      req.headers.insert(make_basic_authentication_header(
13753|      0|          proxy_basic_auth_username_, proxy_basic_auth_password_, true));
13754|      0|    }
13755|      0|    if (!proxy_bearer_token_auth_token_.empty() &&
  ------------------
  |  Branch (13755:9): [True: 0, False: 0]
  |  Branch (13755:9): [True: 0, False: 0]
  ------------------
13756|      0|        !req.has_header("Proxy-Authorization")) {
  ------------------
  |  Branch (13756:9): [True: 0, False: 0]
  ------------------
13757|      0|      req.headers.insert(make_bearer_token_authentication_header(
13758|      0|          proxy_bearer_token_auth_token_, true));
13759|      0|    }
13760|      0|  }
13761|       |
13762|       |  // Request line and headers
13763|  3.22k|  {
13764|  3.22k|    detail::BufferStream bstrm;
13765|       |
13766|       |    // Extract path and query from req.path
13767|  3.22k|    std::string path_part, query_part;
13768|  3.22k|    auto query_pos = req.path.find('?');
13769|  3.22k|    if (query_pos != std::string::npos) {
  ------------------
  |  Branch (13769:9): [True: 0, False: 3.22k]
  ------------------
13770|      0|      path_part = req.path.substr(0, query_pos);
13771|      0|      query_part = req.path.substr(query_pos + 1);
13772|  3.22k|    } else {
13773|  3.22k|      path_part = req.path;
13774|  3.22k|      query_part = "";
13775|  3.22k|    }
13776|       |
13777|       |    // Encode path part. If the original `req.path` already contained a
13778|       |    // query component, preserve its raw query string (including parameter
13779|       |    // order) instead of reparsing and reassembling it which may reorder
13780|       |    // parameters due to container ordering (e.g. `Params` uses
13781|       |    // `std::multimap`). When there is no query in `req.path`, fall back to
13782|       |    // building a query from `req.params` so existing callers that pass
13783|       |    // `Params` continue to work.
13784|  3.22k|    auto path_with_query =
13785|  3.22k|        path_encode_ ? detail::encode_path(path_part) : path_part;
  ------------------
  |  Branch (13785:9): [True: 3.22k, False: 0]
  ------------------
13786|       |
13787|  3.22k|    if (!query_part.empty()) {
  ------------------
  |  Branch (13787:9): [True: 0, False: 3.22k]
  ------------------
13788|       |      // Normalize the query string (decode then re-encode) while preserving
13789|       |      // the original parameter order. When path encoding is disabled the
13790|       |      // caller has supplied an already-encoded target and expects the exact
13791|       |      // bytes to be sent on the wire, so skip normalization for the query
13792|       |      // too. Normalizing here would decode-then-re-encode the query and
13793|       |      // corrupt pre-encoded binary payloads (e.g. turning `%20` into `+`,
13794|       |      // which a strict RFC 3986 server decodes back as `+`, not a space).
13795|      0|      if (path_encode_) {
  ------------------
  |  Branch (13795:11): [True: 0, False: 0]
  ------------------
13796|      0|        auto normalized = detail::normalize_query_string(query_part);
13797|      0|        if (!normalized.empty()) { path_with_query += '?' + normalized; }
  ------------------
  |  Branch (13797:13): [True: 0, False: 0]
  ------------------
13798|      0|      } else {
13799|      0|        path_with_query += '?' + query_part;
13800|      0|      }
13801|       |
13802|       |      // Still populate req.params for handlers/users who read them.
13803|      0|      detail::parse_query_text(query_part, req.params);
13804|  3.22k|    } else {
13805|       |      // No query in path; parse any query_part (empty) and append params
13806|       |      // from `req.params` when present (preserves prior behavior for
13807|       |      // callers who provide Params separately).
13808|  3.22k|      detail::parse_query_text(query_part, req.params);
13809|  3.22k|      if (!req.params.empty()) {
  ------------------
  |  Branch (13809:11): [True: 0, False: 3.22k]
  ------------------
13810|      0|        path_with_query = append_query_params(path_with_query, req.params);
13811|      0|      }
13812|  3.22k|    }
13813|       |
13814|       |    // Write request line and headers
13815|  3.22k|    detail::write_request_line(bstrm, req.method, path_with_query);
13816|  3.22k|    if (!detail::check_and_write_headers(bstrm, req.headers, header_writer_,
  ------------------
  |  Branch (13816:9): [True: 0, False: 3.22k]
  ------------------
13817|  3.22k|                                         error)) {
13818|      0|      output_error_log(error, &req);
13819|      0|      return false;
13820|      0|    }
13821|       |
13822|       |    // Flush buffer
13823|  3.22k|    auto &data = bstrm.get_buffer();
13824|  3.22k|    if (!detail::write_data(strm, data.data(), data.size())) {
  ------------------
  |  Branch (13824:9): [True: 0, False: 3.22k]
  ------------------
13825|      0|      error = Error::Write;
13826|      0|      output_error_log(error, &req);
13827|      0|      return false;
13828|      0|    }
13829|  3.22k|  }
13830|       |
13831|       |  // After sending request line and headers, wait briefly for an early server
13832|       |  // response (e.g. 4xx) and avoid sending a potentially large request body
13833|       |  // unnecessarily. This workaround is only enabled on Windows because Unix
13834|       |  // platforms surface write errors (EPIPE) earlier; on Windows kernel send
13835|       |  // buffering can accept large writes even when the peer already responded.
13836|       |  // Check the stream first (which covers SSL via `is_readable()`), then
13837|       |  // fall back to select on the socket. Only perform the wait for very large
13838|       |  // request bodies to avoid interfering with normal small requests and
13839|       |  // reduce side-effects. Poll briefly (up to 50ms as default) for an early
13840|       |  // response. Skip this check when using Expect: 100-continue, as the protocol
13841|       |  // handles early responses properly.
13842|       |#if defined(_WIN32)
13843|       |  if (!skip_body &&
13844|       |      req.body.size() > CPPHTTPLIB_WAIT_EARLY_SERVER_RESPONSE_THRESHOLD &&
13845|       |      req.path.size() > CPPHTTPLIB_REQUEST_URI_MAX_LENGTH) {
13846|       |    auto start = std::chrono::high_resolution_clock::now();
13847|       |
13848|       |    for (;;) {
13849|       |      // Prefer socket-level readiness to avoid SSL_pending() false-positives
13850|       |      // from SSL internals. If the underlying socket is readable, assume an
13851|       |      // early response may be present.
13852|       |      auto sock = strm.socket();
13853|       |      if (sock != INVALID_SOCKET && detail::select_read(sock, 0, 0) > 0) {
13854|       |        return false;
13855|       |      }
13856|       |
13857|       |      // Fallback to stream-level check for non-socket streams or when the
13858|       |      // socket isn't reporting readable. Avoid using `is_readable()` for
13859|       |      // SSL, since `SSL_pending()` may report buffered records that do not
13860|       |      // indicate a complete application-level response yet.
13861|       |      if (!is_ssl() && strm.is_readable()) { return false; }
13862|       |
13863|       |      auto now = std::chrono::high_resolution_clock::now();
13864|       |      auto elapsed =
13865|       |          std::chrono::duration_cast<std::chrono::milliseconds>(now - start)
13866|       |              .count();
13867|       |      if (elapsed >= CPPHTTPLIB_WAIT_EARLY_SERVER_RESPONSE_TIMEOUT_MSECOND) {
13868|       |        break;
13869|       |      }
13870|       |
13871|       |      std::this_thread::sleep_for(std::chrono::milliseconds(1));
13872|       |    }
13873|       |  }
13874|       |#endif
13875|       |
13876|       |  // Body
13877|  3.22k|  if (skip_body) { return true; }
  ------------------
  |  Branch (13877:7): [True: 0, False: 3.22k]
  ------------------
13878|       |
13879|  3.22k|  return write_request_body(strm, req, error);
13880|  3.22k|}
_ZN7httplib10ClientImpl23prepare_default_headersERNS_7RequestEbRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
13059|  3.22k|                                                const std::string &ct) {
13060|  3.22k|  (void)for_stream;
13061|  3.22k|  for (const auto &header : default_headers_) {
  ------------------
  |  Branch (13061:27): [True: 0, False: 3.22k]
  ------------------
13062|      0|    if (!r.has_header(header.first)) { r.headers.insert(header); }
  ------------------
  |  Branch (13062:9): [True: 0, False: 0]
  ------------------
13063|      0|  }
13064|       |
13065|  3.22k|  if (!r.has_header("Host")) {
  ------------------
  |  Branch (13065:7): [True: 3.22k, False: 0]
  ------------------
13066|  3.22k|    if (address_family_ == AF_UNIX) {
  ------------------
  |  Branch (13066:9): [True: 0, False: 3.22k]
  ------------------
13067|      0|      r.headers.emplace("Host", "localhost");
13068|  3.22k|    } else {
13069|  3.22k|      r.headers.emplace(
13070|  3.22k|          "Host", detail::make_host_and_port_string(host_, port_, is_ssl()));
13071|  3.22k|    }
13072|  3.22k|  }
13073|       |
13074|  3.22k|  if (!r.has_header("Accept")) { r.headers.emplace("Accept", "*/*"); }
  ------------------
  |  Branch (13074:7): [True: 3.22k, False: 0]
  ------------------
13075|       |
13076|  3.22k|  if (!r.content_receiver) {
  ------------------
  |  Branch (13076:7): [True: 3.22k, False: 0]
  ------------------
13077|  3.22k|    if (!r.has_header("Accept-Encoding")) {
  ------------------
  |  Branch (13077:9): [True: 3.22k, False: 0]
  ------------------
13078|  3.22k|      std::string accept_encoding;
13079|       |#ifdef CPPHTTPLIB_BROTLI_SUPPORT
13080|       |      accept_encoding = "br";
13081|       |#endif
13082|  3.22k|#ifdef CPPHTTPLIB_ZLIB_SUPPORT
13083|  3.22k|      if (!accept_encoding.empty()) { accept_encoding += ", "; }
  ------------------
  |  Branch (13083:11): [True: 0, False: 3.22k]
  ------------------
13084|  3.22k|      accept_encoding += "gzip, deflate";
13085|  3.22k|#endif
13086|       |#ifdef CPPHTTPLIB_ZSTD_SUPPORT
13087|       |      if (!accept_encoding.empty()) { accept_encoding += ", "; }
13088|       |      accept_encoding += "zstd";
13089|       |#endif
13090|  3.22k|      r.set_header("Accept-Encoding", accept_encoding);
13091|  3.22k|    }
13092|       |
13093|  3.22k|#ifndef CPPHTTPLIB_NO_DEFAULT_USER_AGENT
13094|  3.22k|    if (!r.has_header("User-Agent")) {
  ------------------
  |  Branch (13094:9): [True: 3.22k, False: 0]
  ------------------
13095|  3.22k|      auto agent = std::string("cpp-httplib/") + CPPHTTPLIB_VERSION;
  ------------------
  |  |   11|  3.22k|#define CPPHTTPLIB_VERSION "0.50.1"
  ------------------
13096|  3.22k|      r.set_header("User-Agent", agent);
13097|  3.22k|    }
13098|  3.22k|#endif
13099|  3.22k|  }
13100|       |
13101|  3.22k|  if (!r.body.empty()) {
  ------------------
  |  Branch (13101:7): [True: 0, False: 3.22k]
  ------------------
13102|      0|    if (!ct.empty() && !r.has_header("Content-Type")) {
  ------------------
  |  Branch (13102:9): [True: 0, False: 0]
  |  Branch (13102:9): [True: 0, False: 0]
  |  Branch (13102:24): [True: 0, False: 0]
  ------------------
13103|      0|      r.headers.emplace("Content-Type", ct);
13104|      0|    }
13105|      0|    if (!r.has_header("Content-Length")) {
  ------------------
  |  Branch (13105:9): [True: 0, False: 0]
  ------------------
13106|      0|      r.headers.emplace("Content-Length", std::to_string(r.body.size()));
13107|      0|    }
13108|      0|  }
13109|  3.22k|}
_ZN7httplib6detail25make_host_and_port_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEib:
10775|  3.22k|                                             bool is_ssl) {
10776|  3.22k|  auto result = prepare_host_string(host);
10777|       |
10778|       |  // Append port if not default
10779|  3.22k|  if ((!is_ssl && port == 80) || (is_ssl && port == 443)) {
  ------------------
  |  Branch (10779:8): [True: 3.22k, False: 0]
  |  Branch (10779:19): [True: 0, False: 3.22k]
  |  Branch (10779:35): [True: 0, False: 3.22k]
  |  Branch (10779:45): [True: 0, False: 0]
  ------------------
10780|      0|    ; // do nothing
10781|  3.22k|  } else {
10782|  3.22k|    result += ":" + std::to_string(port);
10783|  3.22k|  }
10784|       |
10785|  3.22k|  return result;
10786|  3.22k|}
_ZN7httplib6detail19prepare_host_stringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
10762|  3.22k|inline std::string prepare_host_string(const std::string &host) {
10763|       |  // Enclose IPv6 address in brackets (but not if already enclosed)
10764|  3.22k|  if (host.find(':') == std::string::npos ||
  ------------------
  |  Branch (10764:7): [True: 3.22k, False: 0]
  ------------------
10765|  3.22k|      (!host.empty() && host[0] == '[')) {
  ------------------
  |  Branch (10765:8): [True: 0, False: 0]
  |  Branch (10765:25): [True: 0, False: 0]
  ------------------
10766|       |    // IPv4, hostname, or already bracketed IPv6
10767|  3.22k|    return host;
10768|  3.22k|  } else {
10769|       |    // IPv6 address without brackets
10770|      0|    return "[" + host + "]";
10771|      0|  }
10772|  3.22k|}
_ZNK7httplib10ClientImpl25is_proxy_enabled_for_hostERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
12806|  3.22k|ClientImpl::is_proxy_enabled_for_host(const std::string &host) const {
12807|  3.22k|  if (proxy_host_.empty() || proxy_port_ == -1) { return false; }
  ------------------
  |  Branch (12807:7): [True: 3.22k, False: 0]
  |  Branch (12807:30): [True: 0, False: 0]
  ------------------
12808|      0|  if (no_proxy_entries_.empty()) { return true; }
  ------------------
  |  Branch (12808:7): [True: 0, False: 0]
  ------------------
12809|       |  // host_ is const so its normalized form is invariant; cache it. The
12810|       |  // cross-host path (setup_redirect_client passing next_host) re-normalizes.
12811|      0|  if (host == host_) {
  ------------------
  |  Branch (12811:7): [True: 0, False: 0]
  ------------------
12812|      0|    if (!host_normalized_valid_) {
  ------------------
  |  Branch (12812:9): [True: 0, False: 0]
  ------------------
12813|      0|      host_normalized_ = detail::normalize_target(host_);
12814|      0|      host_normalized_valid_ = true;
12815|      0|    }
12816|      0|    return !detail::host_matches_no_proxy(host_normalized_, no_proxy_entries_);
12817|      0|  }
12818|      0|  auto target = detail::normalize_target(host);
12819|      0|  return !detail::host_matches_no_proxy(target, no_proxy_entries_);
12820|      0|}
_ZN7httplib6detail12BufferStreamC2Ev:
 3196|  3.22k|  BufferStream() = default;
_ZN7httplib6detail11encode_pathERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 5106|  3.22k|inline std::string encode_path(const std::string &s) {
 5107|  3.22k|  std::string result;
 5108|  3.22k|  result.reserve(s.size());
 5109|       |
 5110|  6.45k|  for (size_t i = 0; s[i]; i++) {
  ------------------
  |  Branch (5110:22): [True: 3.22k, False: 3.22k]
  ------------------
 5111|  3.22k|    switch (s[i]) {
 5112|      0|    case ' ': result += "%20"; break;
  ------------------
  |  Branch (5112:5): [True: 0, False: 3.22k]
  ------------------
 5113|      0|    case '+': result += "%2B"; break;
  ------------------
  |  Branch (5113:5): [True: 0, False: 3.22k]
  ------------------
 5114|      0|    case '\r': result += "%0D"; break;
  ------------------
  |  Branch (5114:5): [True: 0, False: 3.22k]
  ------------------
 5115|      0|    case '\n': result += "%0A"; break;
  ------------------
  |  Branch (5115:5): [True: 0, False: 3.22k]
  ------------------
 5116|      0|    case '\'': result += "%27"; break;
  ------------------
  |  Branch (5116:5): [True: 0, False: 3.22k]
  ------------------
 5117|      0|    case ',': result += "%2C"; break;
  ------------------
  |  Branch (5117:5): [True: 0, False: 3.22k]
  ------------------
 5118|       |    // case ':': result += "%3A"; break; // ok? probably...
 5119|      0|    case ';': result += "%3B"; break;
  ------------------
  |  Branch (5119:5): [True: 0, False: 3.22k]
  ------------------
 5120|  3.22k|    default:
  ------------------
  |  Branch (5120:5): [True: 3.22k, False: 0]
  ------------------
 5121|  3.22k|      auto c = static_cast<uint8_t>(s[i]);
 5122|  3.22k|      if (c >= 0x80) {
  ------------------
  |  Branch (5122:11): [True: 0, False: 3.22k]
  ------------------
 5123|      0|        result += '%';
 5124|      0|        char hex[4];
 5125|      0|        auto len = snprintf(hex, sizeof(hex) - 1, "%02X", c);
 5126|      0|        assert(len == 2);
  ------------------
  |  Branch (5126:9): [True: 0, False: 0]
  ------------------
 5127|      0|        result.append(hex, static_cast<size_t>(len));
 5128|  3.22k|      } else {
 5129|  3.22k|        result += s[i];
 5130|  3.22k|      }
 5131|  3.22k|      break;
 5132|  3.22k|    }
 5133|  3.22k|  }
 5134|       |
 5135|  3.22k|  return result;
 5136|  3.22k|}
_ZN7httplib6detail5splitEPKcS2_cNSt3__18functionIFvS2_S2_EEE:
 5334|  3.22k|                  std::function<void(const char *, const char *)> fn) {
 5335|  3.22k|  return split(b, e, d, (std::numeric_limits<size_t>::max)(), std::move(fn));
 5336|  3.22k|}
_ZN7httplib6detail5splitEPKcS2_cmNSt3__18functionIFvS2_S2_EEE:
 5339|  3.22k|                  std::function<void(const char *, const char *)> fn) {
 5340|  3.22k|  size_t i = 0;
 5341|  3.22k|  size_t beg = 0;
 5342|  3.22k|  size_t count = 1;
 5343|       |
 5344|  3.22k|  while (e ? (b + i < e) : (b[i] != '\0')) {
  ------------------
  |  Branch (5344:10): [True: 3.22k, False: 0]
  |  Branch (5344:10): [True: 0, False: 3.22k]
  ------------------
 5345|      0|    if (b[i] == d && count < m) {
  ------------------
  |  Branch (5345:9): [True: 0, False: 0]
  |  Branch (5345:22): [True: 0, False: 0]
  ------------------
 5346|      0|      auto r = trim(b, e, beg, i);
 5347|      0|      if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5347:11): [True: 0, False: 0]
  ------------------
 5348|      0|      beg = i + 1;
 5349|      0|      count++;
 5350|      0|    }
 5351|      0|    i++;
 5352|      0|  }
 5353|       |
 5354|  3.22k|  if (i) {
  ------------------
  |  Branch (5354:7): [True: 0, False: 3.22k]
  ------------------
 5355|      0|    auto r = trim(b, e, beg, i);
 5356|      0|    if (r.first < r.second) { fn(&b[r.first], &b[r.second]); }
  ------------------
  |  Branch (5356:9): [True: 0, False: 0]
  ------------------
 5357|      0|  }
 5358|  3.22k|}
_ZN7httplib6detail15is_space_or_tabEc:
 5145|  25.0k|inline bool is_space_or_tab(char c) { return c == ' ' || c == '\t'; }
  ------------------
  |  Branch (5145:46): [True: 942, False: 24.1k]
  |  Branch (5145:58): [True: 597, False: 23.5k]
  ------------------
_ZN7httplib6detail6is_hexEcRi:
 4496|  17.7k|inline bool is_hex(char c, int &v) {
 4497|  17.7k|  if (is_ascii_digit(c)) {
  ------------------
  |  Branch (4497:7): [True: 9.37k, False: 8.37k]
  ------------------
 4498|  9.37k|    v = c - '0';
 4499|  9.37k|    return true;
 4500|  9.37k|  } else if ('A' <= c && c <= 'F') {
  ------------------
  |  Branch (4500:14): [True: 3.63k, False: 4.74k]
  |  Branch (4500:26): [True: 979, False: 2.65k]
  ------------------
 4501|    979|    v = c - 'A' + 10;
 4502|    979|    return true;
 4503|  7.40k|  } else if ('a' <= c && c <= 'f') {
  ------------------
  |  Branch (4503:14): [True: 2.64k, False: 4.75k]
  |  Branch (4503:26): [True: 2.63k, False: 8]
  ------------------
 4504|  2.63k|    v = c - 'a' + 10;
 4505|  2.63k|    return true;
 4506|  2.63k|  }
 4507|  4.76k|  return false;
 4508|  17.7k|}
_ZN7httplib6detail16parse_query_textERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_8multimapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
 7840|  3.22k|inline void parse_query_text(const std::string &s, Params &params) {
 7841|  3.22k|  parse_query_text(s.data(), s.size(), params);
 7842|  3.22k|}
_ZN7httplib6detail16parse_query_textEPKcmRNSt3__18multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS3_4lessISA_EENS8_INS3_4pairIKSA_SA_EEEEEE:
 7818|  3.22k|                             Params &params) {
 7819|  3.22k|  std::set<std::string> cache;
 7820|  3.22k|  split(data, data + size, '&', [&](const char *b, const char *e) {
 7821|  3.22k|    std::string kv(b, e);
 7822|  3.22k|    if (cache.find(kv) != cache.end()) { return; }
 7823|  3.22k|    cache.insert(std::move(kv));
 7824|       |
 7825|  3.22k|    std::string key;
 7826|  3.22k|    std::string val;
 7827|  3.22k|    divide(b, static_cast<std::size_t>(e - b), '=',
 7828|  3.22k|           [&](const char *lhs_data, std::size_t lhs_size, const char *rhs_data,
 7829|  3.22k|               std::size_t rhs_size) {
 7830|  3.22k|             key.assign(lhs_data, lhs_size);
 7831|  3.22k|             val.assign(rhs_data, rhs_size);
 7832|  3.22k|           });
 7833|       |
 7834|  3.22k|    if (!key.empty()) {
 7835|  3.22k|      params.emplace(decode_query_component(key), decode_query_component(val));
 7836|  3.22k|    }
 7837|  3.22k|  });
 7838|  3.22k|}
_ZN7httplib6detail18write_request_lineERNS_6StreamERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_:
 7506|  3.22k|                                  const std::string &path) {
 7507|  3.22k|  std::string s = method;
 7508|  3.22k|  s += ' ';
 7509|  3.22k|  s += path;
 7510|  3.22k|  s += " HTTP/1.1\r\n";
 7511|  3.22k|  return strm.write(s.data(), s.size());
 7512|  3.22k|}
_ZN7httplib6detail23check_and_write_headersINSt3__18functionIFlRNS_6StreamERNS2_18unordered_multimapINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESC_NS0_11case_ignore4hashENSD_8equal_toENSA_INS2_4pairIKSC_SC_EEEEEEEEEEEbS5_SL_T_RNS_5ErrorE:
10966|  3.22k|                                    T header_writer, Error &error) {
10967|  14.8k|  for (const auto &h : headers) {
  ------------------
  |  Branch (10967:22): [True: 14.8k, False: 3.22k]
  ------------------
10968|  14.8k|    if (!detail::fields::is_field_name(h.first) ||
  ------------------
  |  Branch (10968:9): [True: 0, False: 14.8k]
  ------------------
10969|  14.8k|        !detail::fields::is_field_value(h.second)) {
  ------------------
  |  Branch (10969:9): [True: 0, False: 14.8k]
  ------------------
10970|      0|      error = Error::InvalidHeaders;
10971|      0|      return false;
10972|      0|    }
10973|  14.8k|  }
10974|  3.22k|  if (header_writer(strm, headers) <= 0) {
  ------------------
  |  Branch (10974:7): [True: 0, False: 3.22k]
  ------------------
10975|      0|    error = Error::Write;
10976|      0|    return false;
10977|      0|  }
10978|  3.22k|  return true;
10979|  3.22k|}
_ZNK7httplib6detail12BufferStream10get_bufferEv:
10662|  3.22k|inline const std::string &BufferStream::get_buffer() const { return buffer; }
_ZN7httplib6detail10write_dataERNS_6StreamEPKcm:
 7542|  3.22k|inline bool write_data(Stream &strm, const char *d, size_t l) {
 7543|  3.22k|  size_t offset = 0;
 7544|  6.45k|  while (offset < l) {
  ------------------
  |  Branch (7544:10): [True: 3.22k, False: 3.22k]
  ------------------
 7545|  3.22k|    auto length = strm.write(d + offset, l - offset);
 7546|  3.22k|    if (length < 0) { return false; }
  ------------------
  |  Branch (7546:9): [True: 0, False: 3.22k]
  ------------------
 7547|  3.22k|    offset += static_cast<size_t>(length);
 7548|  3.22k|  }
 7549|  3.22k|  return true;
 7550|  3.22k|}
_ZNK7httplib10ClientImpl18read_response_lineERNS_6StreamERKNS_7RequestERNS_8ResponseEb:
12903|  3.22k|                                           bool skip_100_continue) const {
12904|  3.22k|  std::array<char, 2048> buf{};
12905|       |
12906|  3.22k|  detail::stream_line_reader line_reader(strm, buf.data(), buf.size());
12907|       |
12908|  3.22k|  if (!line_reader.getline()) { return false; }
  ------------------
  |  Branch (12908:7): [True: 8, False: 3.22k]
  ------------------
12909|       |
12910|       |#ifdef CPPHTTPLIB_ALLOW_LF_AS_LINE_TERMINATOR
12911|       |  thread_local const std::regex re("(HTTP/1\\.[01]) (\\d{3})(?: (.*?))?\r?\n");
12912|       |#else
12913|  3.22k|  thread_local const std::regex re("(HTTP/1\\.[01]) (\\d{3})(?: (.*?))?\r\n");
12914|  3.22k|#endif
12915|       |
12916|  3.22k|  std::cmatch m;
12917|  3.22k|  if (!std::regex_match(line_reader.ptr(), m, re)) {
  ------------------
  |  Branch (12917:7): [True: 217, False: 3.00k]
  ------------------
12918|    217|    return req.method == "CONNECT";
12919|    217|  }
12920|  3.00k|  res.version = std::string(m[1]);
12921|  3.00k|  res.status = std::stoi(std::string(m[2]));
12922|  3.00k|  res.reason = std::string(m[3]);
12923|       |
12924|       |  // Ignore '100 Continue' (only when not using Expect: 100-continue explicitly)
12925|  8.87k|  while (skip_100_continue && res.status == StatusCode::Continue_100) {
  ------------------
  |  Branch (12925:10): [True: 8.87k, False: 0]
  |  Branch (12925:31): [True: 6.05k, False: 2.82k]
  ------------------
12926|  6.05k|    if (!line_reader.getline()) { return false; } // CRLF
  ------------------
  |  Branch (12926:9): [True: 39, False: 6.01k]
  ------------------
12927|  6.01k|    if (!line_reader.getline()) { return false; } // next response line
  ------------------
  |  Branch (12927:9): [True: 14, False: 6.00k]
  ------------------
12928|       |
12929|  6.00k|    if (!std::regex_match(line_reader.ptr(), m, re)) { return false; }
  ------------------
  |  Branch (12929:9): [True: 130, False: 5.87k]
  ------------------
12930|  5.87k|    res.version = std::string(m[1]);
12931|  5.87k|    res.status = std::stoi(std::string(m[2]));
12932|  5.87k|    res.reason = std::string(m[3]);
12933|  5.87k|  }
12934|       |
12935|  2.82k|  return true;
12936|  3.00k|}
_ZN7httplib6detail18stream_line_readerC2ERNS_6StreamEPcm:
 5398|  15.1k|    : strm_(strm), fixed_buffer_(fixed_buffer),
 5399|  15.1k|      fixed_buffer_size_(fixed_buffer_size) {}
_ZN7httplib6detail18stream_line_reader7getlineEv:
 5422|  41.6k|inline bool stream_line_reader::getline() {
 5423|  41.6k|  fixed_buffer_used_size_ = 0;
 5424|  41.6k|  growable_buffer_.clear();
 5425|       |
 5426|  41.6k|#ifndef CPPHTTPLIB_ALLOW_LF_AS_LINE_TERMINATOR
 5427|  41.6k|  char prev_byte = 0;
 5428|  41.6k|#endif
 5429|       |
 5430|  1.80M|  for (size_t i = 0;; i++) {
 5431|  1.80M|    if (size() >= CPPHTTPLIB_MAX_LINE_LENGTH) {
  ------------------
  |  |  189|  1.80M|#define CPPHTTPLIB_MAX_LINE_LENGTH 32768
  ------------------
  |  Branch (5431:9): [True: 2, False: 1.80M]
  ------------------
 5432|       |      // Treat exceptionally long lines as an error to
 5433|       |      // prevent infinite loops/memory exhaustion
 5434|      2|      return false;
 5435|      2|    }
 5436|  1.80M|    char byte;
 5437|  1.80M|    auto n = strm_.read(&byte, 1);
 5438|       |
 5439|  1.80M|    if (n < 0) {
  ------------------
  |  Branch (5439:9): [True: 0, False: 1.80M]
  ------------------
 5440|      0|      return false;
 5441|  1.80M|    } else if (n == 0) {
  ------------------
  |  Branch (5441:16): [True: 1.65k, False: 1.80M]
  ------------------
 5442|  1.65k|      if (i == 0) {
  ------------------
  |  Branch (5442:11): [True: 785, False: 869]
  ------------------
 5443|    785|        return false;
 5444|    869|      } else {
 5445|    869|        break;
 5446|    869|      }
 5447|  1.65k|    }
 5448|       |
 5449|  1.80M|    append(byte);
 5450|       |
 5451|       |#ifdef CPPHTTPLIB_ALLOW_LF_AS_LINE_TERMINATOR
 5452|       |    if (byte == '\n') { break; }
 5453|       |#else
 5454|  1.80M|    if (prev_byte == '\r' && byte == '\n') { break; }
  ------------------
  |  Branch (5454:9): [True: 41.2k, False: 1.76M]
  |  Branch (5454:30): [True: 40.0k, False: 1.26k]
  ------------------
 5455|  1.76M|    prev_byte = byte;
 5456|  1.76M|#endif
 5457|  1.76M|  }
 5458|       |
 5459|  40.8k|  return true;
 5460|  41.6k|}
_ZNK7httplib6detail18stream_line_reader4sizeEv:
 5409|  1.87M|inline size_t stream_line_reader::size() const {
 5410|  1.87M|  if (growable_buffer_.empty()) {
  ------------------
  |  Branch (5410:7): [True: 756k, False: 1.12M]
  ------------------
 5411|   756k|    return fixed_buffer_used_size_;
 5412|  1.12M|  } else {
 5413|  1.12M|    return growable_buffer_.size();
 5414|  1.12M|  }
 5415|  1.87M|}
_ZN7httplib6detail18stream_line_reader6appendEc:
 5462|  1.80M|inline void stream_line_reader::append(char c) {
 5463|  1.80M|  if (fixed_buffer_used_size_ < fixed_buffer_size_ - 1) {
  ------------------
  |  Branch (5463:7): [True: 684k, False: 1.12M]
  ------------------
 5464|   684k|    fixed_buffer_[fixed_buffer_used_size_++] = c;
 5465|   684k|    fixed_buffer_[fixed_buffer_used_size_] = '\0';
 5466|  1.12M|  } else {
 5467|  1.12M|    if (growable_buffer_.empty()) {
  ------------------
  |  Branch (5467:9): [True: 826, False: 1.12M]
  ------------------
 5468|    826|      assert(fixed_buffer_[fixed_buffer_used_size_] == '\0');
  ------------------
  |  Branch (5468:7): [True: 826, False: 0]
  ------------------
 5469|    826|      growable_buffer_.assign(fixed_buffer_, fixed_buffer_used_size_);
 5470|    826|    }
 5471|  1.12M|    growable_buffer_ += c;
 5472|  1.12M|  }
 5473|  1.80M|}
_ZNK7httplib6detail18stream_line_reader3ptrEv:
 5401|  64.4k|inline const char *stream_line_reader::ptr() const {
 5402|  64.4k|  if (growable_buffer_.empty()) {
  ------------------
  |  Branch (5402:7): [True: 63.3k, False: 1.14k]
  ------------------
 5403|  63.3k|    return fixed_buffer_;
 5404|  63.3k|  } else {
 5405|  1.14k|    return growable_buffer_.data();
 5406|  1.14k|  }
 5407|  64.4k|}
_ZN7httplib10ClientImpl18write_request_bodyERNS_6StreamERNS_7RequestERNS_5ErrorE:
13883|  3.22k|                                           Error &error) {
13884|  3.22k|  if (req.body.empty()) {
  ------------------
  |  Branch (13884:7): [True: 3.22k, False: 0]
  ------------------
13885|  3.22k|    return write_content_with_provider(strm, req, error);
13886|  3.22k|  }
13887|       |
13888|      0|  if (req.upload_progress) {
  ------------------
  |  Branch (13888:7): [True: 0, False: 0]
  ------------------
13889|      0|    auto body_size = req.body.size();
13890|      0|    size_t written = 0;
13891|      0|    auto data = req.body.data();
13892|       |
13893|      0|    while (written < body_size) {
  ------------------
  |  Branch (13893:12): [True: 0, False: 0]
  ------------------
13894|      0|      size_t to_write = (std::min)(CPPHTTPLIB_SEND_BUFSIZ, body_size - written);
  ------------------
  |  |  154|      0|#define CPPHTTPLIB_SEND_BUFSIZ size_t(16384u)
  ------------------
13895|      0|      if (!detail::write_data(strm, data + written, to_write)) {
  ------------------
  |  Branch (13895:11): [True: 0, False: 0]
  ------------------
13896|      0|        error = Error::Write;
13897|      0|        output_error_log(error, &req);
13898|      0|        return false;
13899|      0|      }
13900|      0|      written += to_write;
13901|       |
13902|      0|      if (!req.upload_progress(written, body_size)) {
  ------------------
  |  Branch (13902:11): [True: 0, False: 0]
  ------------------
13903|      0|        error = Error::Canceled;
13904|      0|        output_error_log(error, &req);
13905|      0|        return false;
13906|      0|      }
13907|      0|    }
13908|      0|  } else {
13909|      0|    if (!detail::write_data(strm, req.body.data(), req.body.size())) {
  ------------------
  |  Branch (13909:9): [True: 0, False: 0]
  ------------------
13910|      0|      error = Error::Write;
13911|      0|      output_error_log(error, &req);
13912|      0|      return false;
13913|      0|    }
13914|      0|  }
13915|       |
13916|      0|  return true;
13917|      0|}
_ZNK7httplib10ClientImpl27write_content_with_providerERNS_6StreamERKNS_7RequestERNS_5ErrorE:
13680|  3.22k|                                                    Error &error) const {
13681|  3.22k|  auto is_shutting_down = []() { return false; };
13682|       |
13683|  3.22k|  if (req.is_chunked_content_provider_) {
  ------------------
  |  Branch (13683:7): [True: 0, False: 3.22k]
  ------------------
13684|      0|    auto compressor = compress_ ? detail::create_compressor().first
  ------------------
  |  Branch (13684:23): [True: 0, False: 0]
  ------------------
13685|      0|                                : std::unique_ptr<detail::compressor>();
13686|      0|    if (!compressor) {
  ------------------
  |  Branch (13686:9): [True: 0, False: 0]
  ------------------
13687|      0|      compressor = detail::make_unique<detail::nocompressor>();
13688|      0|    }
13689|       |
13690|      0|    return detail::write_content_chunked(strm, req.content_provider_,
13691|      0|                                         is_shutting_down, *compressor, error);
13692|  3.22k|  } else {
13693|  3.22k|    return detail::write_content_with_progress(
13694|  3.22k|        strm, req.content_provider_, 0, req.content_length_, is_shutting_down,
13695|  3.22k|        req.upload_progress, error);
13696|  3.22k|  }
13697|  3.22k|}
_ZN7httplib8DataSinkC2Ev:
 1101|  3.22k|  DataSink() : os(&sb_), sb_(*this) {}
_ZN7httplib8DataSink19data_sink_streambufC2ERS0_:
 1117|  3.22k|    explicit data_sink_streambuf(DataSink &sink) : sink_(sink) {}
_ZN7httplib6detail27write_content_with_progressIZNKS_10ClientImpl27write_content_with_providerERNS_6StreamERKNS_7RequestERNS_5ErrorEEUlvE_EEbS4_RKNSt3__18functionIFbmmRNS_8DataSinkEEEEmmT_RKNSC_IFbmmEEES9_:
 7558|  3.22k|                                        Error &error) {
 7559|  3.22k|  size_t end_offset = offset + length;
 7560|  3.22k|  size_t start_offset = offset;
 7561|  3.22k|  auto ok = true;
 7562|  3.22k|  DataSink data_sink;
 7563|       |
 7564|  3.22k|  data_sink.write = [&](const char *d, size_t l) -> bool {
 7565|  3.22k|    if (ok) {
 7566|  3.22k|      if (write_data(strm, d, l)) {
 7567|  3.22k|        offset += l;
 7568|       |
 7569|  3.22k|        if (upload_progress && length > 0) {
 7570|  3.22k|          size_t current_written = offset - start_offset;
 7571|  3.22k|          if (!upload_progress(current_written, length)) {
 7572|  3.22k|            ok = false;
 7573|  3.22k|            return false;
 7574|  3.22k|          }
 7575|  3.22k|        }
 7576|  3.22k|      } else {
 7577|  3.22k|        ok = false;
 7578|  3.22k|      }
 7579|  3.22k|    }
 7580|  3.22k|    return ok;
 7581|  3.22k|  };
 7582|       |
 7583|  3.22k|  data_sink.is_writable = [&]() -> bool { return strm.is_peer_alive(); };
 7584|       |
 7585|  3.22k|  while (offset < end_offset && !is_shutting_down()) {
  ------------------
  |  Branch (7585:10): [True: 0, False: 3.22k]
  |  Branch (7585:33): [True: 0, False: 0]
  ------------------
 7586|      0|    if (!strm.wait_writable() || !strm.is_peer_alive()) {
  ------------------
  |  Branch (7586:9): [True: 0, False: 0]
  |  Branch (7586:34): [True: 0, False: 0]
  ------------------
 7587|      0|      error = Error::Write;
 7588|      0|      return false;
 7589|      0|    } else if (!content_provider(offset, end_offset - offset, data_sink)) {
  ------------------
  |  Branch (7589:16): [True: 0, False: 0]
  ------------------
 7590|      0|      error = Error::Canceled;
 7591|      0|      return false;
 7592|      0|    } else if (!ok) {
  ------------------
  |  Branch (7592:16): [True: 0, False: 0]
  ------------------
 7593|      0|      error = Error::Write;
 7594|      0|      return false;
 7595|      0|    }
 7596|      0|  }
 7597|       |
 7598|  3.22k|  if (offset < end_offset) { // exited due to is_shutting_down(), not completion
  ------------------
  |  Branch (7598:7): [True: 0, False: 3.22k]
  ------------------
 7599|      0|    error = Error::Write;
 7600|      0|    return false;
 7601|      0|  }
 7602|       |
 7603|  3.22k|  error = Error::Success;
 7604|  3.22k|  return true;
 7605|  3.22k|}
_ZN7httplib6detail12read_headersERNS_6StreamERNSt3__118unordered_multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS0_11case_ignore4hashENSB_8equal_toENS8_INS3_4pairIKSA_SA_EEEEEE:
 7185|  2.82k|inline bool read_headers(Stream &strm, Headers &headers) {
 7186|  2.82k|  const auto bufsiz = 2048;
 7187|  2.82k|  char buf[bufsiz];
 7188|  2.82k|  stream_line_reader line_reader(strm, buf, bufsiz);
 7189|       |
 7190|  2.82k|  size_t header_count = 0;
 7191|       |
 7192|  14.1k|  for (;;) {
 7193|  14.1k|    if (!line_reader.getline()) { return false; }
  ------------------
  |  Branch (7193:9): [True: 631, False: 13.5k]
  ------------------
 7194|       |
 7195|       |    // Check if the line ends with CRLF.
 7196|  13.5k|    auto line_terminator_len = 2;
 7197|  13.5k|    if (line_reader.end_with_crlf()) {
  ------------------
  |  Branch (7197:9): [True: 13.4k, False: 88]
  ------------------
 7198|       |      // Blank line indicates end of headers.
 7199|  13.4k|      if (line_reader.size() == 2) { break; }
  ------------------
  |  Branch (7199:11): [True: 1.83k, False: 11.6k]
  ------------------
 7200|  13.4k|    } else {
 7201|       |#ifdef CPPHTTPLIB_ALLOW_LF_AS_LINE_TERMINATOR
 7202|       |      // Blank line indicates end of headers.
 7203|       |      if (line_reader.size() == 1) { break; }
 7204|       |      line_terminator_len = 1;
 7205|       |#else
 7206|     88|      continue; // Skip invalid line.
 7207|     88|#endif
 7208|     88|    }
 7209|       |
 7210|  11.6k|    if (line_reader.size() > CPPHTTPLIB_HEADER_MAX_LENGTH) { return false; }
  ------------------
  |  |  114|  11.6k|#define CPPHTTPLIB_HEADER_MAX_LENGTH 8192
  ------------------
  |  Branch (7210:9): [True: 3, False: 11.6k]
  ------------------
 7211|       |
 7212|       |    // Check header count limit
 7213|  11.6k|    if (header_count >= CPPHTTPLIB_HEADER_MAX_COUNT) { return false; }
  ------------------
  |  |  118|  11.6k|#define CPPHTTPLIB_HEADER_MAX_COUNT 100
  ------------------
  |  Branch (7213:9): [True: 1, False: 11.6k]
  ------------------
 7214|       |
 7215|       |    // Exclude line terminator
 7216|  11.6k|    auto end = line_reader.ptr() + line_reader.size() - line_terminator_len;
 7217|       |
 7218|  11.6k|    if (!parse_header(line_reader.ptr(), end,
  ------------------
  |  Branch (7218:9): [True: 347, False: 11.2k]
  ------------------
 7219|  11.6k|                      [&](const std::string &key, const std::string &val) {
 7220|  11.6k|                        headers.emplace(key, val);
 7221|  11.6k|                      })) {
 7222|    347|      return false;
 7223|    347|    }
 7224|       |
 7225|  11.2k|    header_count++;
 7226|  11.2k|  }
 7227|       |
 7228|       |  // RFC 9110 Section 8.6: Reject requests with multiple Content-Length
 7229|       |  // headers that have different values to prevent request smuggling.
 7230|  1.83k|  auto cl_range = headers.equal_range("Content-Length");
 7231|  1.83k|  if (cl_range.first != cl_range.second) {
  ------------------
  |  Branch (7231:7): [True: 622, False: 1.21k]
  ------------------
 7232|    622|    const auto &first_val = cl_range.first->second;
 7233|  1.09k|    for (auto it = std::next(cl_range.first); it != cl_range.second; ++it) {
  ------------------
  |  Branch (7233:47): [True: 614, False: 483]
  ------------------
 7234|    614|      if (it->second != first_val) { return false; }
  ------------------
  |  Branch (7234:11): [True: 139, False: 475]
  ------------------
 7235|    614|    }
 7236|    622|  }
 7237|       |
 7238|  1.70k|  return true;
 7239|  1.83k|}
_ZNK7httplib6detail18stream_line_reader13end_with_crlfEv:
 5417|  13.5k|inline bool stream_line_reader::end_with_crlf() const {
 5418|  13.5k|  auto end = ptr() + size();
 5419|  13.5k|  return size() >= 2 && end[-2] == '\r' && end[-1] == '\n';
  ------------------
  |  Branch (5419:10): [True: 13.5k, False: 42]
  |  Branch (5419:25): [True: 13.4k, False: 28]
  |  Branch (5419:44): [True: 13.4k, False: 18]
  ------------------
 5420|  13.5k|}
_ZN7httplib6detail12parse_headerIZNS0_12read_headersERNS_6StreamERNSt3__118unordered_multimapINS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEESB_NS0_11case_ignore4hashENSC_8equal_toENS9_INS4_4pairIKSB_SB_EEEEEEEUlRSG_SL_E_EEbPKcSO_T_:
 5151|  11.6k|inline bool parse_header(const char *beg, const char *end, T fn) {
 5152|       |  // Skip trailing spaces and tabs.
 5153|  12.0k|  while (beg < end && is_space_or_tab(end[-1])) {
  ------------------
  |  Branch (5153:10): [True: 12.0k, False: 14]
  |  Branch (5153:23): [True: 392, False: 11.6k]
  ------------------
 5154|    392|    end--;
 5155|    392|  }
 5156|       |
 5157|  11.6k|  auto p = beg;
 5158|   245k|  while (p < end && *p != ':') {
  ------------------
  |  Branch (5158:10): [True: 245k, False: 281]
  |  Branch (5158:21): [True: 233k, False: 11.3k]
  ------------------
 5159|   233k|    p++;
 5160|   233k|  }
 5161|       |
 5162|  11.6k|  auto name = std::string(beg, p);
 5163|  11.6k|  if (!detail::fields::is_field_name(name)) { return false; }
  ------------------
  |  Branch (5163:7): [True: 119, False: 11.5k]
  ------------------
 5164|       |
 5165|  11.5k|  if (p == end) { return false; }
  ------------------
  |  Branch (5165:7): [True: 183, False: 11.3k]
  ------------------
 5166|       |
 5167|  11.3k|  auto key_end = p;
 5168|       |
 5169|  11.3k|  if (*p++ != ':') { return false; }
  ------------------
  |  Branch (5169:7): [True: 0, False: 11.3k]
  ------------------
 5170|       |
 5171|  11.5k|  while (p < end && is_space_or_tab(*p)) {
  ------------------
  |  Branch (5171:10): [True: 3.28k, False: 8.28k]
  |  Branch (5171:21): [True: 245, False: 3.03k]
  ------------------
 5172|    245|    p++;
 5173|    245|  }
 5174|       |
 5175|  11.3k|  if (p <= end) {
  ------------------
  |  Branch (5175:7): [True: 11.3k, False: 0]
  ------------------
 5176|  11.3k|    auto key_len = key_end - beg;
 5177|  11.3k|    if (!key_len) { return false; }
  ------------------
  |  Branch (5177:9): [True: 0, False: 11.3k]
  ------------------
 5178|       |
 5179|  11.3k|    auto key = std::string(beg, key_end);
 5180|  11.3k|    auto val = std::string(p, end);
 5181|       |
 5182|  11.3k|    if (!detail::fields::is_field_value(val)) { return false; }
  ------------------
  |  Branch (5182:9): [True: 45, False: 11.2k]
  ------------------
 5183|       |
 5184|       |    // RFC 9110 §5.5: header field values are opaque octets and MUST NOT be
 5185|       |    // percent-decoded by the recipient. Applications that need to interpret a
 5186|       |    // value as a URI component should call httplib::decode_uri_component()
 5187|       |    // (or decode_path_component()) explicitly.
 5188|  11.2k|    fn(key, val);
 5189|       |
 5190|  11.2k|    return true;
 5191|  11.3k|  }
 5192|       |
 5193|      0|  return false;
 5194|  11.3k|}
_ZZN7httplib6detail12read_headersERNS_6StreamERNSt3__118unordered_multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS0_11case_ignore4hashENSB_8equal_toENS8_INS3_4pairIKSA_SA_EEEEEEENKUlRSF_SK_E_clESK_SK_:
 7219|  11.2k|                      [&](const std::string &key, const std::string &val) {
 7220|  11.2k|                        headers.emplace(key, val);
 7221|  11.2k|                      })) {
_ZNK7httplib10ClientImpl16output_error_logERKNS_5ErrorEPKNS_7RequestE:
14048|  2.80k|                                         const Request *req) const {
14049|  2.80k|  if (error_logger_) {
  ------------------
  |  Branch (14049:7): [True: 0, False: 2.80k]
  ------------------
14050|      0|    std::lock_guard<std::mutex> guard(logger_mutex_);
14051|      0|    error_logger_(err, req);
14052|      0|  }
14053|  2.80k|}
_ZZN7httplib10ClientImpl15process_requestERNS_6StreamERNS_7RequestERNS_8ResponseEbRNS_5ErrorEENKUlPKcmmmE0_clESA_mmm:
14173|  61.6k|                      size_t /*len*/) {
14174|  61.6k|                    assert(res.body.size() + n <= res.body.max_size());
  ------------------
  |  Branch (14174:21): [True: 61.6k, False: 0]
  ------------------
14175|  61.6k|                    if (payload_max_length_ > 0 &&
  ------------------
  |  Branch (14175:25): [True: 61.6k, False: 0]
  ------------------
14176|  61.6k|                        (res.body.size() >= payload_max_length_ ||
  ------------------
  |  Branch (14176:26): [True: 0, False: 61.6k]
  ------------------
14177|  61.6k|                         n > payload_max_length_ - res.body.size())) {
  ------------------
  |  Branch (14177:26): [True: 0, False: 61.6k]
  ------------------
14178|      0|                      return false;
14179|      0|                    }
14180|  61.6k|                    res.body.append(buf, n);
14181|  61.6k|                    return true;
14182|  61.6k|                  });
_ZNK7httplib8Response10has_headerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
10116|  1.69k|inline bool Response::has_header(const std::string &key) const {
10117|  1.69k|  return headers.find(key) != headers.end();
10118|  1.69k|}
_ZNK7httplib8Response20get_header_value_u64ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmm:
10112|    483|                                             size_t id) const {
10113|    483|  return detail::get_header_value_u64(headers, key, def, id);
10114|    483|}
_ZN7httplib6detail20get_header_value_u64ERKNSt3__118unordered_multimapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS0_11case_ignore4hashENS9_8equal_toENS6_INS1_4pairIKS8_S8_EEEEEERSD_mm:
 2970|    483|                                   size_t id) {
 2971|    483|  auto dummy = false;
 2972|    483|  return get_header_value_u64(headers, key, def, id, dummy);
 2973|    483|}
_ZN7httplib6detail20get_header_value_u64ERKNSt3__118unordered_multimapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS0_11case_ignore4hashENS9_8equal_toENS6_INS1_4pairIKS8_S8_EEEEEERSD_mmRb:
 2953|    952|                                   size_t id, bool &is_invalid_value) {
 2954|    952|  is_invalid_value = false;
 2955|    952|  auto rng = headers.equal_range(key);
 2956|    952|  auto it = rng.first;
 2957|    952|  std::advance(it, static_cast<ssize_t>(id));
 2958|    952|  if (it != rng.second) {
  ------------------
  |  Branch (2958:7): [True: 952, False: 0]
  ------------------
 2959|    952|    if (is_numeric(it->second)) {
  ------------------
  |  Branch (2959:9): [True: 830, False: 122]
  ------------------
 2960|    830|      return static_cast<size_t>(std::strtoull(it->second.data(), nullptr, 10));
 2961|    830|    } else {
 2962|    122|      is_invalid_value = true;
 2963|    122|    }
 2964|    952|  }
 2965|    122|  return def;
 2966|    952|}
_ZN7httplib6detail10is_numericERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2947|    952|inline bool is_numeric(const std::string &str) {
 2948|    952|  return !str.empty() && std::all_of(str.cbegin(), str.cend(), is_ascii_digit);
  ------------------
  |  Branch (2948:10): [True: 852, False: 100]
  |  Branch (2948:26): [True: 830, False: 22]
  ------------------
 2949|    952|}
_ZN7httplib6detail12read_contentINS_8ResponseEEEbRNS_6StreamERT_mRiNSt3__18functionIFbmmEEENS9_IFbPKcmmmEEEb:
 7448|  1.67k|                  ContentReceiverWithProgress receiver, bool decompress) {
 7449|  1.67k|  bool exceed_payload_max_length = false;
 7450|  1.67k|  return prepare_content_receiver(
 7451|  1.67k|      x, status, std::move(receiver), decompress, payload_max_length,
 7452|  1.67k|      exceed_payload_max_length, [&](const ContentReceiverWithProgress &out) {
 7453|  1.67k|        auto ret = true;
 7454|       |        // Note: exceed_payload_max_length may also be set by the decompressor
 7455|       |        // wrapper in prepare_content_receiver when the decompressed payload
 7456|       |        // size exceeds the limit.
 7457|       |
 7458|  1.67k|        if (is_chunked_transfer_encoding(x.headers)) {
 7459|  1.67k|          auto result = read_content_chunked(strm, x, payload_max_length, out);
 7460|  1.67k|          if (result == ReadContentResult::Success) {
 7461|  1.67k|            ret = true;
 7462|  1.67k|          } else if (result == ReadContentResult::PayloadTooLarge) {
 7463|  1.67k|            exceed_payload_max_length = true;
 7464|  1.67k|            ret = false;
 7465|  1.67k|          } else {
 7466|  1.67k|            ret = false;
 7467|  1.67k|          }
 7468|  1.67k|        } else if (!has_header(x.headers, "Content-Length")) {
 7469|  1.67k|          auto result =
 7470|  1.67k|              read_content_without_length(strm, payload_max_length, out);
 7471|  1.67k|          if (result == ReadContentResult::Success) {
 7472|  1.67k|            ret = true;
 7473|  1.67k|          } else if (result == ReadContentResult::PayloadTooLarge) {
 7474|  1.67k|            exceed_payload_max_length = true;
 7475|  1.67k|            ret = false;
 7476|  1.67k|          } else {
 7477|  1.67k|            ret = false;
 7478|  1.67k|          }
 7479|  1.67k|        } else {
 7480|  1.67k|          auto is_invalid_value = false;
 7481|  1.67k|          auto len = get_header_value_u64(x.headers, "Content-Length",
 7482|  1.67k|                                          (std::numeric_limits<size_t>::max)(),
 7483|  1.67k|                                          0, is_invalid_value);
 7484|       |
 7485|  1.67k|          if (is_invalid_value) {
 7486|  1.67k|            ret = false;
 7487|  1.67k|          } else if (len > 0) {
 7488|  1.67k|            auto result = read_content_with_length(
 7489|  1.67k|                strm, len, std::move(progress), out, payload_max_length);
 7490|  1.67k|            ret = (result == ReadContentResult::Success);
 7491|  1.67k|            if (result == ReadContentResult::PayloadTooLarge) {
 7492|  1.67k|              exceed_payload_max_length = true;
 7493|  1.67k|            }
 7494|  1.67k|          }
 7495|  1.67k|        }
 7496|       |
 7497|  1.67k|        if (!ret) {
 7498|  1.67k|          status = exceed_payload_max_length ? StatusCode::PayloadTooLarge_413
 7499|  1.67k|                                             : StatusCode::BadRequest_400;
 7500|  1.67k|        }
 7501|  1.67k|        return ret;
 7502|  1.67k|      });
 7503|  1.67k|}
_ZN7httplib6detail24prepare_content_receiverINS_8ResponseEZNS0_12read_contentIS2_EEbRNS_6StreamERT_mRiNSt3__18functionIFbmmEEENSA_IFbPKcmmmEEEbEUlRKSG_E_EEbS7_S8_SG_bmRbT0_:
 7397|  1.67k|                              bool &exceed_payload_max_length, U callback) {
 7398|  1.67k|  if (decompress) {
  ------------------
  |  Branch (7398:7): [True: 1.67k, False: 0]
  ------------------
 7399|  1.67k|    std::string encoding = x.get_header_value("Content-Encoding");
 7400|  1.67k|    std::unique_ptr<decompressor> decompressor;
 7401|       |
 7402|  1.67k|    if (!encoding.empty()) {
  ------------------
  |  Branch (7402:9): [True: 252, False: 1.42k]
  ------------------
 7403|    252|      decompressor = detail::create_decompressor(encoding);
 7404|    252|      if (!decompressor) {
  ------------------
  |  Branch (7404:11): [True: 127, False: 125]
  ------------------
 7405|       |        // Unsupported encoding or no support compiled in
 7406|    127|        status = StatusCode::UnsupportedMediaType_415;
 7407|    127|        return false;
 7408|    127|      }
 7409|    252|    }
 7410|       |
 7411|  1.54k|    if (decompressor) {
  ------------------
  |  Branch (7411:9): [True: 125, False: 1.42k]
  ------------------
 7412|    125|      if (decompressor->is_valid()) {
  ------------------
  |  Branch (7412:11): [True: 125, False: 0]
  ------------------
 7413|    125|        size_t decompressed_size = 0;
 7414|    125|        ContentReceiverWithProgress out = [&](const char *buf, size_t n,
 7415|    125|                                              size_t off, size_t len) {
 7416|    125|          return decompressor->decompress(
 7417|    125|              buf, n, [&](const char *buf2, size_t n2) {
 7418|       |                // Guard against zip-bomb: check
 7419|       |                // decompressed size against limit.
 7420|    125|                if (payload_max_length > 0 &&
 7421|    125|                    (decompressed_size >= payload_max_length ||
 7422|    125|                     n2 > payload_max_length - decompressed_size)) {
 7423|    125|                  exceed_payload_max_length = true;
 7424|    125|                  return false;
 7425|    125|                }
 7426|    125|                decompressed_size += n2;
 7427|    125|                return receiver(buf2, n2, off, len);
 7428|    125|              });
 7429|    125|        };
 7430|    125|        return callback(std::move(out));
 7431|    125|      } else {
 7432|      0|        status = StatusCode::InternalServerError_500;
 7433|      0|        return false;
 7434|      0|      }
 7435|    125|    }
 7436|  1.54k|  }
 7437|       |
 7438|  1.42k|  ContentReceiverWithProgress out = [&](const char *buf, size_t n, size_t off,
 7439|  1.42k|                                        size_t len) {
 7440|  1.42k|    return receiver(buf, n, off, len);
 7441|  1.42k|  };
 7442|  1.42k|  return callback(std::move(out));
 7443|  1.67k|}
_ZNK7httplib8Response16get_header_valueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKcm:
10122|  1.67k|                                              size_t id) const {
10123|  1.67k|  return detail::get_header_value(headers, key, def, id);
10124|  1.67k|}
_ZN7httplib6detail19create_decompressorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 7091|    252|create_decompressor(const std::string &encoding) {
 7092|    252|  std::unique_ptr<decompressor> decompressor;
 7093|       |
 7094|    252|  if (encoding == "gzip" || encoding == "deflate") {
  ------------------
  |  Branch (7094:7): [True: 12, False: 240]
  |  Branch (7094:29): [True: 113, False: 127]
  ------------------
 7095|    125|#ifdef CPPHTTPLIB_ZLIB_SUPPORT
 7096|    125|    decompressor = detail::make_unique<gzip_decompressor>();
 7097|    125|#endif
 7098|    127|  } else if (encoding.find("br") != std::string::npos) {
  ------------------
  |  Branch (7098:14): [True: 21, False: 106]
  ------------------
 7099|       |#ifdef CPPHTTPLIB_BROTLI_SUPPORT
 7100|       |    decompressor = detail::make_unique<brotli_decompressor>();
 7101|       |#endif
 7102|    106|  } else if (encoding == "zstd" || encoding.find("zstd") != std::string::npos) {
  ------------------
  |  Branch (7102:14): [True: 1, False: 105]
  |  Branch (7102:36): [True: 19, False: 86]
  ------------------
 7103|       |#ifdef CPPHTTPLIB_ZSTD_SUPPORT
 7104|       |    decompressor = detail::make_unique<zstd_decompressor>();
 7105|       |#endif
 7106|     20|  }
 7107|       |
 7108|    252|  return decompressor;
 7109|    252|}
_ZN7httplib6detail11make_uniqueINS0_17gzip_decompressorEJEEENSt3__19enable_ifIXntsr3std8is_arrayIT_EE5valueENS3_10unique_ptrIS5_NS3_14default_deleteIS5_EEEEE4typeEDpOT0_:
  531|    125|make_unique(Args &&...args) {
  532|    125|  return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
  533|    125|}
_ZN7httplib6detail17gzip_decompressorC2Ev:
 6888|    125|inline gzip_decompressor::gzip_decompressor() {
 6889|    125|  std::memset(&strm_, 0, sizeof(strm_));
 6890|    125|  strm_.zalloc = Z_NULL;
 6891|    125|  strm_.zfree = Z_NULL;
 6892|    125|  strm_.opaque = Z_NULL;
 6893|       |
 6894|       |  // 15 is the value of wbits, which should be at the maximum possible value
 6895|       |  // to ensure that any gzip stream can be decoded. The offset of 32 specifies
 6896|       |  // that the stream type should be automatically detected either gzip or
 6897|       |  // deflate.
 6898|    125|  is_valid_ = inflateInit2(&strm_, 32 + 15) == Z_OK;
 6899|    125|}
_ZZN7httplib6detail24prepare_content_receiverINS_8ResponseEZNS0_12read_contentIS2_EEbRNS_6StreamERT_mRiNSt3__18functionIFbmmEEENSA_IFbPKcmmmEEEbEUlRKSG_E_EEbS7_S8_SG_bmRbT0_ENKUlSE_mmmE_clESE_mmm:
 7415|  1.31k|                                              size_t off, size_t len) {
 7416|  1.31k|          return decompressor->decompress(
 7417|  1.31k|              buf, n, [&](const char *buf2, size_t n2) {
 7418|       |                // Guard against zip-bomb: check
 7419|       |                // decompressed size against limit.
 7420|  1.31k|                if (payload_max_length > 0 &&
 7421|  1.31k|                    (decompressed_size >= payload_max_length ||
 7422|  1.31k|                     n2 > payload_max_length - decompressed_size)) {
 7423|  1.31k|                  exceed_payload_max_length = true;
 7424|  1.31k|                  return false;
 7425|  1.31k|                }
 7426|  1.31k|                decompressed_size += n2;
 7427|  1.31k|                return receiver(buf2, n2, off, len);
 7428|  1.31k|              });
 7429|  1.31k|        };
_ZZZN7httplib6detail24prepare_content_receiverINS_8ResponseEZNS0_12read_contentIS2_EEbRNS_6StreamERT_mRiNSt3__18functionIFbmmEEENSA_IFbPKcmmmEEEbEUlRKSG_E_EEbS7_S8_SG_bmRbT0_ENKUlSE_mmmE_clESE_mmmENKUlSE_mE_clESE_m:
 7417|  57.3k|              buf, n, [&](const char *buf2, size_t n2) {
 7418|       |                // Guard against zip-bomb: check
 7419|       |                // decompressed size against limit.
 7420|  57.3k|                if (payload_max_length > 0 &&
  ------------------
  |  Branch (7420:21): [True: 57.3k, False: 0]
  ------------------
 7421|  57.3k|                    (decompressed_size >= payload_max_length ||
  ------------------
  |  Branch (7421:22): [True: 1, False: 57.3k]
  ------------------
 7422|  57.3k|                     n2 > payload_max_length - decompressed_size)) {
  ------------------
  |  Branch (7422:22): [True: 4, False: 57.2k]
  ------------------
 7423|      5|                  exceed_payload_max_length = true;
 7424|      5|                  return false;
 7425|      5|                }
 7426|  57.2k|                decompressed_size += n2;
 7427|  57.2k|                return receiver(buf2, n2, off, len);
 7428|  57.3k|              });
_ZZN7httplib6detail12read_contentINS_8ResponseEEEbRNS_6StreamERT_mRiNSt3__18functionIFbmmEEENS9_IFbPKcmmmEEEbENKUlRKSF_E_clESH_:
 7452|  1.54k|      exceed_payload_max_length, [&](const ContentReceiverWithProgress &out) {
 7453|  1.54k|        auto ret = true;
 7454|       |        // Note: exceed_payload_max_length may also be set by the decompressor
 7455|       |        // wrapper in prepare_content_receiver when the decompressed payload
 7456|       |        // size exceeds the limit.
 7457|       |
 7458|  1.54k|        if (is_chunked_transfer_encoding(x.headers)) {
  ------------------
  |  Branch (7458:13): [True: 654, False: 891]
  ------------------
 7459|    654|          auto result = read_content_chunked(strm, x, payload_max_length, out);
 7460|    654|          if (result == ReadContentResult::Success) {
  ------------------
  |  Branch (7460:15): [True: 1, False: 653]
  ------------------
 7461|      1|            ret = true;
 7462|    653|          } else if (result == ReadContentResult::PayloadTooLarge) {
  ------------------
  |  Branch (7462:22): [True: 0, False: 653]
  ------------------
 7463|      0|            exceed_payload_max_length = true;
 7464|      0|            ret = false;
 7465|    653|          } else {
 7466|    653|            ret = false;
 7467|    653|          }
 7468|    891|        } else if (!has_header(x.headers, "Content-Length")) {
  ------------------
  |  Branch (7468:20): [True: 422, False: 469]
  ------------------
 7469|    422|          auto result =
 7470|    422|              read_content_without_length(strm, payload_max_length, out);
 7471|    422|          if (result == ReadContentResult::Success) {
  ------------------
  |  Branch (7471:15): [True: 396, False: 26]
  ------------------
 7472|    396|            ret = true;
 7473|    396|          } else if (result == ReadContentResult::PayloadTooLarge) {
  ------------------
  |  Branch (7473:22): [True: 0, False: 26]
  ------------------
 7474|      0|            exceed_payload_max_length = true;
 7475|      0|            ret = false;
 7476|     26|          } else {
 7477|     26|            ret = false;
 7478|     26|          }
 7479|    469|        } else {
 7480|    469|          auto is_invalid_value = false;
 7481|    469|          auto len = get_header_value_u64(x.headers, "Content-Length",
 7482|    469|                                          (std::numeric_limits<size_t>::max)(),
 7483|    469|                                          0, is_invalid_value);
 7484|       |
 7485|    469|          if (is_invalid_value) {
  ------------------
  |  Branch (7485:15): [True: 57, False: 412]
  ------------------
 7486|     57|            ret = false;
 7487|    412|          } else if (len > 0) {
  ------------------
  |  Branch (7487:22): [True: 408, False: 4]
  ------------------
 7488|    408|            auto result = read_content_with_length(
 7489|    408|                strm, len, std::move(progress), out, payload_max_length);
 7490|    408|            ret = (result == ReadContentResult::Success);
 7491|    408|            if (result == ReadContentResult::PayloadTooLarge) {
  ------------------
  |  Branch (7491:17): [True: 0, False: 408]
  ------------------
 7492|      0|              exceed_payload_max_length = true;
 7493|      0|            }
 7494|    408|          }
 7495|    469|        }
 7496|       |
 7497|  1.54k|        if (!ret) {
  ------------------
  |  Branch (7497:13): [True: 1.14k, False: 402]
  ------------------
 7498|  1.14k|          status = exceed_payload_max_length ? StatusCode::PayloadTooLarge_413
  ------------------
  |  Branch (7498:20): [True: 5, False: 1.13k]
  ------------------
 7499|  1.14k|                                             : StatusCode::BadRequest_400;
 7500|  1.14k|        }
 7501|  1.54k|        return ret;
 7502|  1.54k|      });
_ZN7httplib6detail28is_chunked_transfer_encodingERKNSt3__118unordered_multimapINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES8_NS0_11case_ignore4hashENS9_8equal_toENS6_INS1_4pairIKS8_S8_EEEEEE:
 7388|  1.54k|inline bool is_chunked_transfer_encoding(const Headers &headers) {
 7389|  1.54k|  return case_ignore::equal(
 7390|  1.54k|      get_header_value(headers, "Transfer-Encoding", "", 0), "chunked");
 7391|  1.54k|}
_ZN7httplib6detail20read_content_chunkedINS_8ResponseEEENS0_17ReadContentResultERNS_6StreamERT_mNSt3__18functionIFbPKcmmmEEE:
 7356|    654|                                              ContentReceiverWithProgress out) {
 7357|    654|  detail::ChunkedDecoder dec(strm);
 7358|       |
 7359|    654|  char buf[CPPHTTPLIB_RECV_BUFSIZ];
 7360|    654|  size_t total_len = 0;
 7361|       |
 7362|  5.09k|  for (;;) {
 7363|  5.09k|    size_t chunk_offset = 0;
 7364|  5.09k|    size_t chunk_total = 0;
 7365|  5.09k|    auto n = dec.read_payload(buf, sizeof(buf), chunk_offset, chunk_total);
 7366|  5.09k|    if (n < 0) { return ReadContentResult::Error; }
  ------------------
  |  Branch (7366:9): [True: 495, False: 4.59k]
  ------------------
 7367|       |
 7368|  4.59k|    if (n == 0) {
  ------------------
  |  Branch (7368:9): [True: 157, False: 4.44k]
  ------------------
 7369|    157|      if (!dec.parse_trailers_into(x.trailers, x.headers)) {
  ------------------
  |  Branch (7369:11): [True: 156, False: 1]
  ------------------
 7370|    156|        return ReadContentResult::Error;
 7371|    156|      }
 7372|      1|      return ReadContentResult::Success;
 7373|    157|    }
 7374|       |
 7375|  4.44k|    if (total_len > payload_max_length ||
  ------------------
  |  Branch (7375:9): [True: 0, False: 4.44k]
  ------------------
 7376|  4.44k|        payload_max_length - total_len < static_cast<size_t>(n)) {
  ------------------
  |  Branch (7376:9): [True: 0, False: 4.44k]
  ------------------
 7377|      0|      return ReadContentResult::PayloadTooLarge;
 7378|      0|    }
 7379|       |
 7380|  4.44k|    if (!out(buf, static_cast<size_t>(n), chunk_offset, chunk_total)) {
  ------------------
  |  Branch (7380:9): [True: 2, False: 4.43k]
  ------------------
 7381|      2|      return ReadContentResult::Error;
 7382|      2|    }
 7383|       |
 7384|  4.43k|    total_len += static_cast<size_t>(n);
 7385|  4.43k|  }
 7386|    654|}
_ZN7httplib6detail14ChunkedDecoderC2ERNS_6StreamE:
13335|    654|inline ChunkedDecoder::ChunkedDecoder(Stream &s) : strm(s) {}
_ZN7httplib6detail14ChunkedDecoder12read_payloadEPcmRmS3_:
13339|  5.09k|                                            size_t &out_chunk_total) {
13340|  5.09k|  if (finished) { return 0; }
  ------------------
  |  Branch (13340:7): [True: 0, False: 5.09k]
  ------------------
13341|       |
13342|  5.09k|  if (chunk_remaining == 0) {
  ------------------
  |  Branch (13342:7): [True: 4.80k, False: 291]
  ------------------
13343|  4.80k|    stream_line_reader lr(strm, line_buf, sizeof(line_buf));
13344|  4.80k|    if (!lr.getline()) { return -1; }
  ------------------
  |  Branch (13344:9): [True: 30, False: 4.77k]
  ------------------
13345|       |
13346|       |    // RFC 9112 §7.1: chunk-size = 1*HEXDIG
13347|  4.77k|    const char *p = lr.ptr();
13348|  4.77k|    int v = 0;
13349|  4.77k|    if (!is_hex(*p, v)) { return -1; }
  ------------------
  |  Branch (13349:9): [True: 24, False: 4.74k]
  ------------------
13350|       |
13351|  4.74k|    size_t chunk_len = 0;
13352|  4.74k|    constexpr size_t chunk_len_max = (std::numeric_limits<size_t>::max)();
13353|  12.9k|    for (; is_hex(*p, v); ++p) {
  ------------------
  |  Branch (13353:12): [True: 8.24k, False: 4.73k]
  ------------------
13354|  8.24k|      if (chunk_len > (chunk_len_max >> 4)) { return -1; }
  ------------------
  |  Branch (13354:11): [True: 9, False: 8.23k]
  ------------------
13355|  8.23k|      chunk_len = (chunk_len << 4) | static_cast<size_t>(v);
13356|  8.23k|    }
13357|       |
13358|  5.02k|    while (is_space_or_tab(*p)) {
  ------------------
  |  Branch (13358:12): [True: 285, False: 4.73k]
  ------------------
13359|    285|      ++p;
13360|    285|    }
13361|  4.73k|    if (*p != '\0' && *p != ';' && *p != '\r' && *p != '\n') { return -1; }
  ------------------
  |  Branch (13361:9): [True: 3.43k, False: 1.30k]
  |  Branch (13361:23): [True: 3.18k, False: 250]
  |  Branch (13361:36): [True: 248, False: 2.93k]
  |  Branch (13361:50): [True: 42, False: 206]
  ------------------
13362|       |
13363|  4.69k|    if (chunk_len == 0) {
  ------------------
  |  Branch (13363:9): [True: 157, False: 4.53k]
  ------------------
13364|    157|      chunk_remaining = 0;
13365|    157|      finished = true;
13366|    157|      out_chunk_offset = 0;
13367|    157|      out_chunk_total = 0;
13368|    157|      return 0;
13369|    157|    }
13370|       |
13371|  4.53k|    chunk_remaining = chunk_len;
13372|  4.53k|    last_chunk_total = chunk_remaining;
13373|  4.53k|    last_chunk_offset = 0;
13374|  4.53k|  }
13375|       |
13376|  4.83k|  auto to_read = (std::min)(chunk_remaining, len);
13377|  4.83k|  auto n = strm.read(buf, to_read);
13378|  4.83k|  if (n <= 0) { return -1; }
  ------------------
  |  Branch (13378:7): [True: 364, False: 4.46k]
  ------------------
13379|       |
13380|  4.46k|  auto offset_before = last_chunk_offset;
13381|  4.46k|  last_chunk_offset += static_cast<size_t>(n);
13382|  4.46k|  chunk_remaining -= static_cast<size_t>(n);
13383|       |
13384|  4.46k|  out_chunk_offset = offset_before;
13385|  4.46k|  out_chunk_total = last_chunk_total;
13386|       |
13387|  4.46k|  if (chunk_remaining == 0) {
  ------------------
  |  Branch (13387:7): [True: 4.17k, False: 293]
  ------------------
13388|  4.17k|    stream_line_reader lr(strm, line_buf, sizeof(line_buf));
13389|  4.17k|    if (!lr.getline()) { return -1; }
  ------------------
  |  Branch (13389:9): [True: 5, False: 4.16k]
  ------------------
13390|  4.16k|    if (std::strcmp(lr.ptr(), "\r\n") != 0) { return -1; }
  ------------------
  |  Branch (13390:9): [True: 21, False: 4.14k]
  ------------------
13391|  4.16k|  }
13392|       |
13393|  4.44k|  return n;
13394|  4.46k|}
_ZN7httplib6detail14ChunkedDecoder19parse_trailers_intoERNSt3__118unordered_multimapINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_NS0_11case_ignore4hashENSA_8equal_toENS7_INS2_4pairIKS9_S9_EEEEEERKSH_:
13397|    157|                                                const Headers &src_headers) {
13398|    157|  stream_line_reader lr(strm, line_buf, sizeof(line_buf));
13399|    157|  if (!lr.getline()) { return false; }
  ------------------
  |  Branch (13399:7): [True: 18, False: 139]
  ------------------
13400|    139|  return parse_trailers(lr, dest, src_headers);
13401|    157|}
_ZN7httplib6detail14parse_trailersERNS0_18stream_line_readerERNSt3__118unordered_multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS0_11case_ignore4hashENSB_8equal_toENS8_INS3_4pairIKSA_SA_EEEEEERKSI_:
 5197|    139|                           const Headers &src_headers) {
 5198|       |  // NOTE: In RFC 9112, '7.1 Chunked Transfer Coding' mentions "The chunked
 5199|       |  // transfer coding is complete when a chunk with a chunk-size of zero is
 5200|       |  // received, possibly followed by a trailer section, and finally terminated by
 5201|       |  // an empty line". https://www.rfc-editor.org/rfc/rfc9112.html#section-7.1
 5202|       |  //
 5203|       |  // In '7.1.3. Decoding Chunked', however, the pseudo-code in the section
 5204|       |  // doesn't care for the existence of the final CRLF. In other words, it seems
 5205|       |  // to be ok whether the final CRLF exists or not in the chunked data.
 5206|       |  // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.1.3
 5207|       |  //
 5208|       |  // According to the reference code in RFC 9112, cpp-httplib now allows
 5209|       |  // chunked transfer coding data without the final CRLF.
 5210|       |
 5211|       |  // RFC 7230 Section 4.1.2 - Headers prohibited in trailers
 5212|    139|  thread_local case_ignore::unordered_set<std::string> prohibited_trailers = {
 5213|    139|      "transfer-encoding",
 5214|    139|      "content-length",
 5215|    139|      "host",
 5216|    139|      "authorization",
 5217|    139|      "www-authenticate",
 5218|    139|      "proxy-authenticate",
 5219|    139|      "proxy-authorization",
 5220|    139|      "cookie",
 5221|    139|      "set-cookie",
 5222|    139|      "cache-control",
 5223|    139|      "expect",
 5224|    139|      "max-forwards",
 5225|    139|      "pragma",
 5226|    139|      "range",
 5227|    139|      "te",
 5228|    139|      "age",
 5229|    139|      "expires",
 5230|    139|      "date",
 5231|    139|      "location",
 5232|    139|      "retry-after",
 5233|    139|      "vary",
 5234|    139|      "warning",
 5235|    139|      "content-encoding",
 5236|    139|      "content-type",
 5237|    139|      "content-range",
 5238|    139|      "trailer"};
 5239|       |
 5240|    139|  case_ignore::unordered_set<std::string> declared_trailers;
 5241|    139|  auto trailer_header = get_header_value(src_headers, "Trailer", "", 0);
 5242|    139|  if (trailer_header && std::strlen(trailer_header)) {
  ------------------
  |  Branch (5242:7): [True: 139, False: 0]
  |  Branch (5242:25): [True: 0, False: 139]
  ------------------
 5243|      0|    auto len = std::strlen(trailer_header);
 5244|      0|    split(trailer_header, trailer_header + len, ',',
 5245|      0|          [&](const char *b, const char *e) {
 5246|      0|            const char *kbeg = b;
 5247|      0|            const char *kend = e;
 5248|      0|            while (kbeg < kend && (*kbeg == ' ' || *kbeg == '\t')) {
 5249|      0|              ++kbeg;
 5250|      0|            }
 5251|      0|            while (kend > kbeg && (kend[-1] == ' ' || kend[-1] == '\t')) {
 5252|      0|              --kend;
 5253|      0|            }
 5254|      0|            std::string key(kbeg, static_cast<size_t>(kend - kbeg));
 5255|      0|            if (!key.empty() &&
 5256|      0|                prohibited_trailers.find(key) == prohibited_trailers.end()) {
 5257|      0|              declared_trailers.insert(key);
 5258|      0|            }
 5259|      0|          });
 5260|      0|  }
 5261|       |
 5262|    139|  size_t trailer_header_count = 0;
 5263|  3.15k|  while (strcmp(line_reader.ptr(), "\r\n") != 0) {
  ------------------
  |  Branch (5263:10): [True: 3.15k, False: 1]
  ------------------
 5264|  3.15k|    if (line_reader.size() > CPPHTTPLIB_HEADER_MAX_LENGTH) { return false; }
  ------------------
  |  |  114|  3.15k|#define CPPHTTPLIB_HEADER_MAX_LENGTH 8192
  ------------------
  |  Branch (5264:9): [True: 2, False: 3.15k]
  ------------------
 5265|  3.15k|    if (trailer_header_count >= CPPHTTPLIB_HEADER_MAX_COUNT) { return false; }
  ------------------
  |  |  118|  3.15k|#define CPPHTTPLIB_HEADER_MAX_COUNT 100
  ------------------
  |  Branch (5265:9): [True: 0, False: 3.15k]
  ------------------
 5266|       |
 5267|  3.15k|    constexpr auto line_terminator_len = 2;
 5268|  3.15k|    auto line_beg = line_reader.ptr();
 5269|  3.15k|    auto line_end =
 5270|  3.15k|        line_reader.ptr() + line_reader.size() - line_terminator_len;
 5271|       |
 5272|  3.15k|    if (!parse_header(line_beg, line_end,
  ------------------
  |  Branch (5272:9): [True: 94, False: 3.06k]
  ------------------
 5273|  3.15k|                      [&](const std::string &key, const std::string &val) {
 5274|  3.15k|                        if (declared_trailers.find(key) !=
 5275|  3.15k|                            declared_trailers.end()) {
 5276|  3.15k|                          dest.emplace(key, val);
 5277|  3.15k|                          trailer_header_count++;
 5278|  3.15k|                        }
 5279|  3.15k|                      })) {
 5280|     94|      return false;
 5281|     94|    }
 5282|       |
 5283|  3.06k|    if (!line_reader.getline()) { return false; }
  ------------------
  |  Branch (5283:9): [True: 42, False: 3.02k]
  ------------------
 5284|  3.06k|  }
 5285|       |
 5286|      1|  return true;
 5287|    139|}
_ZN7httplib6detail12parse_headerIZNS0_14parse_trailersERNS0_18stream_line_readerERNSt3__118unordered_multimapINS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEESB_NS0_11case_ignore4hashENSC_8equal_toENS9_INS4_4pairIKSB_SB_EEEEEERKSJ_EUlRSG_SN_E_EEbPKcSQ_T_:
 5151|  3.15k|inline bool parse_header(const char *beg, const char *end, T fn) {
 5152|       |  // Skip trailing spaces and tabs.
 5153|  3.41k|  while (beg < end && is_space_or_tab(end[-1])) {
  ------------------
  |  Branch (5153:10): [True: 3.37k, False: 31]
  |  Branch (5153:23): [True: 254, False: 3.12k]
  ------------------
 5154|    254|    end--;
 5155|    254|  }
 5156|       |
 5157|  3.15k|  auto p = beg;
 5158|   103k|  while (p < end && *p != ':') {
  ------------------
  |  Branch (5158:10): [True: 103k, False: 71]
  |  Branch (5158:21): [True: 100k, False: 3.08k]
  ------------------
 5159|   100k|    p++;
 5160|   100k|  }
 5161|       |
 5162|  3.15k|  auto name = std::string(beg, p);
 5163|  3.15k|  if (!detail::fields::is_field_name(name)) { return false; }
  ------------------
  |  Branch (5163:7): [True: 66, False: 3.09k]
  ------------------
 5164|       |
 5165|  3.09k|  if (p == end) { return false; }
  ------------------
  |  Branch (5165:7): [True: 12, False: 3.07k]
  ------------------
 5166|       |
 5167|  3.07k|  auto key_end = p;
 5168|       |
 5169|  3.07k|  if (*p++ != ':') { return false; }
  ------------------
  |  Branch (5169:7): [True: 0, False: 3.07k]
  ------------------
 5170|       |
 5171|  3.44k|  while (p < end && is_space_or_tab(*p)) {
  ------------------
  |  Branch (5171:10): [True: 1.39k, False: 2.04k]
  |  Branch (5171:21): [True: 363, False: 1.03k]
  ------------------
 5172|    363|    p++;
 5173|    363|  }
 5174|       |
 5175|  3.07k|  if (p <= end) {
  ------------------
  |  Branch (5175:7): [True: 3.07k, False: 0]
  ------------------
 5176|  3.07k|    auto key_len = key_end - beg;
 5177|  3.07k|    if (!key_len) { return false; }
  ------------------
  |  Branch (5177:9): [True: 0, False: 3.07k]
  ------------------
 5178|       |
 5179|  3.07k|    auto key = std::string(beg, key_end);
 5180|  3.07k|    auto val = std::string(p, end);
 5181|       |
 5182|  3.07k|    if (!detail::fields::is_field_value(val)) { return false; }
  ------------------
  |  Branch (5182:9): [True: 16, False: 3.06k]
  ------------------
 5183|       |
 5184|       |    // RFC 9110 §5.5: header field values are opaque octets and MUST NOT be
 5185|       |    // percent-decoded by the recipient. Applications that need to interpret a
 5186|       |    // value as a URI component should call httplib::decode_uri_component()
 5187|       |    // (or decode_path_component()) explicitly.
 5188|  3.06k|    fn(key, val);
 5189|       |
 5190|  3.06k|    return true;
 5191|  3.07k|  }
 5192|       |
 5193|      0|  return false;
 5194|  3.07k|}
_ZZN7httplib6detail14parse_trailersERNS0_18stream_line_readerERNSt3__118unordered_multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESA_NS0_11case_ignore4hashENSB_8equal_toENS8_INS3_4pairIKSA_SA_EEEEEERKSI_ENKUlRSF_SM_E_clESM_SM_:
 5273|  3.06k|                      [&](const std::string &key, const std::string &val) {
 5274|  3.06k|                        if (declared_trailers.find(key) !=
  ------------------
  |  Branch (5274:29): [True: 0, False: 3.06k]
  ------------------
 5275|  3.06k|                            declared_trailers.end()) {
 5276|      0|                          dest.emplace(key, val);
 5277|      0|                          trailer_header_count++;
 5278|      0|                        }
 5279|  3.06k|                      })) {
_ZN7httplib6detail27read_content_without_lengthERNS_6StreamEmNSt3__18functionIFbPKcmmmEEE:
 7330|    422|                            ContentReceiverWithProgress out) {
 7331|    422|  char buf[CPPHTTPLIB_RECV_BUFSIZ];
 7332|    422|  size_t r = 0;
 7333|  1.11k|  for (;;) {
 7334|  1.11k|    auto n = strm.read(buf, CPPHTTPLIB_RECV_BUFSIZ);
  ------------------
  |  |  150|  1.11k|#define CPPHTTPLIB_RECV_BUFSIZ size_t(16384u)
  ------------------
 7335|  1.11k|    if (n == 0) { return ReadContentResult::Success; }
  ------------------
  |  Branch (7335:9): [True: 396, False: 716]
  ------------------
 7336|    716|    if (n < 0) { return ReadContentResult::Error; }
  ------------------
  |  Branch (7336:9): [True: 0, False: 716]
  ------------------
 7337|       |
 7338|       |    // Check if adding this data would exceed the payload limit
 7339|    716|    if (r > payload_max_length ||
  ------------------
  |  Branch (7339:9): [True: 0, False: 716]
  ------------------
 7340|    716|        payload_max_length - r < static_cast<size_t>(n)) {
  ------------------
  |  Branch (7340:9): [True: 0, False: 716]
  ------------------
 7341|      0|      return ReadContentResult::PayloadTooLarge;
 7342|      0|    }
 7343|       |
 7344|    716|    if (!out(buf, static_cast<size_t>(n), r, 0)) {
  ------------------
  |  Branch (7344:9): [True: 26, False: 690]
  ------------------
 7345|     26|      return ReadContentResult::Error;
 7346|     26|    }
 7347|    690|    r += static_cast<size_t>(n);
 7348|    690|  }
 7349|       |
 7350|      0|  return ReadContentResult::Success;
 7351|    422|}
_ZN7httplib6detail24read_content_with_lengthERNS_6StreamEmNSt3__18functionIFbmmEEENS4_IFbPKcmmmEEEm:
 7290|    408|    size_t payload_max_length = (std::numeric_limits<size_t>::max)()) {
 7291|    408|  char buf[CPPHTTPLIB_RECV_BUFSIZ];
 7292|       |
 7293|    408|  detail::BodyReader br;
 7294|    408|  br.stream = &strm;
 7295|    408|  br.has_content_length = true;
 7296|    408|  br.content_length = len;
 7297|    408|  br.payload_max_length = payload_max_length;
 7298|    408|  br.chunked = false;
 7299|    408|  br.bytes_read = 0;
 7300|    408|  br.last_error = Error::Success;
 7301|       |
 7302|    408|  size_t r = 0;
 7303|    910|  while (r < len) {
  ------------------
  |  Branch (7303:10): [True: 909, False: 1]
  ------------------
 7304|    909|    auto read_len = static_cast<size_t>(len - r);
 7305|    909|    auto to_read = (std::min)(read_len, CPPHTTPLIB_RECV_BUFSIZ);
  ------------------
  |  |  150|    909|#define CPPHTTPLIB_RECV_BUFSIZ size_t(16384u)
  ------------------
 7306|    909|    auto n = detail::read_body_content(&strm, br, buf, to_read);
 7307|    909|    if (n <= 0) {
  ------------------
  |  Branch (7307:9): [True: 406, False: 503]
  ------------------
 7308|       |      // Check if it was a payload size error
 7309|    406|      if (br.last_error == Error::ExceedMaxPayloadSize) {
  ------------------
  |  Branch (7309:11): [True: 0, False: 406]
  ------------------
 7310|      0|        return ReadContentResult::PayloadTooLarge;
 7311|      0|      }
 7312|    406|      return ReadContentResult::Error;
 7313|    406|    }
 7314|       |
 7315|    503|    if (!out(buf, static_cast<size_t>(n), r, len)) {
  ------------------
  |  Branch (7315:9): [True: 1, False: 502]
  ------------------
 7316|      1|      return ReadContentResult::Error;
 7317|      1|    }
 7318|    502|    r += static_cast<size_t>(n);
 7319|       |
 7320|    502|    if (progress) {
  ------------------
  |  Branch (7320:9): [True: 502, False: 0]
  ------------------
 7321|    502|      if (!progress(r, len)) { return ReadContentResult::Error; }
  ------------------
  |  Branch (7321:11): [True: 0, False: 502]
  ------------------
 7322|    502|    }
 7323|    502|  }
 7324|       |
 7325|      1|  return ReadContentResult::Success;
 7326|    408|}
_ZN7httplib6detail17read_body_contentEPNS_6StreamERNS0_10BodyReaderEPcm:
 2129|    909|                                 size_t len) {
 2130|    909|  (void)stream;
 2131|    909|  return br.read(buf, len);
 2132|    909|}
_ZN7httplib6detail10BodyReader4readEPcm:
10255|    909|inline ssize_t detail::BodyReader::read(char *buf, size_t len) {
10256|    909|  if (!stream) {
  ------------------
  |  Branch (10256:7): [True: 0, False: 909]
  ------------------
10257|      0|    last_error = Error::Connection;
10258|      0|    return -1;
10259|      0|  }
10260|    909|  if (eof) { return 0; }
  ------------------
  |  Branch (10260:7): [True: 0, False: 909]
  ------------------
10261|       |
10262|    909|  if (!chunked) {
  ------------------
  |  Branch (10262:7): [True: 909, False: 0]
  ------------------
10263|       |    // Content-Length based reading
10264|    909|    if (has_content_length && bytes_read >= content_length) {
  ------------------
  |  Branch (10264:9): [True: 909, False: 0]
  |  Branch (10264:31): [True: 0, False: 909]
  ------------------
10265|      0|      eof = true;
10266|      0|      return 0;
10267|      0|    }
10268|       |
10269|    909|    auto to_read = len;
10270|    909|    if (has_content_length) {
  ------------------
  |  Branch (10270:9): [True: 909, False: 0]
  ------------------
10271|    909|      auto remaining = content_length - bytes_read;
10272|    909|      to_read = (std::min)(len, remaining);
10273|    909|    }
10274|    909|    auto n = stream->read(buf, to_read);
10275|       |
10276|    909|    if (n < 0) {
  ------------------
  |  Branch (10276:9): [True: 0, False: 909]
  ------------------
10277|      0|      last_error = stream->get_error();
10278|      0|      if (last_error == Error::Success) { last_error = Error::Read; }
  ------------------
  |  Branch (10278:11): [True: 0, False: 0]
  ------------------
10279|      0|      eof = true;
10280|      0|      return n;
10281|      0|    }
10282|    909|    if (n == 0) {
  ------------------
  |  Branch (10282:9): [True: 406, False: 503]
  ------------------
10283|       |      // Unexpected EOF before content_length
10284|    406|      last_error = stream->get_error();
10285|    406|      if (last_error == Error::Success) { last_error = Error::Read; }
  ------------------
  |  Branch (10285:11): [True: 406, False: 0]
  ------------------
10286|    406|      eof = true;
10287|    406|      return 0;
10288|    406|    }
10289|       |
10290|    503|    bytes_read += static_cast<size_t>(n);
10291|    503|    if (has_content_length && bytes_read >= content_length) { eof = true; }
  ------------------
  |  Branch (10291:9): [True: 503, False: 0]
  |  Branch (10291:31): [True: 1, False: 502]
  ------------------
10292|    503|    if (payload_max_length > 0 && bytes_read > payload_max_length) {
  ------------------
  |  Branch (10292:9): [True: 503, False: 0]
  |  Branch (10292:35): [True: 0, False: 503]
  ------------------
10293|      0|      last_error = Error::ExceedMaxPayloadSize;
10294|      0|      eof = true;
10295|      0|      return -1;
10296|      0|    }
10297|    503|    return n;
10298|    503|  }
10299|       |
10300|       |  // Chunked transfer encoding: delegate to shared decoder instance.
10301|      0|  if (!chunked_decoder) { chunked_decoder.reset(new ChunkedDecoder(*stream)); }
  ------------------
  |  Branch (10301:7): [True: 0, False: 0]
  ------------------
10302|       |
10303|      0|  size_t chunk_offset = 0;
10304|      0|  size_t chunk_total = 0;
10305|      0|  auto n = chunked_decoder->read_payload(buf, len, chunk_offset, chunk_total);
10306|      0|  if (n < 0) {
  ------------------
  |  Branch (10306:7): [True: 0, False: 0]
  ------------------
10307|      0|    last_error = stream->get_error();
10308|      0|    if (last_error == Error::Success) { last_error = Error::Read; }
  ------------------
  |  Branch (10308:9): [True: 0, False: 0]
  ------------------
10309|      0|    eof = true;
10310|      0|    return n;
10311|      0|  }
10312|       |
10313|      0|  if (n == 0) {
  ------------------
  |  Branch (10313:7): [True: 0, False: 0]
  ------------------
10314|       |    // Final chunk observed. Leave trailer parsing to the caller (StreamHandle).
10315|      0|    eof = true;
10316|      0|    return 0;
10317|      0|  }
10318|       |
10319|      0|  bytes_read += static_cast<size_t>(n);
10320|      0|  if (payload_max_length > 0 && bytes_read > payload_max_length) {
  ------------------
  |  Branch (10320:7): [True: 0, False: 0]
  |  Branch (10320:33): [True: 0, False: 0]
  ------------------
10321|      0|    last_error = Error::ExceedMaxPayloadSize;
10322|      0|    eof = true;
10323|      0|    return -1;
10324|      0|  }
10325|      0|  return n;
10326|      0|}
_ZNK7httplib6Stream9get_errorEv:
 1539|    406|  Error get_error() const { return error_; }
_ZZN7httplib6detail24prepare_content_receiverINS_8ResponseEZNS0_12read_contentIS2_EEbRNS_6StreamERT_mRiNSt3__18functionIFbmmEEENSA_IFbPKcmmmEEEbEUlRKSG_E_EEbS7_S8_SG_bmRbT0_ENKUlSE_mmmE0_clESE_mmm:
 7439|  4.34k|                                        size_t len) {
 7440|  4.34k|    return receiver(buf, n, off, len);
 7441|  4.34k|  };
_ZZN7httplib10ClientImpl15process_requestERNS_6StreamERNS_7RequestERNS_8ResponseEbRNS_5ErrorEENKUlmmE_clEmm:
14184|    502|    auto progress = [&](size_t current, size_t total) {
14185|    502|      if (!req.download_progress || redirect) { return true; }
  ------------------
  |  Branch (14185:11): [True: 502, False: 0]
  |  Branch (14185:37): [True: 0, False: 0]
  ------------------
14186|      0|      auto ret = req.download_progress(current, total);
14187|      0|      if (!ret) {
  ------------------
  |  Branch (14187:11): [True: 0, False: 0]
  ------------------
14188|      0|        error = Error::Canceled;
14189|      0|        output_error_log(error, &req);
14190|      0|      }
14191|      0|      return ret;
14192|    502|    };
_ZNK7httplib10ClientImpl10output_logERKNS_7RequestERKNS_8ResponseE:
14040|    427|                                   const Response &res) const {
14041|    427|  if (logger_) {
  ------------------
  |  Branch (14041:7): [True: 0, False: 427]
  ------------------
14042|      0|    std::lock_guard<std::mutex> guard(logger_mutex_);
14043|      0|    logger_(req, res);
14044|      0|  }
14045|    427|}
_ZN7httplib8ResponseD2Ev:
 1454|  3.22k|  ~Response() {
 1455|  3.22k|    if (content_provider_resource_releaser_) {
  ------------------
  |  Branch (1455:9): [True: 0, False: 3.22k]
  ------------------
 1456|      0|      content_provider_resource_releaser_(content_provider_success_);
 1457|      0|    }
 1458|  3.22k|  }
_ZNK7httplib6detail17gzip_decompressor8is_validEv:
 6903|    125|inline bool gzip_decompressor::is_valid() const { return is_valid_; }
_ZN7httplib6detail17gzip_decompressor10decompressEPKcmNSt3__18functionIFbS3_mEEE:
 6906|  1.31k|                                          Callback callback) {
 6907|  1.31k|  assert(is_valid_);
  ------------------
  |  Branch (6907:3): [True: 1.31k, False: 0]
  ------------------
 6908|       |
 6909|  1.31k|  auto ret = Z_OK;
 6910|       |
 6911|  1.31k|  do {
 6912|  1.31k|    constexpr size_t max_avail_in =
 6913|  1.31k|        (std::numeric_limits<decltype(strm_.avail_in)>::max)();
 6914|       |
 6915|  1.31k|    strm_.avail_in = static_cast<decltype(strm_.avail_in)>(
 6916|  1.31k|        (std::min)(data_length, max_avail_in));
 6917|  1.31k|    strm_.next_in = const_cast<Bytef *>(reinterpret_cast<const Bytef *>(data));
 6918|       |
 6919|  1.31k|    data_length -= strm_.avail_in;
 6920|  1.31k|    data += strm_.avail_in;
 6921|       |
 6922|  1.31k|    std::array<char, CPPHTTPLIB_COMPRESSION_BUFSIZ> buff{};
 6923|  58.6k|    while (strm_.avail_in > 0 && ret == Z_OK) {
  ------------------
  |  Branch (6923:12): [True: 57.5k, False: 1.01k]
  |  Branch (6923:34): [True: 57.3k, False: 265]
  ------------------
 6924|  57.3k|      strm_.avail_out = static_cast<uInt>(buff.size());
 6925|  57.3k|      strm_.next_out = reinterpret_cast<Bytef *>(buff.data());
 6926|       |
 6927|  57.3k|      ret = inflate(&strm_, Z_NO_FLUSH);
 6928|       |
 6929|  57.3k|      assert(ret != Z_STREAM_ERROR);
  ------------------
  |  Branch (6929:7): [True: 57.3k, False: 0]
  ------------------
 6930|  57.3k|      switch (ret) {
  ------------------
  |  Branch (6930:15): [True: 24, False: 57.3k]
  ------------------
 6931|      2|      case Z_NEED_DICT:
  ------------------
  |  Branch (6931:7): [True: 2, False: 57.3k]
  ------------------
 6932|     24|      case Z_DATA_ERROR:
  ------------------
  |  Branch (6932:7): [True: 22, False: 57.3k]
  ------------------
 6933|     24|      case Z_MEM_ERROR: inflateEnd(&strm_); return false;
  ------------------
  |  Branch (6933:7): [True: 0, False: 57.3k]
  ------------------
 6934|  57.3k|      }
 6935|       |
 6936|  57.3k|      if (!callback(buff.data(), buff.size() - strm_.avail_out)) {
  ------------------
  |  Branch (6936:11): [True: 5, False: 57.2k]
  ------------------
 6937|      5|        return false;
 6938|      5|      }
 6939|  57.3k|    }
 6940|       |
 6941|  1.28k|    if (ret != Z_OK && ret != Z_STREAM_END) { return false; }
  ------------------
  |  Branch (6941:9): [True: 265, False: 1.01k]
  |  Branch (6941:24): [True: 0, False: 265]
  ------------------
 6942|       |
 6943|  1.28k|  } while (data_length > 0);
  ------------------
  |  Branch (6943:12): [True: 0, False: 1.28k]
  ------------------
 6944|       |
 6945|  1.28k|  return true;
 6946|  1.31k|}
_ZN7httplib6detail12BufferStreamD2Ev:
 3197|  3.22k|  ~BufferStream() override = default;
_ZN7httplib6detail12BufferStream5writeEPKcm:
10647|  21.3k|inline ssize_t BufferStream::write(const char *ptr, size_t size) {
10648|  21.3k|  buffer.append(ptr, size);
10649|  21.3k|  return static_cast<ssize_t>(size);
10650|  21.3k|}
_ZNK7httplib10ClientImpl6is_sslEv:
14288|  3.22k|inline bool ClientImpl::is_ssl() const { return false; }

LLVMFuzzerTestOneInput:
   69|  3.22k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   70|  3.22k|  if (size < 1) return 0;
  ------------------
  |  Branch (70:7): [True: 0, False: 3.22k]
  ------------------
   71|       |
   72|  3.22k|  FuzzedStream stream{data + 1, size - 1};
   73|  3.22k|  FuzzableClient client;
   74|       |
   75|       |  // Use the first byte to select method
   76|  3.22k|  std::string method;
   77|  3.22k|  switch (data[0] % 6) {
  ------------------
  |  Branch (77:11): [True: 3.22k, False: 0]
  ------------------
   78|    109|  case 0: method = "GET"; break;
  ------------------
  |  Branch (78:3): [True: 109, False: 3.12k]
  ------------------
   79|    810|  case 1: method = "POST"; break;
  ------------------
  |  Branch (79:3): [True: 810, False: 2.41k]
  ------------------
   80|    797|  case 2: method = "PUT"; break;
  ------------------
  |  Branch (80:3): [True: 797, False: 2.43k]
  ------------------
   81|    350|  case 3: method = "PATCH"; break;
  ------------------
  |  Branch (81:3): [True: 350, False: 2.87k]
  ------------------
   82|    456|  case 4: method = "DELETE"; break;
  ------------------
  |  Branch (82:3): [True: 456, False: 2.77k]
  ------------------
   83|    707|  case 5: method = "OPTIONS"; break;
  ------------------
  |  Branch (83:3): [True: 707, False: 2.52k]
  ------------------
   84|  3.22k|  }
   85|       |
   86|  3.22k|  client.ProcessFuzzedResponse(stream, method);
   87|  3.22k|  return 0;
   88|  3.22k|}
_ZN12FuzzedStreamC2EPKhm:
    8|  3.22k|      : data_(data), size_(size), read_pos_(0) {}
_ZN12FuzzedStream4readEPcm:
   10|  1.81M|  ssize_t read(char *ptr, size_t size) override {
   11|  1.81M|    if (size + read_pos_ > size_) { size = size_ - read_pos_; }
  ------------------
  |  Branch (11:9): [True: 3.28k, False: 1.81M]
  ------------------
   12|  1.81M|    memcpy(ptr, data_ + read_pos_, size);
   13|  1.81M|    read_pos_ += size;
   14|  1.81M|    return static_cast<ssize_t>(size);
   15|  1.81M|  }
_ZN12FuzzedStream5writeEPKcm:
   17|  3.22k|  ssize_t write(const char *ptr, size_t size) override {
   18|  3.22k|    request_.append(ptr, size);
   19|  3.22k|    return static_cast<ssize_t>(size);
   20|  3.22k|  }
_ZN14FuzzableClientC2Ev:
   55|  3.22k|  FuzzableClient() : httplib::ClientImpl("localhost", 8080) {}
_ZN14FuzzableClient21ProcessFuzzedResponseER12FuzzedStreamRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   57|  3.22k|  void ProcessFuzzedResponse(FuzzedStream &stream, const std::string &method) {
   58|  3.22k|    httplib::Request req;
   59|  3.22k|    req.method = method;
   60|  3.22k|    req.path = "/";
   61|  3.22k|    httplib::Response res;
   62|  3.22k|    bool close_connection = false;
   63|  3.22k|    httplib::Error error = httplib::Error::Success;
   64|       |
   65|  3.22k|    process_request(stream, req, res, close_connection, error);
   66|  3.22k|  }

