_Z19destroy_global_poolv:
   39|      2|void destroy_global_pool() {
   40|      2|  if (g_pool) { mhd_pool_destroy(g_pool); g_pool = nullptr; }
  ------------------
  |  Branch (40:7): [True: 2, False: 0]
  ------------------
   41|      2|}
_Z21mark_post_parse_readyR14MHD_Connection:
   45|  2.45k|void mark_post_parse_ready(MHD_Connection& c) {
   46|  2.45k|  g_post_parse_ready.insert(&c);
   47|  2.45k|}
_Z22clear_post_parse_readyRK14MHD_Connection:
   55|  2.45k|void clear_post_parse_ready(const MHD_Connection& c) {
   56|  2.45k|  g_post_parse_ready.erase(&c);
   57|  2.45k|}
_Z20ensure_lbuf_capacityR14MHD_Connectionm:
   98|  1.01k|bool ensure_lbuf_capacity(MHD_Connection& c, size_t min_needed) {
   99|  1.01k|  if (!c.daemon) {
  ------------------
  |  Branch (99:7): [True: 0, False: 1.01k]
  ------------------
  100|      0|    return false;
  101|      0|  }
  102|       |
  103|  1.01k|  if (c.rq.cntn.lbuf.data && c.rq.cntn.lbuf.size >= min_needed) {
  ------------------
  |  Branch (103:7): [True: 0, False: 1.01k]
  |  Branch (103:30): [True: 0, False: 0]
  ------------------
  104|      0|    return true;
  105|      0|  }
  106|  1.01k|  size_t have = c.rq.cntn.lbuf.size;
  107|  1.01k|  size_t need = (min_needed > have) ? (min_needed - have) : 0;
  ------------------
  |  Branch (107:17): [True: 1.01k, False: 0]
  ------------------
  108|  1.01k|  if (need) {
  ------------------
  |  Branch (108:7): [True: 1.01k, False: 0]
  ------------------
  109|  1.01k|    mhd_daemon_extend_lbuf_up_to(c.daemon, need, &c.rq.cntn.lbuf);
  110|  1.01k|  }
  111|  1.01k|  return (c.rq.cntn.lbuf.data != nullptr) && (c.rq.cntn.lbuf.size >= min_needed);
  ------------------
  |  Branch (111:10): [True: 1.01k, False: 0]
  |  Branch (111:46): [True: 897, False: 119]
  ------------------
  112|  1.01k|}
_Z12dummy_readerP11MHD_RequestPvPK10MHD_StringPK18MHD_StringNullableS7_S7_mPKvm8MHD_Bool:
  130|    392|             uint_fast64_t, enum MHD_Bool) {
  131|    392|  return &kContinueAction;
  132|    392|}
_Z10dummy_doneP11MHD_RequestPv19MHD_PostParseResult:
  136|  2.45k|dummy_done(struct MHD_Request*, void*, enum MHD_PostParseResult) {
  137|  2.45k|  return &kContinueAction;
  138|  2.45k|}
_Z22init_daemon_connectionR18FuzzedDataProviderR10MHD_DaemonR14MHD_Connection:
  151|  2.72k|                                   MHD_Daemon& d, MHD_Connection& c) {
  152|       |  // Basic initialisation
  153|  2.72k|  d = {};
  154|  2.72k|  c = {};
  155|  2.72k|  c.daemon = &d;
  156|  2.72k|  c.pool = g_pool;
  157|       |
  158|       |  // Configure daemon memory pool
  159|  2.72k|  d.conns.cfg.mem_pool_size = g_pool_size;
  160|  2.72k|  d.conns.cfg.mem_pool_zeroing = MHD_MEMPOOL_ZEROING_ON_RESET;
  161|       |
  162|       |  // Confiugre daemon request
  163|  2.72k|  d.req_cfg.large_buf.space_left = fdp.ConsumeIntegralInRange<size_t>(256, 65536);
  164|  2.72k|  d.req_cfg.strictness = static_cast<enum MHD_ProtocolStrictLevel>(
  165|  2.72k|      fdp.ConsumeIntegralInRange<int>(0, 2));
  166|       |
  167|       |  // Safe guard for buffer space
  168|  2.72k|  if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (168:7): [True: 146, False: 2.58k]
  ------------------
  169|    146|    const size_t clamp = fdp.ConsumeIntegralInRange<size_t>(64, 512);
  170|    146|    if (d.req_cfg.large_buf.space_left > clamp)
  ------------------
  |  Branch (170:9): [True: 141, False: 5]
  ------------------
  171|    141|      d.req_cfg.large_buf.space_left = clamp;
  172|    146|  }
  173|       |
  174|       |  // Configure connection request and general settings
  175|  2.72k|  c.discard_request = false;
  176|  2.72k|  c.suspended = false;
  177|  2.72k|  c.timeout.milsec = fdp.ConsumeIntegralInRange<uint32_t>(0, 4096);
  178|  2.72k|  c.timeout.last_act = 0;
  179|       |
  180|       |  // Add dummy callback function
  181|  2.72k|  d.req_cfg.cb = dummy_request_cb;
  182|  2.72k|  d.req_cfg.cb_cls = nullptr;
  183|  2.72k|}
_Z22init_connection_bufferR18FuzzedDataProviderR14MHD_Connection:
  185|  2.72k|void init_connection_buffer(FuzzedDataProvider& fdp, MHD_Connection& c) {
  186|       |  // Prepare connection buffer in memory pool
  187|  2.72k|  size_t required = 0;
  188|  2.72k|  const size_t capacity = fdp.ConsumeIntegralInRange<size_t>(512, 16384);
  189|  2.72k|  char* buf = static_cast<char*>(mhd_pool_try_alloc(c.pool, capacity, &required));
  190|  2.72k|  if (!buf) {
  ------------------
  |  Branch (190:7): [True: 1.05k, False: 1.67k]
  ------------------
  191|  1.05k|    c.read_buffer = nullptr;
  192|  1.05k|    c.read_buffer_size = 0;
  193|  1.05k|    c.read_buffer_offset = 0;
  194|  1.05k|    return;
  195|  1.05k|  }
  196|       |
  197|       |  // Randomly choose configuration
  198|  1.67k|  std::string hdrs;
  199|  1.67k|  const std::string method = pick_method(fdp);
  200|  1.67k|  const std::string version = pick_http_version(fdp);
  201|  1.67k|  const std::string target  = (method == "*") ? "*" : (fdp.ConsumeBool() ? "/upload" : "/x?y=z");
  ------------------
  |  Branch (201:31): [True: 1.04k, False: 631]
  |  Branch (201:56): [True: 232, False: 399]
  ------------------
  202|       |
  203|       |  // Randomly break line endings in request line
  204|  1.67k|  const bool bare_lf = fdp.ConsumeBool();
  205|  1.67k|  const bool bare_cr = (!bare_lf) && fdp.ConsumeBool();
  ------------------
  |  Branch (205:24): [True: 464, False: 1.21k]
  |  Branch (205:38): [True: 82, False: 382]
  ------------------
  206|  1.67k|  auto EOL = [&](bool final=false) {
  207|  1.67k|    if (bare_lf) {
  208|  1.67k|      return std::string("\n");
  209|  1.67k|    }
  210|  1.67k|    if (bare_cr) {
  211|  1.67k|      return std::string("\r");
  212|  1.67k|    }
  213|       |
  214|  1.67k|    return std::string("\r\n");
  215|  1.67k|  };
  216|  1.67k|  std::string req = method + " " + target + " " + version + EOL();
  217|       |
  218|       |  // Host headers
  219|  1.67k|  int host_count = 0;
  220|  1.67k|  if (version == "HTTP/1.1") {
  ------------------
  |  Branch (220:7): [True: 965, False: 714]
  ------------------
  221|    965|    host_count = fdp.ConsumeIntegralInRange<int>(0,2);
  222|    965|   } else {
  223|    714|    host_count = fdp.ConsumeIntegralInRange<int>(0,1);
  224|    714|   }
  225|       |
  226|  1.92k|  for (int i = 0; i < host_count; ++i) {
  ------------------
  |  Branch (226:19): [True: 244, False: 1.67k]
  ------------------
  227|    244|    if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (227:9): [True: 103, False: 141]
  ------------------
  228|    103|      hdrs += " Host: fuzz" + std::to_string(i) + EOL();
  229|    141|    } else if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (229:16): [True: 52, False: 89]
  ------------------
  230|     52|      hdrs += "Host : fuzz" + std::to_string(i) + EOL();
  231|     89|    } else {
  232|     89|      hdrs += "Host: fuzz" + std::to_string(i) + EOL();
  233|     89|    }
  234|    244|  }
  235|       |
  236|       |  // Transfer-Encoding and Content-Length headers
  237|  1.67k|  const bool add_te = fdp.ConsumeBool();
  238|  1.67k|  const bool add_cl = fdp.ConsumeBool();
  239|  1.67k|  std::string te_val = fdp.PickValueInArray({"chunked","gzip","br","compress"});
  240|  1.67k|  if (add_te) {
  ------------------
  |  Branch (240:7): [True: 501, False: 1.17k]
  ------------------
  241|    501|    hdrs += "Transfer-Encoding: " + te_val + EOL();
  242|    501|  }
  243|  1.67k|  if (add_cl) {
  ------------------
  |  Branch (243:7): [True: 229, False: 1.45k]
  ------------------
  244|    229|    std::string cl;
  245|    229|    switch (fdp.ConsumeIntegralInRange<int>(0,3)) {
  246|     62|      case 0: cl = "0"; break;
  ------------------
  |  Branch (246:7): [True: 62, False: 167]
  ------------------
  247|     90|      case 1: cl = std::to_string(fdp.ConsumeIntegralInRange<uint32_t>(0, 1<<20));
  ------------------
  |  Branch (247:7): [True: 90, False: 139]
  ------------------
  248|     90|              break;
  249|     28|      case 2: cl = "18446744073709551616"; break;
  ------------------
  |  Branch (249:7): [True: 28, False: 201]
  ------------------
  250|     49|      default: cl = "xyz"; break;
  ------------------
  |  Branch (250:7): [True: 49, False: 180]
  ------------------
  251|    229|    }
  252|    229|    hdrs += "Content-Length: " + cl + EOL();
  253|    229|  }
  254|       |
  255|       |  // Random minimum headers
  256|  1.67k|  if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (256:7): [True: 224, False: 1.45k]
  ------------------
  257|    224|    hdrs += (fdp.ConsumeBool() ? "Expect: 100-continue" : "Expect: something-weird") + EOL();
  ------------------
  |  Branch (257:14): [True: 159, False: 65]
  ------------------
  258|    224|  }
  259|       |
  260|  1.67k|  bool detect_mpart = false;
  261|  1.67k|  switch (c.rq.app_act.head_act.data.post_parse.enc) {
  262|    902|    case MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA:
  ------------------
  |  Branch (262:5): [True: 902, False: 777]
  ------------------
  263|    902|      g_mpart_boundary = "fuzz" + std::to_string(fdp.ConsumeIntegral<uint32_t>());
  264|    902|      hdrs += "Content-Type: multipart/form-data; boundary=" + g_mpart_boundary + EOL();
  265|    902|      break;
  266|     43|    case MHD_HTTP_POST_ENCODING_FORM_URLENCODED:
  ------------------
  |  Branch (266:5): [True: 43, False: 1.63k]
  ------------------
  267|     43|      hdrs += "Content-Type: application/x-www-form-urlencoded" + EOL();
  268|     43|      break;
  269|    579|    case MHD_HTTP_POST_ENCODING_TEXT_PLAIN:
  ------------------
  |  Branch (269:5): [True: 579, False: 1.10k]
  ------------------
  270|    579|      hdrs += "Content-Type: text/plain" + EOL();
  271|    579|      break;
  272|    155|    default: case MHD_HTTP_POST_ENCODING_OTHER:
  ------------------
  |  Branch (272:5): [True: 0, False: 1.67k]
  |  Branch (272:14): [True: 155, False: 1.52k]
  ------------------
  273|    155|      detect_mpart = fdp.ConsumeBool();
  274|    155|      if (detect_mpart) {
  ------------------
  |  Branch (274:11): [True: 59, False: 96]
  ------------------
  275|     59|        g_mpart_boundary = "fuzz" + std::to_string(fdp.ConsumeIntegral<uint32_t>());
  276|     59|        hdrs += "Content-Type: multipart/form-data; boundary=" + g_mpart_boundary + EOL();
  277|     96|      } else {
  278|     96|        hdrs += std::string("Content-Type: ")
  279|     96|             + (fdp.ConsumeBool() ? "application/x-www-form-urlencoded" : "text/plain") + EOL();
  ------------------
  |  Branch (279:17): [True: 9, False: 87]
  ------------------
  280|     96|      }
  281|    155|      break;
  282|  1.67k|  }
  283|       |
  284|       |  // Randomly add some chunked headers
  285|  1.67k|  const bool add_te_chunked = fdp.ConsumeBool();
  286|  1.67k|  if (add_te_chunked) {
  ------------------
  |  Branch (286:7): [True: 343, False: 1.33k]
  ------------------
  287|    343|    hdrs += "Transfer-Encoding: chunked" + EOL();
  288|    343|  }
  289|  1.67k|  if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (289:7): [True: 256, False: 1.42k]
  ------------------
  290|    256|    const uint32_t cl = fdp.ConsumeIntegralInRange<uint32_t>(0, 256);
  291|    256|    hdrs += "Content-Length: " + std::to_string(cl) + EOL();
  292|    256|  }
  293|  1.67k|  if (add_te_chunked && fdp.ConsumeBool()) {
  ------------------
  |  Branch (293:7): [True: 343, False: 1.33k]
  |  Branch (293:25): [True: 231, False: 112]
  ------------------
  294|    231|    if (fdp.ConsumeBool())
  ------------------
  |  Branch (294:9): [True: 146, False: 85]
  ------------------
  295|    146|      hdrs += "Trailer: X-Fuzz-Trace" + EOL();
  296|     85|    else
  297|     85|      hdrs += "Trailer: X-One, X-Two" + EOL();
  298|    231|  }
  299|  1.67k|  if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (299:7): [True: 323, False: 1.35k]
  ------------------
  300|    323|    hdrs += (fdp.ConsumeBool() ? "Expect: 100-continue" : "Expect: something-weird") + EOL();
  ------------------
  |  Branch (300:14): [True: 150, False: 173]
  ------------------
  301|    323|  }
  302|       |
  303|       |  // Connection ending line
  304|  1.67k|  hdrs += "Connection: close" + EOL();
  305|  1.67k|  std::string end = EOL() + EOL();
  306|       |
  307|       |  // Write into the read buffer
  308|  1.67k|  std::string full = req + hdrs + end;
  309|  1.67k|  const size_t n = (full.size() <= capacity) ? full.size() : capacity;
  ------------------
  |  Branch (309:20): [True: 1.67k, False: 0]
  ------------------
  310|  1.67k|  memcpy(buf, full.data(), n);
  311|       |
  312|  1.67k|  c.read_buffer = buf;
  313|  1.67k|  c.read_buffer_size = capacity;
  314|  1.67k|  c.read_buffer_offset = n;
  315|  1.67k|}
_Z26init_parsing_configurationR18FuzzedDataProviderR14MHD_Connection:
  317|  2.72k|void init_parsing_configuration(FuzzedDataProvider& fdp, MHD_Connection& c) {
  318|  2.72k|  MHD_HTTP_PostEncoding enc;
  319|       |
  320|       |  // Configure connection encoding abd methods
  321|  2.72k|  if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (321:7): [True: 1.85k, False: 876]
  ------------------
  322|  1.85k|    c.rq.app_act.head_act.act = mhd_ACTION_POST_PARSE;
  323|  1.85k|  } else {
  324|    876|    c.rq.app_act.head_act.act = mhd_ACTION_NO_ACTION;
  325|    876|  }
  326|  2.72k|  if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (326:7): [True: 1.06k, False: 1.66k]
  ------------------
  327|  1.06k|    enc = MHD_HTTP_POST_ENCODING_TEXT_PLAIN;
  328|  1.66k|  } else if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (328:14): [True: 275, False: 1.39k]
  ------------------
  329|    275|    enc = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;
  330|  1.39k|  } else if (fdp.ConsumeBool()) {
  ------------------
  |  Branch (330:14): [True: 1.22k, False: 169]
  ------------------
  331|  1.22k|    enc = MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA;
  332|  1.22k|  } else {
  333|    169|    enc = MHD_HTTP_POST_ENCODING_OTHER;
  334|    169|  }
  335|       |
  336|  2.72k|  c.rq.app_act.head_act.data.post_parse.buffer_size =
  337|  2.72k|    fdp.ConsumeIntegralInRange<size_t>(1, 4096);
  338|  2.72k|  c.rq.app_act.head_act.data.post_parse.max_nonstream_size =
  339|  2.72k|    fdp.ConsumeIntegralInRange<size_t>(1, 4096);
  340|       |
  341|       |  // Confiugre head action for connection post parsing process
  342|  2.72k|  c.rq.app_act.head_act.data.post_parse.enc = enc;
  343|  2.72k|  c.rq.app_act.head_act.data.post_parse.stream_reader = dummy_reader;
  344|  2.72k|  c.rq.app_act.head_act.data.post_parse.reader_cls = nullptr;
  345|  2.72k|  c.rq.app_act.head_act.data.post_parse.done_cb = dummy_done;
  346|  2.72k|  c.rq.app_act.head_act.data.post_parse.done_cb_cls = nullptr;
  347|  2.72k|}
_Z25prepare_headers_and_parseR14MHD_Connectionm:
  349|  2.72k|void prepare_headers_and_parse(MHD_Connection& connection, size_t size) {
  350|       |  // Manually add a parameter for parsing
  351|  2.72k|  auto add_hdr = [&](const char* name_c, const std::string& val_s) {
  352|  2.72k|    const size_t nlen = strlen(name_c);
  353|  2.72k|    const size_t vlen = val_s.size();
  354|  2.72k|    char* nbuf = static_cast<char*>(mhd_stream_alloc_memory(&connection, nlen + 1));
  355|  2.72k|    char* vbuf = static_cast<char*>(mhd_stream_alloc_memory(&connection, vlen + 1));
  356|  2.72k|    if (!nbuf || !vbuf) {
  357|  2.72k|      return;
  358|  2.72k|    }
  359|  2.72k|    memcpy(nbuf, name_c, nlen); nbuf[nlen] = '\0';
  360|  2.72k|    memcpy(vbuf, val_s.data(), vlen); vbuf[vlen] = '\0';
  361|  2.72k|    struct MHD_String name;
  362|  2.72k|    name.len  = nlen;
  363|  2.72k|    name.cstr = nbuf;
  364|  2.72k|    struct MHD_String value;
  365|  2.72k|    value.len  = vlen;
  366|  2.72k|    value.cstr = vbuf;
  367|  2.72k|    mhd_stream_add_field(&connection.h1_stream, MHD_VK_HEADER, &name, &value);
  368|  2.72k|  };
  369|  2.72k|  add_hdr("Host", "fuzz");
  370|  2.72k|  if ((size & 3u) == 0u) {
  ------------------
  |  Branch (370:7): [True: 726, False: 2.00k]
  ------------------
  371|    726|    add_hdr("Transfer-Encoding", "chunked");
  372|    726|  }
  373|  2.72k|  if ((size & 7u) == 0u) {
  ------------------
  |  Branch (373:7): [True: 349, False: 2.38k]
  ------------------
  374|    349|    add_hdr("Content-Length", "0");
  375|    349|  }
  376|       |
  377|  2.72k|  bool force_mpart = (connection.rq.app_act.head_act.data.post_parse.enc
  378|  2.72k|                        == MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA);
  379|  2.72k|  if (!force_mpart) {
  ------------------
  |  Branch (379:7): [True: 1.50k, False: 1.22k]
  ------------------
  380|  1.50k|    force_mpart = ((size & 0x3Fu) == 0u);
  381|  1.50k|  }
  382|  2.72k|  if (force_mpart) {
  ------------------
  |  Branch (382:7): [True: 1.26k, False: 1.46k]
  ------------------
  383|  1.26k|    if (g_mpart_boundary.empty()) {
  ------------------
  |  Branch (383:9): [True: 0, False: 1.26k]
  ------------------
  384|      0|      g_mpart_boundary = "fuzz" + std::to_string(size ^ 0x9e3779b97f4a7c15ULL);
  385|      0|    }
  386|  1.26k|    std::string ct = "multipart/form-data; boundary=" + g_mpart_boundary;
  387|  1.26k|    add_hdr("Content-Type", ct);
  388|  1.26k|  }
  389|       |
  390|       |  // If we wrote a real HTTP header for multipart, parse it so Content-Type is visible
  391|  2.72k|  connection.stage = mhd_HTTP_STAGE_INIT;
  392|  2.72k|  bool got_line = mhd_stream_get_request_line(&connection);
  393|  2.72k|  if (destroy_error_response(connection)) {
  ------------------
  |  Branch (393:7): [True: 242, False: 2.48k]
  ------------------
  394|    242|    return;
  395|    242|  }
  396|  2.48k|  if (got_line && connection.stage == mhd_HTTP_STAGE_REQ_LINE_RECEIVED) {
  ------------------
  |  Branch (396:7): [True: 1.43k, False: 1.05k]
  |  Branch (396:19): [True: 798, False: 639]
  ------------------
  397|    798|    mhd_stream_switch_to_rq_headers_proc(&connection);
  398|    798|  }
  399|  2.48k|  mhd_stream_parse_request_headers(&connection);
  400|       |
  401|       |  // Only proceed to post-parse if header parsing did not bail out
  402|  2.48k|  destroy_error_response(connection);
  403|  2.48k|}
_Z24prepare_body_and_processR14MHD_ConnectionRNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmb:
  405|  2.45k|void prepare_body_and_process(MHD_Connection& connection, std::string& body, size_t body_size, bool use_stream_body) {
  406|       |  // Use streaming if boundary is not empty
  407|  2.45k|  if (!g_mpart_boundary.empty()) {
  ------------------
  |  Branch (407:7): [True: 2.45k, False: 0]
  ------------------
  408|  2.45k|    std::string wrapped;
  409|  2.45k|    wrapped.reserve(body.size() + g_mpart_boundary.size() * 2 + 128);
  410|  2.45k|    wrapped += "\r\n--"; wrapped += g_mpart_boundary; wrapped += "\r\n";
  411|  2.45k|    wrapped += "Content-Disposition: form-data; name=\"x\"; filename=\"f\"\r\n";
  412|  2.45k|    wrapped += "Content-Type: application/octet-stream\r\n\r\n";
  413|  2.45k|    wrapped += body; wrapped += "\r\n";
  414|  2.45k|    wrapped += "--"; wrapped += g_mpart_boundary; wrapped += "--\r\n";
  415|  2.45k|    body.swap(wrapped);
  416|  2.45k|    body_size = body.size();
  417|  2.45k|  }
  418|       |
  419|  2.45k|  if (!use_stream_body) {
  ------------------
  |  Branch (419:7): [True: 1.20k, False: 1.24k]
  ------------------
  420|       |    // Fuzz mhd_stream_prepare_for_post_parse once and mhd_stream_post_parse
  421|  1.20k|    mhd_stream_prepare_for_post_parse(&connection);
  422|  1.20k|    mhd_stream_post_parse(&connection, &body_size, &body[0]);
  423|  1.20k|    mark_post_parse_ready(connection);
  424|  1.24k|  } else {
  425|       |    // Try prepare the body by streaming connection buffer
  426|  1.24k|    const bool want_chunked = (connection.rq.have_chunked_upload == MHD_YES);
  427|       |
  428|  1.24k|    std::string to_feed;
  429|  1.24k|    if (want_chunked) {
  ------------------
  |  Branch (429:9): [True: 377, False: 867]
  ------------------
  430|    377|      auto append_chunk = [&](const char* data, size_t len) {
  431|    377|        char hex[32];
  432|    377|        const int n = snprintf(hex, sizeof(hex), "%zx", len);
  433|    377|        to_feed.append(hex, (size_t)n);
  434|    377|        if ((len & 3u) == 0u) {
  435|    377|          to_feed += ";ext=1";
  436|    377|        }
  437|    377|        to_feed += "\r\n";
  438|    377|        to_feed.append(data, len);
  439|    377|        to_feed += "\r\n";
  440|    377|      };
  441|    377|      if (body_size <= 32) {
  ------------------
  |  Branch (441:11): [True: 0, False: 377]
  ------------------
  442|      0|        append_chunk(body.data(), body_size);
  443|    377|      } else {
  444|    377|        const size_t mid = body_size / 2;
  445|    377|        append_chunk(body.data(), mid);
  446|    377|        append_chunk(body.data() + mid, body_size - mid);
  447|    377|      }
  448|    377|      to_feed += "0\r\n";
  449|    377|      if (body_size & 1) {
  ------------------
  |  Branch (449:11): [True: 132, False: 245]
  ------------------
  450|    132|        to_feed += "X-Fuzz-Trace: 1\r\n\r\n";
  451|    245|      } else {
  452|    245|        to_feed += "\r\n";
  453|    245|      }
  454|    867|    } else {
  455|       |      // Non-chunked body is handled as is
  456|    867|      to_feed.assign(body.data(), body_size);
  457|    867|    }
  458|       |
  459|       |    // Stage into the connection read buffer (allocate if needed).
  460|  1.24k|    size_t feed_sz = to_feed.size();
  461|  1.24k|    bool staged = false;
  462|  1.24k|    if (connection.read_buffer && connection.read_buffer_size >= feed_sz) {
  ------------------
  |  Branch (462:9): [True: 562, False: 682]
  |  Branch (462:35): [True: 339, False: 223]
  ------------------
  463|    339|      memcpy(connection.read_buffer, to_feed.data(), feed_sz);
  464|    339|      connection.read_buffer_offset = feed_sz;
  465|    339|      staged = true;
  466|    905|    } else {
  467|    905|      size_t need = 0;
  468|    905|      char *nb = (char*) mhd_pool_try_alloc(connection.pool, feed_sz, &need);
  469|    905|      if (nb) {
  ------------------
  |  Branch (469:11): [True: 677, False: 228]
  ------------------
  470|    677|        memcpy(nb, to_feed.data(), feed_sz);
  471|    677|        connection.read_buffer = nb;
  472|    677|        connection.read_buffer_size = feed_sz;
  473|    677|        connection.read_buffer_offset = feed_sz;
  474|    677|        staged = true;
  475|    677|      }
  476|    905|    }
  477|       |
  478|  1.24k|    if (staged) {
  ------------------
  |  Branch (478:9): [True: 1.01k, False: 228]
  ------------------
  479|       |      // Use stream body approach if success
  480|  1.01k|      const size_t min_needed = body_size + 1;
  481|  1.01k|      if (ensure_lbuf_capacity(connection, min_needed)) {
  ------------------
  |  Branch (481:11): [True: 897, False: 119]
  ------------------
  482|       |        // Only post parse the request if buffer is enough
  483|    897|        connection.stage = mhd_HTTP_STAGE_BODY_RECEIVING;
  484|    897|        connection.rq.have_chunked_upload = MHD_NO;
  485|    897|        connection.rq.cntn.cntn_size = (uint64_t) body_size;
  486|    897|        mhd_stream_prepare_for_post_parse(&connection);
  487|    897|        mhd_stream_process_request_body(&connection);
  488|    897|        mark_post_parse_ready(connection);
  489|    897|      } else {
  490|       |        // Fall back if not enough buffer
  491|    119|        size_t tmp = body_size;
  492|    119|        mhd_stream_prepare_for_post_parse(&connection);
  493|    119|        mhd_stream_post_parse(&connection, &tmp, body.data());
  494|    119|        mark_post_parse_ready(connection);
  495|    119|      }
  496|  1.01k|    } else {
  497|       |      // Use post prase approach if stream body failed
  498|    228|      mhd_stream_prepare_for_post_parse(&connection);
  499|    228|      mhd_stream_post_parse(&connection, &body_size, &body[0]);
  500|    228|      mark_post_parse_ready(connection);
  501|    228|    }
  502|  1.24k|  }
  503|  2.45k|}
_Z13final_cleanupR14MHD_ConnectionR10MHD_Daemon:
  505|  2.45k|void final_cleanup(MHD_Connection& connection, MHD_Daemon& daemon) {
  506|       |  // Post process response
  507|  2.45k|  mhd_stream_switch_from_recv_to_send(&connection);
  508|  2.45k|  mhd_stream_process_req_recv_finished(&connection);
  509|  2.45k|  mhd_stream_release_write_buffer(&connection);
  510|       |
  511|       |  // Release buffers in daemon to avoid memory leakage
  512|  2.45k|  if (connection.rq.cntn.lbuf.data != nullptr || connection.rq.cntn.lbuf.size != 0) {
  ------------------
  |  Branch (512:7): [True: 0, False: 2.45k]
  |  Branch (512:50): [True: 0, False: 2.45k]
  ------------------
  513|      0|    mhd_daemon_free_lbuf(&daemon, &connection.rq.cntn.lbuf);
  514|      0|  }
  515|       |
  516|       |  // Clean post parse body status
  517|  2.45k|  clear_post_parse_ready(connection);
  518|  2.45k|}
connection_helper.cpp:_ZL11pick_methodR18FuzzedDataProvider:
   71|  1.67k|static std::string pick_method(FuzzedDataProvider& fdp) {
   72|  1.67k|  static const char* kMethods[] = {
   73|  1.67k|    "GET","POST","PUT","HEAD","DELETE","CONNECT","OPTIONS","TRACE","*"
   74|  1.67k|  };
   75|  1.67k|  return std::string(fdp.PickValueInArray(kMethods));
   76|  1.67k|}
connection_helper.cpp:_ZL17pick_http_versionR18FuzzedDataProvider:
   79|  1.67k|static std::string pick_http_version(FuzzedDataProvider& fdp) {
   80|       |  // Common + a chance to be malformed to trigger version errors.
   81|  1.67k|  switch (fdp.ConsumeIntegralInRange<int>(0, 5)) {
   82|    963|    case 0: return "HTTP/1.1";
  ------------------
  |  Branch (82:5): [True: 963, False: 716]
  ------------------
   83|    275|    case 1: return "HTTP/1.0";
  ------------------
  |  Branch (83:5): [True: 275, False: 1.40k]
  ------------------
   84|    105|    case 2: return "HTTP/2.0";
  ------------------
  |  Branch (84:5): [True: 105, False: 1.57k]
  ------------------
   85|    152|    case 3: return "HTTP/0.9";
  ------------------
  |  Branch (85:5): [True: 152, False: 1.52k]
  ------------------
   86|    127|    case 4: return "HTTX/1.1";
  ------------------
  |  Branch (86:5): [True: 127, False: 1.55k]
  ------------------
   87|     57|    default: {
  ------------------
  |  Branch (87:5): [True: 57, False: 1.62k]
  ------------------
   88|     57|      std::string s = "HTTP/";
   89|     57|      s.push_back(char('0' + fdp.ConsumeIntegralInRange<int>(0,9)));
   90|     57|      s.push_back('.');
   91|     57|      s.push_back(char('0' + fdp.ConsumeIntegralInRange<int>(0,9)));
   92|     57|      return s;
   93|      0|    }
   94|  1.67k|  }
   95|  1.67k|}
connection_helper.cpp:_ZZ22init_connection_bufferR18FuzzedDataProviderR14MHD_ConnectionENK3$_0clEb:
  206|  10.7k|  auto EOL = [&](bool final=false) {
  207|  10.7k|    if (bare_lf) {
  ------------------
  |  Branch (207:9): [True: 7.95k, False: 2.79k]
  ------------------
  208|  7.95k|      return std::string("\n");
  209|  7.95k|    }
  210|  2.79k|    if (bare_cr) {
  ------------------
  |  Branch (210:9): [True: 560, False: 2.23k]
  ------------------
  211|    560|      return std::string("\r");
  212|    560|    }
  213|       |
  214|  2.23k|    return std::string("\r\n");
  215|  2.79k|  };
connection_helper.cpp:_ZZ25prepare_headers_and_parseR14MHD_ConnectionmENK3$_0clEPKcRKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  351|  5.06k|  auto add_hdr = [&](const char* name_c, const std::string& val_s) {
  352|  5.06k|    const size_t nlen = strlen(name_c);
  353|  5.06k|    const size_t vlen = val_s.size();
  354|  5.06k|    char* nbuf = static_cast<char*>(mhd_stream_alloc_memory(&connection, nlen + 1));
  355|  5.06k|    char* vbuf = static_cast<char*>(mhd_stream_alloc_memory(&connection, vlen + 1));
  356|  5.06k|    if (!nbuf || !vbuf) {
  ------------------
  |  Branch (356:9): [True: 51, False: 5.01k]
  |  Branch (356:18): [True: 16, False: 5.00k]
  ------------------
  357|     67|      return;
  358|     67|    }
  359|  5.00k|    memcpy(nbuf, name_c, nlen); nbuf[nlen] = '\0';
  360|  5.00k|    memcpy(vbuf, val_s.data(), vlen); vbuf[vlen] = '\0';
  361|  5.00k|    struct MHD_String name;
  362|  5.00k|    name.len  = nlen;
  363|  5.00k|    name.cstr = nbuf;
  364|  5.00k|    struct MHD_String value;
  365|  5.00k|    value.len  = vlen;
  366|  5.00k|    value.cstr = vbuf;
  367|  5.00k|    mhd_stream_add_field(&connection.h1_stream, MHD_VK_HEADER, &name, &value);
  368|  5.00k|  };
connection_helper.cpp:_ZL22destroy_error_response14MHD_Connection:
   60|  5.21k|static bool destroy_error_response(MHD_Connection c) {
   61|  5.21k|  if (c.stage == mhd_HTTP_STAGE_START_REPLY) {
  ------------------
  |  Branch (61:7): [True: 522, False: 4.69k]
  ------------------
   62|    522|    MHD_response_destroy(c.rp.response);
   63|    522|    c.rp.response = nullptr;
   64|    522|    return true;
   65|    522|  }
   66|       |
   67|  4.69k|  return false;
   68|  5.21k|}
connection_helper.cpp:_ZZ24prepare_body_and_processR14MHD_ConnectionRNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmbENK3$_0clEPKcm:
  430|    754|      auto append_chunk = [&](const char* data, size_t len) {
  431|    754|        char hex[32];
  432|    754|        const int n = snprintf(hex, sizeof(hex), "%zx", len);
  433|    754|        to_feed.append(hex, (size_t)n);
  434|    754|        if ((len & 3u) == 0u) {
  ------------------
  |  Branch (434:13): [True: 277, False: 477]
  ------------------
  435|    277|          to_feed += ";ext=1";
  436|    277|        }
  437|    754|        to_feed += "\r\n";
  438|    754|        to_feed.append(data, len);
  439|    754|        to_feed += "\r\n";
  440|    754|      };

LLVMFuzzerInitialize:
   87|      2|extern "C" int LLVMFuzzerInitialize() {
   88|      2|  g_pool = mhd_pool_create(g_pool_size, MHD_MEMPOOL_ZEROING_ON_RESET);
   89|      2|  atexit(destroy_global_pool);
   90|      2|  return 0;
   91|      2|}
LLVMFuzzerTestOneInput:
   93|  2.72k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   94|  2.72k|  if (size == 0 || g_pool == nullptr) {
  ------------------
  |  Branch (94:7): [True: 0, False: 2.72k]
  |  Branch (94:20): [True: 0, False: 2.72k]
  ------------------
   95|      0|    return 0;
   96|      0|  }
   97|       |
   98|  2.72k|  FuzzedDataProvider fdp(data, size);
   99|       |
  100|       |  // Reseting the memory pool for each iteartion
  101|  2.72k|  mhd_pool_destroy(g_pool);
  102|  2.72k|  g_pool = mhd_pool_create(g_pool_size, MHD_MEMPOOL_ZEROING_ON_RESET);
  103|       |
  104|       |  // Initialising the daemon, connection and other MHD components
  105|  2.72k|  MHD_Daemon daemon;
  106|  2.72k|  MHD_Connection connection;
  107|  2.72k|  init_daemon_connection(fdp, daemon, connection);
  108|  2.72k|  init_parsing_configuration(fdp, connection);
  109|  2.72k|  init_connection_buffer(fdp, connection);
  110|  2.72k|  prepare_headers_and_parse(connection, size);
  111|       |
  112|       |  // Randomly choose how many targets to fuzz
  113|  2.72k|  std::vector<int> selectors;
  114|  7.26k|  for (int i = 0; i < fdp.ConsumeIntegralInRange<int>(1, 8); i++) {
  ------------------
  |  Branch (114:19): [True: 4.53k, False: 2.72k]
  ------------------
  115|  4.53k|    selectors.push_back(fdp.ConsumeIntegralInRange<int>(0, 9));
  116|  4.53k|  }
  117|       |
  118|       |  // Generate random body and stream it in the connection
  119|  2.72k|  bool use_stream_body = fdp.ConsumeBool();
  120|       |
  121|       |  // Use remaining bytes to generate random body for fuzzing
  122|  2.72k|  std::string body = fdp.ConsumeRemainingBytesAsString();
  123|  2.72k|  size_t body_size = body.size();
  124|  2.72k|  if (body_size == 0) {
  ------------------
  |  Branch (124:7): [True: 276, False: 2.45k]
  ------------------
  125|    276|    return 0;
  126|    276|  }
  127|  2.45k|  prepare_body_and_process(connection, body, body_size, use_stream_body);
  128|       |
  129|       |  // Fuzz random round of target functions
  130|  4.20k|  for (int selector : selectors) {
  ------------------
  |  Branch (130:21): [True: 4.20k, False: 2.45k]
  ------------------
  131|  4.20k|    switch (selector) {
  ------------------
  |  Branch (131:13): [True: 4.20k, False: 0]
  ------------------
  132|    945|      case 0: {
  ------------------
  |  Branch (132:7): [True: 945, False: 3.26k]
  ------------------
  133|    945|        mhd_conn_is_timeout_expired(&connection);
  134|    945|        break;
  135|      0|      }
  136|    383|      case 1: {
  ------------------
  |  Branch (136:7): [True: 383, False: 3.82k]
  ------------------
  137|    383|        mhd_stream_switch_to_rq_headers_proc(&connection);
  138|    383|        break;
  139|      0|      }
  140|    409|      case 2: {
  ------------------
  |  Branch (140:7): [True: 409, False: 3.79k]
  ------------------
  141|    409|        const struct MHD_UploadAction* act = &kContinueAction;
  142|    409|        mhd_stream_process_upload_action(&connection, &kContinueAction, false);
  143|    409|        mhd_stream_process_upload_action(&connection, &kSuspend, false);
  144|    409|        mhd_stream_process_upload_action(&connection, &kAbort, true);
  145|    409|        break;
  146|      0|      }
  147|    246|      case 3: {
  ------------------
  |  Branch (147:7): [True: 246, False: 3.96k]
  ------------------
  148|    246|        connection.stage = mhd_HTTP_STAGE_REQ_RECV_FINISHED;
  149|    246|        mhd_stream_process_req_recv_finished(&connection);
  150|    246|        break;
  151|      0|      }
  152|    241|      case 4: {
  ------------------
  |  Branch (152:7): [True: 241, False: 3.96k]
  ------------------
  153|    241|        mhd_stream_reset_rq_hdr_proc_state(&connection);
  154|    241|        break;
  155|      0|      }
  156|    667|      case 5: {
  ------------------
  |  Branch (156:7): [True: 667, False: 3.53k]
  ------------------
  157|    667|        mhd_stream_alloc_memory(&connection, 1024);
  158|    667|        break;
  159|      0|      }
  160|    283|      case 6: {
  ------------------
  |  Branch (160:7): [True: 283, False: 3.92k]
  ------------------
  161|       |        // Safe guard for out of buffer space
  162|    283|        if (connection.write_buffer_send_offset > connection.write_buffer_append_offset) {
  ------------------
  |  Branch (162:13): [True: 0, False: 283]
  ------------------
  163|      0|          connection.write_buffer_send_offset = connection.write_buffer_append_offset;
  164|      0|        }
  165|    283|        mhd_stream_maximize_write_buffer(&connection);
  166|    283|        break;
  167|      0|      }
  168|    348|      case 7: {
  ------------------
  |  Branch (168:7): [True: 348, False: 3.85k]
  ------------------
  169|       |        // Safe guard for out of buffer space
  170|    348|        connection.write_buffer_send_offset = connection.write_buffer_append_offset;
  171|    348|        mhd_stream_release_write_buffer(&connection);
  172|    348|        break;
  173|      0|      }
  174|    398|      case 8: {
  ------------------
  |  Branch (174:7): [True: 398, False: 3.80k]
  ------------------
  175|       |        // Safe guard for out of buffer read
  176|    398|        if (connection.read_buffer_offset > connection.read_buffer_size) {
  ------------------
  |  Branch (176:13): [True: 0, False: 398]
  ------------------
  177|      0|          connection.read_buffer_offset = connection.read_buffer_size;
  178|      0|        }
  179|    398|        mhd_stream_shrink_read_buffer(&connection);
  180|    398|        break;
  181|      0|      }
  182|    286|      case 9: {
  ------------------
  |  Branch (182:7): [True: 286, False: 3.92k]
  ------------------
  183|    286|        mhd_stream_switch_from_recv_to_send(&connection);
  184|    286|        break;
  185|      0|      }
  186|  4.20k|    }
  187|  4.20k|  }
  188|       |
  189|       |  // Fuzz mhd_stream_process_post_finish
  190|  2.45k|  fuzz_mhd_stream_process_post_finish(connection, daemon, body);
  191|       |
  192|       |  // Final cleanup to avoid memory leak
  193|  2.45k|  final_cleanup(connection, daemon);
  194|       |
  195|  2.45k|  return 0;
  196|  2.45k|}
fuzz_connection.cpp:_ZL35fuzz_mhd_stream_process_post_finishR14MHD_ConnectionR10MHD_DaemonRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
   34|  2.45k|static void fuzz_mhd_stream_process_post_finish(MHD_Connection& connection, MHD_Daemon& daemon, const std::string& body) {
   35|  2.45k|  struct mhd_PostParserData *p = &connection.rq.u_proc.post;
   36|  2.45k|  size_t pos  = p->next_parse_pos;
   37|  2.45k|  size_t need = ((p->lbuf_used > pos) ? p->lbuf_used : pos) + 1; // +1 for NUL
  ------------------
  |  Branch (37:18): [True: 695, False: 1.75k]
  ------------------
   38|  2.45k|  if (connection.rq.cntn.lbuf.size < need) {
  ------------------
  |  Branch (38:7): [True: 808, False: 1.64k]
  ------------------
   39|    808|    size_t delta = need - connection.rq.cntn.lbuf.size;
   40|    808|    if (delta != 0)
  ------------------
  |  Branch (40:9): [True: 808, False: 0]
  ------------------
   41|    808|      mhd_daemon_extend_lbuf_up_to(&daemon, delta, &connection.rq.cntn.lbuf);
   42|    808|  }
   43|       |
   44|  2.45k|  if (connection.rq.cntn.lbuf.data == nullptr && !body.empty()) {
  ------------------
  |  Branch (44:7): [True: 0, False: 2.45k]
  |  Branch (44:50): [True: 0, False: 0]
  ------------------
   45|      0|    size_t to_copy = (body.size() < (size_t)p->lbuf_limit) ? body.size() : (size_t)p->lbuf_limit;
  ------------------
  |  Branch (45:22): [True: 0, False: 0]
  ------------------
   46|      0|    size_t min_needed = to_copy + 1; // 1 byte for \0 terminator
   47|      0|    if (connection.rq.cntn.lbuf.size < min_needed) {
  ------------------
  |  Branch (47:9): [True: 0, False: 0]
  ------------------
   48|      0|      size_t delta = min_needed - connection.rq.cntn.lbuf.size;
   49|      0|      if (delta != 0)
  ------------------
  |  Branch (49:11): [True: 0, False: 0]
  ------------------
   50|      0|        mhd_daemon_extend_lbuf_up_to(&daemon, delta, &connection.rq.cntn.lbuf);
   51|      0|    }
   52|      0|    if (connection.rq.cntn.lbuf.data != nullptr) {
  ------------------
  |  Branch (52:9): [True: 0, False: 0]
  ------------------
   53|      0|      memcpy(connection.rq.cntn.lbuf.data, body.data(), to_copy);
   54|      0|      p->lbuf_used = to_copy;
   55|      0|    }
   56|      0|  }
   57|       |
   58|       |  // Fail back to Text encoding
   59|  2.45k|  if (p->enc == MHD_HTTP_POST_ENCODING_OTHER) {
  ------------------
  |  Branch (59:7): [True: 201, False: 2.25k]
  ------------------
   60|    201|    p->enc = MHD_HTTP_POST_ENCODING_TEXT_PLAIN;
   61|    201|  }
   62|  2.45k|  mhd_stream_prepare_for_post_parse(&connection);
   63|  2.45k|  mhd_stream_process_post_finish(&connection);
   64|       |
   65|  2.45k|  bool can_finish = (connection.rq.cntn.lbuf.data != nullptr);
   66|  2.45k|  if (can_finish && connection.rq.u_proc.post.enc == MHD_HTTP_POST_ENCODING_FORM_URLENCODED) {
  ------------------
  |  Branch (66:7): [True: 0, False: 2.45k]
  |  Branch (66:21): [True: 0, False: 0]
  ------------------
   67|      0|    size_t pos = connection.rq.u_proc.post.next_parse_pos;
   68|      0|    if (pos >= connection.rq.cntn.lbuf.size) {
  ------------------
  |  Branch (68:9): [True: 0, False: 0]
  ------------------
   69|      0|      mhd_daemon_extend_lbuf_up_to(&daemon, 1, &connection.rq.cntn.lbuf);
   70|      0|      if (pos >= connection.rq.cntn.lbuf.size)
  ------------------
  |  Branch (70:11): [True: 0, False: 0]
  ------------------
   71|      0|        can_finish = false;
   72|      0|    }
   73|      0|  }
   74|       |
   75|  2.45k|  if (can_finish) {
  ------------------
  |  Branch (75:7): [True: 0, False: 2.45k]
  ------------------
   76|      0|    if (connection.rq.u_proc.post.enc == MHD_HTTP_POST_ENCODING_OTHER) {
  ------------------
  |  Branch (76:9): [True: 0, False: 0]
  ------------------
   77|      0|      if (connection.rq.app_act.head_act.data.post_parse.enc == MHD_HTTP_POST_ENCODING_OTHER)
  ------------------
  |  Branch (77:11): [True: 0, False: 0]
  ------------------
   78|      0|        connection.rq.app_act.head_act.data.post_parse.enc = MHD_HTTP_POST_ENCODING_TEXT_PLAIN;
   79|      0|      mhd_stream_prepare_for_post_parse(&connection);
   80|      0|    }
   81|      0|    mhd_stream_process_post_finish(&connection);
   82|      0|  }
   83|  2.45k|}

_Z25mhd_conn_get_timeout_leftPK14MHD_Connectionm:
   65|    945|{
   66|    945|  mhd_constexpr uint_fast64_t uifast64_hibit =
  ------------------
  |  |   55|    945|#  define mhd_constexpr static constexpr
  ------------------
   67|    945|    (uint_fast64_t)(~(((uint_fast64_t)(~((uint_fast64_t)0))) >> 1u));
   68|    945|  const uint_fast64_t timeout = c->timeout.milsec;
   69|    945|  uint_fast64_t timedout_time;
   70|    945|  uint_fast64_t timeout_left;
   71|       |
   72|    945|  mhd_assert (!c->suspended);
  ------------------
  |  |   66|    945|#  define mhd_assert(ignore) ((void) 0)
  ------------------
   73|       |
   74|    945|  if (0u == timeout)
  ------------------
  |  Branch (74:7): [True: 114, False: 831]
  ------------------
   75|    114|    return (uint_fast64_t)0xFFFFFFFFFFFFFFFFu;
   76|       |
   77|       |  /* The logic used in these calculations allows values wrap over the maximum
   78|       |     value (taking into account that maximum timeout time is limited) */
   79|    831|  timedout_time =
   80|    831|    c->timeout.last_act + c->timeout.milsec + 1u; /* '+1' to not expire at exactly 'timeout' milliseconds */
   81|       |  /* Time before timed out moment */
   82|    831|  timeout_left = timedout_time - cur_milsec;
   83|       |
   84|    831|  if (0u == (timeout_left & uifast64_hibit))
  ------------------
  |  Branch (84:7): [True: 0, False: 831]
  ------------------
   85|      0|  {
   86|       |    /* "Timeout left" must be always less or equal the timeout value (plus one)
   87|       |       unless the system clock jumped back. */
   88|      0|    mhd_assert ((timeout_left <= (c->timeout.milsec + 1u))
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
   89|      0|                || ((cur_milsec - c->timeout.last_act)
   90|      0|                    > (c->timeout.last_act - cur_milsec)));
   91|       |
   92|      0|    return timeout_left;
   93|      0|  }
   94|       |
   95|    831|  return 0u; /* Already timed out */
   96|    831|}
_Z27mhd_conn_is_timeout_expiredP14MHD_Connection:
  101|    945|{
  102|    945|  struct MHD_Daemon *const restrict d = c->daemon;
  103|       |
  104|    945|  return (0u == mhd_conn_get_timeout_left (c,
  105|    945|                                           mhd_daemon_get_milsec_counter (d)));
  106|    945|}
_Z32mhd_conn_deinit_activity_timeoutP14MHD_Connection:
  151|  4.71k|{
  152|  4.71k|  struct MHD_Daemon *const restrict d = c->daemon;
  153|       |
  154|  4.71k|#if defined(MHD_SUPPORT_THREADS)
  155|  4.71k|  mhd_assert (!mhd_D_HAS_WORKERS (d));
  ------------------
  |  |   66|  4.71k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  156|  4.71k|#endif /* MHD_SUPPORT_THREADS */
  157|       |
  158|  4.71k|  if (0u == c->timeout.milsec)
  ------------------
  |  Branch (158:7): [True: 378, False: 4.33k]
  ------------------
  159|    378|  {
  160|    378|    mhd_assert (!c->timeout.in_cstm_tmout_list);
  ------------------
  |  |   66|    378|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  161|    378|    return;
  162|    378|  }
  163|       |
  164|  4.33k|  if (mhd_D_HAS_THR_PER_CONN (d))
  ------------------
  |  | 1531|  4.33k|          (mhd_WM_INT_INTERNAL_EVENTS_THREAD_PER_CONNECTION == \
  |  |  ------------------
  |  |  |  Branch (1531:11): [True: 0, False: 4.33k]
  |  |  ------------------
  |  | 1532|  4.33k|           ((d)->wmode_int))
  ------------------
  165|      0|  {
  166|      0|    mhd_assert (!c->timeout.in_cstm_tmout_list);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  167|      0|    return;
  168|      0|  }
  169|       |
  170|  4.33k|  if (!c->timeout.in_cstm_tmout_list)
  ------------------
  |  Branch (170:7): [True: 4.33k, False: 0]
  ------------------
  171|  4.33k|    mhd_DLINKEDL_DEL_D (&(d->conns.def_timeout),
  ------------------
  |  |  215|  4.33k|#define mhd_DLINKEDL_DEL_D(p_list, p_obj, links_name) do {  \
  |  |  216|  4.33k|        mhd_ASSUME (NULL != (p_list)->first);             \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  217|  4.33k|        mhd_ASSUME (NULL != (p_list)->last);              \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  218|  4.33k|        mhd_ASSUME (NULL == (p_list)->first->links_name.prev); \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|  4.33k|        mhd_ASSUME (NULL == (p_list)->last->links_name.next);  \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  220|  4.33k|        mhd_ASSUME ((p_obj) != (p_obj)->links_name.prev);      \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|  4.33k|        mhd_ASSUME ((p_list)->last != (p_obj)->links_name.prev);  \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  222|  4.33k|        mhd_ASSUME ((p_obj) != (p_obj)->links_name.next);         \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  223|  4.33k|        mhd_ASSUME ((p_list)->first != (p_obj)->links_name.next); \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  224|  4.33k|        if (NULL != (p_obj)->links_name.next)             \
  |  |  ------------------
  |  |  |  Branch (224:13): [True: 0, False: 4.33k]
  |  |  ------------------
  |  |  225|  4.33k|        { mhd_ASSUME ((p_obj) == (p_obj)->links_name.next->links_name.prev); \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  226|      0|          mhd_ASSUME ((p_obj) != (p_list)->last);       \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  227|      0|          mhd_ASSUME ((p_obj)->links_name.next !=       \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  228|      0|                      (p_obj)->links_name.prev);        \
  |  |  229|      0|          (p_obj)->links_name.next->links_name.prev =   \
  |  |  230|      0|            (p_obj)->links_name.prev; } else            \
  |  |  231|  4.33k|        { mhd_ASSUME ((p_obj) == (p_list)->last);       \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  232|  4.33k|          (p_list)->last = (p_obj)->links_name.prev; }  \
  |  |  233|  4.33k|        if (NULL != (p_obj)->links_name.prev)           \
  |  |  ------------------
  |  |  |  Branch (233:13): [True: 0, False: 4.33k]
  |  |  ------------------
  |  |  234|  4.33k|        { mhd_ASSUME ((p_obj) == (p_obj)->links_name.prev->links_name.next); \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  235|      0|          mhd_ASSUME ((p_obj) != (p_list)->first);      \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  236|      0|          mhd_ASSUME ((p_obj)->links_name.next !=       \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  237|      0|                      (p_obj)->links_name.prev);        \
  |  |  238|      0|          (p_obj)->links_name.prev->links_name.next =   \
  |  |  239|      0|            (p_obj)->links_name.next; } else            \
  |  |  240|  4.33k|        { mhd_ASSUME ((p_obj) == (p_list)->first);      \
  |  |  ------------------
  |  |  |  |   80|  4.33k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|  4.33k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  241|  4.33k|          (p_list)->first = (p_obj)->links_name.next; } \
  |  |  242|  4.33k|        (p_obj)->links_name.prev = NULL;                \
  |  |  243|  4.33k|        (p_obj)->links_name.next = NULL;  } while (0)
  |  |  ------------------
  |  |  |  Branch (243:52): [Folded, False: 4.33k]
  |  |  ------------------
  ------------------
  172|  4.33k|                        c,
  173|  4.33k|                        timeout.tmout_list);
  174|      0|  else
  175|      0|    mhd_DLINKEDL_DEL_D (&(d->conns.cust_timeout), \
  ------------------
  |  |  215|      0|#define mhd_DLINKEDL_DEL_D(p_list, p_obj, links_name) do {  \
  |  |  216|      0|        mhd_ASSUME (NULL != (p_list)->first);             \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  217|      0|        mhd_ASSUME (NULL != (p_list)->last);              \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  218|      0|        mhd_ASSUME (NULL == (p_list)->first->links_name.prev); \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|      0|        mhd_ASSUME (NULL == (p_list)->last->links_name.next);  \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  220|      0|        mhd_ASSUME ((p_obj) != (p_obj)->links_name.prev);      \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  221|      0|        mhd_ASSUME ((p_list)->last != (p_obj)->links_name.prev);  \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  222|      0|        mhd_ASSUME ((p_obj) != (p_obj)->links_name.next);         \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  223|      0|        mhd_ASSUME ((p_list)->first != (p_obj)->links_name.next); \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  224|      0|        if (NULL != (p_obj)->links_name.next)             \
  |  |  ------------------
  |  |  |  Branch (224:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  225|      0|        { mhd_ASSUME ((p_obj) == (p_obj)->links_name.next->links_name.prev); \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  226|      0|          mhd_ASSUME ((p_obj) != (p_list)->last);       \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  227|      0|          mhd_ASSUME ((p_obj)->links_name.next !=       \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  228|      0|                      (p_obj)->links_name.prev);        \
  |  |  229|      0|          (p_obj)->links_name.next->links_name.prev =   \
  |  |  230|      0|            (p_obj)->links_name.prev; } else            \
  |  |  231|      0|        { mhd_ASSUME ((p_obj) == (p_list)->last);       \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  232|      0|          (p_list)->last = (p_obj)->links_name.prev; }  \
  |  |  233|      0|        if (NULL != (p_obj)->links_name.prev)           \
  |  |  ------------------
  |  |  |  Branch (233:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  234|      0|        { mhd_ASSUME ((p_obj) == (p_obj)->links_name.prev->links_name.next); \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  235|      0|          mhd_ASSUME ((p_obj) != (p_list)->first);      \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  236|      0|          mhd_ASSUME ((p_obj)->links_name.next !=       \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  237|      0|                      (p_obj)->links_name.prev);        \
  |  |  238|      0|          (p_obj)->links_name.prev->links_name.next =   \
  |  |  239|      0|            (p_obj)->links_name.next; } else            \
  |  |  240|      0|        { mhd_ASSUME ((p_obj) == (p_list)->first);      \
  |  |  ------------------
  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  ------------------
  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  241|      0|          (p_list)->first = (p_obj)->links_name.next; } \
  |  |  242|      0|        (p_obj)->links_name.prev = NULL;                \
  |  |  243|      0|        (p_obj)->links_name.next = NULL;  } while (0)
  |  |  ------------------
  |  |  |  Branch (243:52): [Folded, False: 0]
  |  |  ------------------
  ------------------
  176|  4.33k|                        c,
  177|  4.33k|                        timeout.tmout_list);
  178|       |
  179|  4.33k|  c->timeout.in_cstm_tmout_list = false;
  180|  4.33k|}

_Z28mhd_daemon_get_master_daemonP10MHD_Daemon:
   63|  5.93k|{
   64|  5.93k|#ifdef MHD_SUPPORT_THREADS
   65|  5.93k|  if (mhd_D_HAS_MASTER (d))
  ------------------
  |  | 1545|  5.93k|#define mhd_D_HAS_MASTER(d) mhd_D_TYPE_HAS_MASTER_DAEMON ((d)->threading.d_type)
  |  |  ------------------
  |  |  |  | 1010|  5.93k|          (mhd_DAEMON_TYPE_WORKER == (t))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1010:11): [True: 0, False: 5.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   66|      0|    return d->threading.hier.master;
   67|  5.93k|#endif /* MHD_SUPPORT_THREADS */
   68|  5.93k|  return d;
   69|  5.93k|}
_Z23mhd_daemon_reclaim_lbufP10MHD_Daemonm:
  144|  2.64k|{
  145|  2.64k|  struct MHD_Daemon *const masterd = mhd_daemon_get_master_daemon (d);
  146|  2.64k|  mhd_assert (0 != reclaimed_size);
  ------------------
  |  |   66|  2.64k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  147|  2.64k|  mhd_mutex_lock_chk (&(masterd->req_cfg.large_buf.lock));
  ------------------
  |  |  293|  2.64k|#  define mhd_mutex_lock_chk(pmutex) do {        \
  |  |  294|  2.64k|            if (! mhd_mutex_lock((pmutex)))       \
  |  |  ------------------
  |  |  |  |  252|  2.64k|#    define mhd_mutex_lock(pmutex) (0 == pthread_mutex_lock((pmutex)))
  |  |  ------------------
  |  |  |  Branch (294:17): [True: 0, False: 2.64k]
  |  |  ------------------
  |  |  295|  2.64k|              MHD_PANIC ("Failed to lock mutex."); \
  |  |  ------------------
  |  |  |  |   93|      0|              mhd_panic (__FILE__, MHD_FUNC_, __LINE__, msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|      0|#  define MHD_FUNC_       __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  296|  2.64k|          } while (0)
  |  |  ------------------
  |  |  |  Branch (296:20): [Folded, False: 2.64k]
  |  |  ------------------
  ------------------
  148|  2.64k|  masterd->req_cfg.large_buf.space_left += reclaimed_size;
  149|  2.64k|  mhd_mutex_unlock_chk (&(masterd->req_cfg.large_buf.lock));
  ------------------
  |  |  303|  2.64k|#  define mhd_mutex_unlock_chk(pmutex) do {        \
  |  |  304|  2.64k|            if (! mhd_mutex_unlock((pmutex)))       \
  |  |  ------------------
  |  |  |  |  267|  2.64k|#    define mhd_mutex_unlock(pmutex) (0 == pthread_mutex_unlock((pmutex)))
  |  |  ------------------
  |  |  |  Branch (304:17): [True: 0, False: 2.64k]
  |  |  ------------------
  |  |  305|  2.64k|              MHD_PANIC ("Failed to unlock mutex."); \
  |  |  ------------------
  |  |  |  |   93|      0|              mhd_panic (__FILE__, MHD_FUNC_, __LINE__, msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|      0|#  define MHD_FUNC_       __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  306|  2.64k|          } while (0)
  |  |  ------------------
  |  |  |  Branch (306:20): [Folded, False: 2.64k]
  |  |  ------------------
  ------------------
  150|  2.64k|}
_Z28mhd_daemon_extend_lbuf_up_toP10MHD_DaemonmP10mhd_Buffer:
  212|  3.28k|{
  213|  3.28k|  void *new_alloc;
  214|  3.28k|  size_t grow_size;
  215|  3.28k|  mhd_assert (NULL != buf->data || 0 == buf->size);
  ------------------
  |  |   66|  3.28k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  216|  3.28k|  mhd_assert (0 != buf->size || NULL == buf->data);
  ------------------
  |  |   66|  3.28k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  217|  3.28k|  mhd_assert (0 != desired_grow_size);
  ------------------
  |  |   66|  3.28k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  218|       |
  219|  3.28k|  grow_size = mhd_daemon_claim_lbuf_up_to (d, desired_grow_size);
  220|       |
  221|  3.28k|  new_alloc = NULL;
  222|  3.28k|  if (NULL == buf->data)
  ------------------
  |  Branch (222:7): [True: 2.64k, False: 644]
  ------------------
  223|  2.64k|  {
  224|  2.64k|    while ((0 != grow_size)
  ------------------
  |  Branch (224:12): [True: 2.64k, False: 0]
  ------------------
  225|  2.64k|           && (NULL == (new_alloc = malloc (grow_size))))
  ------------------
  |  Branch (225:15): [True: 0, False: 2.64k]
  ------------------
  226|      0|    {
  227|      0|      size_t reduce = grow_size / 2;
  228|      0|      if (sizeof(void *) >= (grow_size - reduce))
  ------------------
  |  Branch (228:11): [True: 0, False: 0]
  ------------------
  229|      0|        reduce = grow_size;
  230|      0|      mhd_daemon_reclaim_lbuf (d,
  231|      0|                               reduce);
  232|      0|      grow_size -= reduce;
  233|      0|    }
  234|  2.64k|  }
  235|    644|  else
  236|    644|  {
  237|    644|    while ((0 != grow_size)
  ------------------
  |  Branch (237:12): [True: 370, False: 274]
  ------------------
  238|    370|           && (NULL == (new_alloc = realloc (buf->data,
  ------------------
  |  Branch (238:15): [True: 0, False: 370]
  ------------------
  239|    370|                                             buf->size + grow_size))))
  240|      0|    {
  241|      0|      size_t reduce = grow_size / 2;
  242|      0|      if (sizeof(void *) >= (grow_size - reduce))
  ------------------
  |  Branch (242:11): [True: 0, False: 0]
  ------------------
  243|      0|        reduce = grow_size;
  244|      0|      mhd_daemon_reclaim_lbuf (d,
  245|      0|                               reduce);
  246|      0|      grow_size -= reduce;
  247|      0|    }
  248|    644|  }
  249|       |
  250|  3.28k|  if (NULL != new_alloc)
  ------------------
  |  Branch (250:7): [True: 3.01k, False: 274]
  ------------------
  251|  3.01k|  {
  252|  3.01k|    mhd_assert (0 != grow_size);
  ------------------
  |  |   66|  3.01k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  253|  3.01k|    buf->data = (char *)new_alloc;
  254|  3.01k|    buf->size += grow_size;
  255|  3.01k|  }
  256|       |
  257|  3.28k|  return grow_size;
  258|  3.28k|}
_Z20mhd_daemon_free_lbufP10MHD_DaemonP10mhd_Buffer:
  265|  2.64k|{
  266|  2.64k|  if (0 == buf->size)
  ------------------
  |  Branch (266:7): [True: 0, False: 2.64k]
  ------------------
  267|      0|  {
  268|      0|    mhd_assert (NULL == buf->data);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  269|      0|    return;
  270|      0|  }
  271|  2.64k|  free (buf->data);
  272|       |  buf->data = NULL;
  273|  2.64k|  mhd_daemon_reclaim_lbuf (d, buf->size);
  274|  2.64k|  buf->size = 0;
  275|  2.64k|}
_Z29mhd_daemon_get_milsec_counterP10MHD_Daemon:
  280|    945|{
  281|    945|  if (!d->events.time.is_set)
  ------------------
  |  Branch (281:7): [True: 866, False: 79]
  ------------------
  282|    866|  {
  283|    866|    d->events.time.cur = mhd_monotonic_msec_counter ();
  284|    866|    d->events.time.is_set = true;
  285|    866|  }
  286|       |
  287|    945|  return d->events.time.cur;
  288|    945|}
daemon_funcs.c:_ZL27mhd_daemon_claim_lbuf_up_toP10MHD_Daemonm:
  118|  3.28k|{
  119|  3.28k|  size_t ret;
  120|  3.28k|  struct MHD_Daemon *const masterd = mhd_daemon_get_master_daemon (d);
  121|  3.28k|  mhd_assert (0 != requested_size);
  ------------------
  |  |   66|  3.28k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  122|  3.28k|  if (0 == masterd->req_cfg.large_buf.space_left)
  ------------------
  |  Branch (122:7): [True: 274, False: 3.01k]
  ------------------
  123|    274|    return false; /* Shortcut for typical use without large buffer */
  124|       |
  125|  3.01k|  mhd_mutex_lock_chk (&(masterd->req_cfg.large_buf.lock));
  ------------------
  |  |  293|  3.01k|#  define mhd_mutex_lock_chk(pmutex) do {        \
  |  |  294|  3.01k|            if (! mhd_mutex_lock((pmutex)))       \
  |  |  ------------------
  |  |  |  |  252|  3.01k|#    define mhd_mutex_lock(pmutex) (0 == pthread_mutex_lock((pmutex)))
  |  |  ------------------
  |  |  |  Branch (294:17): [True: 0, False: 3.01k]
  |  |  ------------------
  |  |  295|  3.01k|              MHD_PANIC ("Failed to lock mutex."); \
  |  |  ------------------
  |  |  |  |   93|      0|              mhd_panic (__FILE__, MHD_FUNC_, __LINE__, msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|      0|#  define MHD_FUNC_       __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  296|  3.01k|          } while (0)
  |  |  ------------------
  |  |  |  Branch (296:20): [Folded, False: 3.01k]
  |  |  ------------------
  ------------------
  126|  3.01k|  if (masterd->req_cfg.large_buf.space_left >= requested_size)
  ------------------
  |  Branch (126:7): [True: 2.82k, False: 195]
  ------------------
  127|  2.82k|  {
  128|  2.82k|    ret = requested_size;
  129|  2.82k|    masterd->req_cfg.large_buf.space_left -= requested_size;
  130|  2.82k|  }
  131|    195|  else
  132|    195|  {
  133|    195|    ret = masterd->req_cfg.large_buf.space_left;
  134|    195|    masterd->req_cfg.large_buf.space_left = 0;
  135|    195|  }
  136|  3.01k|  mhd_mutex_unlock_chk (&(masterd->req_cfg.large_buf.lock));
  ------------------
  |  |  303|  3.01k|#  define mhd_mutex_unlock_chk(pmutex) do {        \
  |  |  304|  3.01k|            if (! mhd_mutex_unlock((pmutex)))       \
  |  |  ------------------
  |  |  |  |  267|  3.01k|#    define mhd_mutex_unlock(pmutex) (0 == pthread_mutex_unlock((pmutex)))
  |  |  ------------------
  |  |  |  Branch (304:17): [True: 0, False: 3.01k]
  |  |  ------------------
  |  |  305|  3.01k|              MHD_PANIC ("Failed to unlock mutex."); \
  |  |  ------------------
  |  |  |  |   93|      0|              mhd_panic (__FILE__, MHD_FUNC_, __LINE__, msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|      0|#  define MHD_FUNC_       __func__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  306|  3.01k|          } while (0)
  |  |  ------------------
  |  |  |  Branch (306:20): [Folded, False: 3.01k]
  |  |  ------------------
  ------------------
  137|  3.01k|  return ret;
  138|  3.28k|}

_Z10mhd_loggerP10MHD_Daemon14MHD_StatusCodePKcz:
   59|  6.88k|{
   60|  6.88k|  if (NULL != daemon->log_params.v_log_cb)
  ------------------
  |  Branch (60:7): [True: 0, False: 6.88k]
  ------------------
   61|      0|  {
   62|      0|    va_list vargs;
   63|      0|    va_start (vargs, fm);
   64|      0|    daemon->log_params.v_log_cb (daemon->log_params.v_log_cb_cls,
   65|      0|                                 sc, fm, vargs);
   66|       |    va_end (vargs);
   67|      0|  }
   68|  6.88k|}

_Z21mhd_parse_http_methodmPKc:
  314|  1.67k|{
  315|  1.67k|  mhd_assert ('\0' == mtd[len]);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  316|       |  /* The required terminating zero makes four-byte loads safe at length 3 */
  317|  1.67k|  if (mhd_COND_ALMOST_ALWAYS (3u <= len))
  ------------------
  |  |  183|  1.67k|#define mhd_COND_ALMOST_ALWAYS(cond)    mhd_COND_PRED_TRUE_P ((cond), 0.99)
  |  |  ------------------
  |  |  |  |  142|  1.67k|          __builtin_expect_with_probability (! ! (cond), ! 0, (prob))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:11): [True: 631, False: 1.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|    631|  {
  319|       |    /* Rows 0..4 cover lengths 3..7.  Longer names use row 5, whose stored
  320|       |       codes are zero, so they always yield OTHER. */
  321|    631|    const size_t row = ((7u < len) ? 8u : len) - 3u;
  ------------------
  |  Branch (321:25): [True: 0, False: 631]
  ------------------
  322|    631|    const uint_least32_t first_bytes = mhd_H_M_LOAD32 (mtd);
  ------------------
  |  |  145|    631|#  define mhd_H_M_LOAD32(p) mhd_GET_32BIT_LE_UNALIGN (p)
  ------------------
  323|    631|    const uint_least32_t last_bytes = mhd_H_M_LOAD32 (mtd + len - 3u);
  ------------------
  |  |  145|    631|#  define mhd_H_M_LOAD32(p) mhd_GET_32BIT_LE_UNALIGN (p)
  ------------------
  324|       |    /* The first and the last bytes can overlap.  At lengths 3..7 they cover
  325|       |       every letter, so the key includes the entire name. */
  326|    631|    const uint_least64_t key =
  327|    631|      ((uint_least64_t)first_bytes) | (((uint_least64_t)last_bytes) << 32u);
  328|       |    /* Subtracting an equality result (0 or 1) from unsigned zero gives an
  329|       |       all-zero or all-ones mask.  The candidate keys differ, so at most one
  330|       |       of mask0 and mask1 can be non-zero. */
  331|    631|    const unsigned int mask0 =
  332|    631|      0u - (unsigned int)(mhd_h_m_tbl_64[row] == key);
  333|    631|    const unsigned int mask1 =
  334|    631|      0u - (unsigned int)(mhd_h_m_tbl_64[5u + row] == key);
  335|       |
  336|       |    /* The stored codes are code ^ OTHER.  Each mask retains the stored code
  337|       |       of its matching candidate and clears it otherwise.  With no match the
  338|       |       result is OTHER; one match gives OTHER ^ (code ^ OTHER), restoring the
  339|       |       code.  An unused candidate's stored code is zero, so even a matching
  340|       |       key leaves OTHER. */
  341|    631|    return (enum mhd_HTTP_Method)(mhd_HTTP_METHOD_OTHER
  342|    631|                                  ^ (mhd_H_M_CODE64 (2u * row) & mask0)
  ------------------
  |  |  303|    631|            ((uint8_t) ((8u == sizeof(mhd_h_m_tbl_64[0])) ?              \
  |  |  ------------------
  |  |  |  Branch (303:25): [True: 631, Folded]
  |  |  ------------------
  |  |  304|    631|                        ((const uint8_t *) (mhd_h_m_tbl_64 + 7u))[(i)] : \
  |  |  305|    631|                        mhd_H_M_CODE64_BY_VAL (i)))
  |  |  ------------------
  |  |  |  |  296|      0|          ((uint8_t) (mhd_h_m_tbl_64[7u + (i) / 8u] >> (8u * ((i) % 8u))))
  |  |  ------------------
  ------------------
  343|    631|                                  ^ (mhd_H_M_CODE64 (2u * row + 1u) & mask1));
  ------------------
  |  |  303|    631|            ((uint8_t) ((8u == sizeof(mhd_h_m_tbl_64[0])) ?              \
  |  |  ------------------
  |  |  |  Branch (303:25): [True: 631, Folded]
  |  |  ------------------
  |  |  304|    631|                        ((const uint8_t *) (mhd_h_m_tbl_64 + 7u))[(i)] : \
  |  |  305|    631|                        mhd_H_M_CODE64_BY_VAL (i)))
  |  |  ------------------
  |  |  |  |  296|      0|          ((uint8_t) (mhd_h_m_tbl_64[7u + (i) / 8u] >> (8u * ((i) % 8u))))
  |  |  ------------------
  ------------------
  344|    631|  }
  345|  1.04k|  return mhd_PARSE_HTTP_METHOD_OUTSIDE_3_7 (len, mtd);
  ------------------
  |  |  183|  1.04k|  ((mhd_COND_VERY_RARELY ((1u == (len)) && ('*' == (mtd)[0]))) ? \
  |  |  ------------------
  |  |  |  |  200|  1.04k|#define mhd_COND_VERY_RARELY(cond)      mhd_COND_PRED_FALSE_P ((cond), 0.95)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  2.09k|          __builtin_expect_with_probability (! ! (cond), 0, (prob))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (144:51): [True: 1.04k, False: 0]
  |  |  |  |  |  |  |  Branch (144:51): [True: 1.04k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (183:4): [True: 1.04k, False: 0]
  |  |  ------------------
  |  |  184|  1.04k|      mhd_HTTP_METHOD_ASTERISK : mhd_HTTP_METHOD_OTHER)
  ------------------
  346|  1.67k|}

_Z15mhd_pool_createm18mhd_MemPoolZeroing:
  317|  2.73k|{
  318|  2.73k|  struct mhd_MemoryPool *pool;
  319|  2.73k|  size_t alloc_size;
  320|       |
  321|  2.73k|  mhd_assert (max > 0);
  ------------------
  |  |   66|  2.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  322|  2.73k|  mhd_assert (mhd_RED_ZONE_SIZE < (max + mhd_RED_ZONE_SIZE));
  ------------------
  |  |   66|  2.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  323|  2.73k|  max += mhd_RED_ZONE_SIZE;
  ------------------
  |  |  139|  2.73k|#  define mhd_RED_ZONE_SIZE (0)
  ------------------
  324|  2.73k|  alloc_size = 0;
  325|  2.73k|  pool = (struct mhd_MemoryPool *)malloc (sizeof (struct mhd_MemoryPool));
  326|  2.73k|  if (NULL == pool)
  ------------------
  |  Branch (326:7): [True: 0, False: 2.73k]
  ------------------
  327|      0|    return NULL;
  328|  2.73k|  pool->zeroing = zeroing;
  329|  2.73k|#ifdef mhd_USE_LARGE_ALLOCS
  330|  2.73k|  pool->is_large_alloc = false;
  331|  2.73k|  if ((max <= 32 * 1024)
  ------------------
  |  Branch (331:7): [True: 2.73k, False: 0]
  ------------------
  332|      0|      || (max < MHD_sys_page_size_ * 4 / 3))
  ------------------
  |  Branch (332:10): [True: 0, False: 0]
  ------------------
  333|  2.73k|  {
  334|  2.73k|    pool->memory = (uint8_t *)mhd_MAP_FAILED;
  ------------------
  |  |  123|  2.73k|#    define mhd_MAP_FAILED MAP_FAILED
  ------------------
  335|  2.73k|  }
  336|      0|  else
  337|      0|  {
  338|       |    /* Round up allocation to page granularity. */
  339|      0|    alloc_size = max + MHD_sys_page_size_ - 1;
  340|      0|    alloc_size -= alloc_size % MHD_sys_page_size_;
  341|      0|#  if defined(mhd_MAP_ANONYMOUS)
  342|      0|    pool->memory = (uint8_t *)mmap (NULL,
  343|      0|                                    alloc_size,
  344|      0|                                    PROT_READ | PROT_WRITE,
  345|      0|                                    MAP_PRIVATE | mhd_MAP_ANONYMOUS,
  ------------------
  |  |  108|      0|#  define mhd_MAP_ANONYMOUS MAP_ANONYMOUS
  ------------------
  346|      0|                                    -1,
  347|      0|                                    0);
  348|       |#  else  /* ! mhd_MAP_ANONYMOUS */
  349|       |    pool->memory = (uint8_t *)VirtualAlloc (NULL,
  350|       |                                            alloc_size,
  351|       |                                            MEM_COMMIT | MEM_RESERVE,
  352|       |                                            PAGE_READWRITE);
  353|       |#  endif /* ! mhd_MAP_ANONYMOUS */
  354|      0|  }
  355|  2.73k|  if (mhd_MAP_FAILED != pool->memory)
  ------------------
  |  |  123|  2.73k|#    define mhd_MAP_FAILED MAP_FAILED
  ------------------
  |  Branch (355:7): [True: 0, False: 2.73k]
  ------------------
  356|      0|    pool->is_large_alloc = true;
  357|  2.73k|  else
  358|  2.73k|#endif /* mhd_USE_LARGE_ALLOCS */
  359|  2.73k|  if (!0)
  ------------------
  |  Branch (359:7): [True: 2.73k, Folded]
  ------------------
  360|  2.73k|  {
  361|  2.73k|    alloc_size = mhd_ROUND_TO_ALIGN (max);
  ------------------
  |  |  133|  2.73k|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  ------------------
  |  |  |  |   62|  2.73k|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  ------------------
  |  |  134|  2.73k|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  ------------------
  |  |  |  |   62|  2.73k|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  ------------------
  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  ------------------
  |  |  |  |   62|  2.73k|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  ------------------
  ------------------
  362|  2.73k|    if (MHD_MEMPOOL_ZEROING_NEVER == zeroing)
  ------------------
  |  Branch (362:9): [True: 0, False: 2.73k]
  ------------------
  363|      0|      pool->memory = (uint8_t *)malloc (alloc_size);
  364|  2.73k|    else
  365|  2.73k|      pool->memory = (uint8_t *)mhd_calloc (1, alloc_size);
  ------------------
  |  |   64|  2.73k|#  define mhd_calloc calloc
  ------------------
  366|  2.73k|    if (((uint8_t *)NULL) == pool->memory)
  ------------------
  |  Branch (366:9): [True: 0, False: 2.73k]
  ------------------
  367|      0|    {
  368|      0|      free (pool);
  369|      0|      return NULL;
  370|      0|    }
  371|  2.73k|  }
  372|  2.73k|  mhd_assert (0 == (((uintptr_t)pool->memory) % mhd_MEMPOOL_ALIGN_SIZE));
  ------------------
  |  |   66|  2.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  373|  2.73k|  pool->pos = 0;
  374|  2.73k|  pool->end = alloc_size;
  375|  2.73k|  pool->size = alloc_size;
  376|  2.73k|  mhd_assert (0 < alloc_size);
  ------------------
  |  |   66|  2.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  377|  2.73k|  mhd_POISON_MEMORY (pool->memory, pool->size);
  ------------------
  |  |  141|  2.73k|#  define mhd_POISON_MEMORY(pointer, size) (void) 0
  ------------------
  378|  2.73k|  return pool;
  379|  2.73k|}
_Z16mhd_pool_destroyP14mhd_MemoryPool:
  384|  2.73k|{
  385|  2.73k|  if (NULL == pool)
  ------------------
  |  Branch (385:7): [True: 0, False: 2.73k]
  ------------------
  386|      0|    return;
  387|       |
  388|  2.73k|  mhd_assert (pool->end >= pool->pos);
  ------------------
  |  |   66|  2.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  389|  2.73k|  mhd_assert (pool->size >= pool->end - pool->pos);
  ------------------
  |  |   66|  2.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  390|  2.73k|  mhd_assert (pool->pos == mhd_ROUND_TO_ALIGN (pool->pos));
  ------------------
  |  |   66|  2.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  391|  2.73k|  mhd_UNPOISON_MEMORY (pool->memory, pool->size);
  ------------------
  |  |  142|  2.73k|#  define mhd_UNPOISON_MEMORY(pointer, size) (void) 0
  ------------------
  392|  2.73k|#ifdef mhd_USE_LARGE_ALLOCS
  393|  2.73k|  if (pool->is_large_alloc)
  ------------------
  |  Branch (393:7): [True: 0, False: 2.73k]
  ------------------
  394|      0|  {
  395|      0|#  if defined(mhd_MAP_ANONYMOUS)
  396|      0|    munmap (pool->memory,
  397|      0|            pool->size);
  398|       |#  else
  399|       |    VirtualFree (pool->memory,
  400|       |                 0,
  401|       |                 MEM_RELEASE);
  402|       |#  endif
  403|      0|  }
  404|  2.73k|  else
  405|  2.73k|#endif /* mhd_USE_LARGE_ALLOCS*/
  406|  2.73k|  if (!0)
  ------------------
  |  Branch (406:7): [True: 2.73k, Folded]
  ------------------
  407|  2.73k|    free (pool->memory);
  408|       |
  409|  2.73k|  free (pool);
  410|  2.73k|}
_Z17mhd_pool_get_freeP14mhd_MemoryPool:
  422|    283|{
  423|    283|  mhd_assert (pool->end >= pool->pos);
  ------------------
  |  |   66|    283|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  424|    283|  mhd_assert (pool->size >= pool->end - pool->pos);
  ------------------
  |  |   66|    283|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  425|    283|  mhd_assert (pool->pos == mhd_ROUND_TO_ALIGN (pool->pos));
  ------------------
  |  |   66|    283|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  426|       |#ifdef MHD_ASAN_POISON_ACTIVE
  427|       |  if ((pool->end - pool->pos) <= mhd_RED_ZONE_SIZE)
  428|       |    return 0;
  429|       |#endif /* MHD_ASAN_POISON_ACTIVE */
  430|    283|  return (pool->end - pool->pos) - mhd_RED_ZONE_SIZE;
  ------------------
  |  |  139|    283|#  define mhd_RED_ZONE_SIZE (0)
  ------------------
  431|    283|}
_Z17mhd_pool_allocateP14mhd_MemoryPoolmb:
  440|    133|{
  441|    133|  void *ret;
  442|    133|  size_t asize;
  443|       |
  444|    133|  mhd_assert (pool->end >= pool->pos);
  ------------------
  |  |   66|    133|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  445|    133|  mhd_assert (pool->size >= pool->end - pool->pos);
  ------------------
  |  |   66|    133|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  446|    133|  mhd_assert (pool->pos == mhd_ROUND_TO_ALIGN (pool->pos));
  ------------------
  |  |   66|    133|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  447|    133|  asize = mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE (size);
  ------------------
  |  |  140|    133|#  define mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE(n) mhd_ROUND_TO_ALIGN (n)
  |  |  ------------------
  |  |  |  |  133|    133|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    133|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |  134|    133|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    133|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    133|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  448|    133|  if ((0 == asize) && (0 != size))
  ------------------
  |  Branch (448:7): [True: 0, False: 133]
  |  Branch (448:23): [True: 0, False: 0]
  ------------------
  449|      0|    return NULL; /* size too close to SIZE_MAX */
  450|    133|  if (asize > pool->end - pool->pos)
  ------------------
  |  Branch (450:7): [True: 0, False: 133]
  ------------------
  451|      0|    return NULL;
  452|    133|  if (from_end)
  ------------------
  |  Branch (452:7): [True: 133, False: 0]
  ------------------
  453|    133|  {
  454|    133|    ret = &pool->memory[pool->end - asize];
  455|    133|    pool->end -= asize;
  456|    133|  }
  457|      0|  else
  458|      0|  {
  459|      0|    ret = &pool->memory[pool->pos];
  460|      0|    pool->pos += asize;
  461|      0|  }
  462|    133|  mhd_UNPOISON_MEMORY (ret, size);
  ------------------
  |  |  142|    133|#  define mhd_UNPOISON_MEMORY(pointer, size) (void) 0
  ------------------
  463|    133|  return ret;
  464|    133|}
_Z29mhd_pool_is_resizable_inplaceP14mhd_MemoryPoolPvm:
  472|    785|{
  473|    785|  mhd_assert (pool->end >= pool->pos);
  ------------------
  |  |   66|    785|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  474|    785|  mhd_assert (pool->size >= pool->end - pool->pos);
  ------------------
  |  |   66|    785|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  475|    785|  mhd_assert (block != NULL || block_size == 0);
  ------------------
  |  |   66|    785|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  476|    785|  mhd_assert (pool->size >= block_size);
  ------------------
  |  |   66|    785|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  477|    785|  if (NULL != block)
  ------------------
  |  Branch (477:7): [True: 421, False: 364]
  ------------------
  478|    421|  {
  479|    421|    const size_t block_offset = mp_ptr_diff_ (block, pool->memory);
  ------------------
  |  |  153|    421|          ((size_t) (((const uint8_t*) (p1)) - ((const uint8_t*) (p2))))
  ------------------
  480|    421|    mhd_assert (mp_ptr_le_ (pool->memory, block));
  ------------------
  |  |   66|    421|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  481|    421|    mhd_assert (pool->size >= block_offset);
  ------------------
  |  |   66|    421|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  482|    421|    mhd_assert (pool->size >= block_offset + block_size);
  ------------------
  |  |   66|    421|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  483|    421|    return (pool->pos ==
  484|    421|            mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE (block_offset + block_size));
  ------------------
  |  |  140|    421|#  define mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE(n) mhd_ROUND_TO_ALIGN (n)
  |  |  ------------------
  |  |  |  |  133|    421|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    421|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |  134|    421|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    421|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    421|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  485|    421|  }
  486|    364|  return false; /* Unallocated blocks cannot be resized in-place */
  487|    785|}
_Z18mhd_pool_try_allocP14mhd_MemoryPoolmPm:
  497|  34.4k|{
  498|  34.4k|  void *ret;
  499|  34.4k|  size_t asize;
  500|       |
  501|  34.4k|  mhd_assert (pool->end >= pool->pos);
  ------------------
  |  |   66|  34.4k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  502|  34.4k|  mhd_assert (pool->size >= pool->end - pool->pos);
  ------------------
  |  |   66|  34.4k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  503|  34.4k|  mhd_assert (pool->pos == mhd_ROUND_TO_ALIGN (pool->pos));
  ------------------
  |  |   66|  34.4k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  504|  34.4k|  asize = mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE (size);
  ------------------
  |  |  140|  34.4k|#  define mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE(n) mhd_ROUND_TO_ALIGN (n)
  |  |  ------------------
  |  |  |  |  133|  34.4k|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  34.4k|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |  134|  34.4k|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  34.4k|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  34.4k|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  505|  34.4k|  if ((0 == asize) && (0 != size))
  ------------------
  |  Branch (505:7): [True: 0, False: 34.4k]
  |  Branch (505:23): [True: 0, False: 0]
  ------------------
  506|      0|  { /* size is too close to SIZE_MAX, very unlikely */
  507|      0|    *required_bytes = SIZE_MAX;
  508|      0|    return NULL;
  509|      0|  }
  510|  34.4k|  if (asize > pool->end - pool->pos)
  ------------------
  |  Branch (510:7): [True: 1.75k, False: 32.6k]
  ------------------
  511|  1.75k|  {
  512|  1.75k|    mhd_assert ((pool->end - pool->pos) == \
  ------------------
  |  |   66|  1.75k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  513|  1.75k|                mhd_ROUND_TO_ALIGN (pool->end - pool->pos));
  514|  1.75k|    if (asize <= pool->end)
  ------------------
  |  Branch (514:9): [True: 143, False: 1.60k]
  ------------------
  515|    143|      *required_bytes = asize - (pool->end - pool->pos);
  516|  1.60k|    else
  517|  1.60k|      *required_bytes = SIZE_MAX;
  518|  1.75k|    return NULL;
  519|  1.75k|  }
  520|  32.6k|  *required_bytes = 0;
  521|  32.6k|  ret = &pool->memory[pool->end - asize];
  522|  32.6k|  pool->end -= asize;
  523|  32.6k|  mhd_UNPOISON_MEMORY (ret, size);
  ------------------
  |  |  142|  32.6k|#  define mhd_UNPOISON_MEMORY(pointer, size) (void) 0
  ------------------
  524|  32.6k|  return ret;
  525|  34.4k|}
_Z19mhd_pool_reallocateP14mhd_MemoryPoolPvmm:
  537|  1.73k|{
  538|  1.73k|  size_t asize;
  539|  1.73k|  uint8_t *new_blc;
  540|       |
  541|  1.73k|  mhd_assert (pool->end >= pool->pos);
  ------------------
  |  |   66|  1.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  542|  1.73k|  mhd_assert (pool->size >= pool->end - pool->pos);
  ------------------
  |  |   66|  1.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  543|  1.73k|  mhd_assert (old != NULL || old_size == 0);
  ------------------
  |  |   66|  1.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  544|  1.73k|  mhd_assert (pool->size >= old_size);
  ------------------
  |  |   66|  1.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  545|  1.73k|  mhd_assert (pool->pos == mhd_ROUND_TO_ALIGN (pool->pos));
  ------------------
  |  |   66|  1.73k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  546|       |#if defined(MHD_ASAN_POISON_ACTIVE) && defined(HAVE___ASAN_REGION_IS_POISONED)
  547|       |  mhd_assert (NULL == __asan_region_is_poisoned (old, old_size));
  548|       |#endif /* MHD_ASAN_POISON_ACTIVE && HAVE___ASAN_REGION_IS_POISONED */
  549|       |
  550|  1.73k|  if (NULL != old)
  ------------------
  |  Branch (550:7): [True: 1.49k, False: 238]
  ------------------
  551|  1.49k|  {   /* Have previously allocated data */
  552|  1.49k|    const size_t old_offset = mp_ptr_diff_ (old, pool->memory);
  ------------------
  |  |  153|  1.49k|          ((size_t) (((const uint8_t*) (p1)) - ((const uint8_t*) (p2))))
  ------------------
  553|  1.49k|    const bool shrinking = (old_size > new_size);
  554|       |
  555|  1.49k|    mhd_assert (mp_ptr_le_ (pool->memory, old));
  ------------------
  |  |   66|  1.49k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  556|       |    /* (pool->memory + pool->size >= (uint8_t*) old + old_size) */
  557|  1.49k|    mhd_assert ((pool->size - mhd_RED_ZONE_SIZE) >= (old_offset + old_size));
  ------------------
  |  |   66|  1.49k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  558|       |    /* Blocks "from the end" must not be reallocated */
  559|       |    /* (old_size == 0 || pool->memory + pool->pos > (uint8_t*) old) */
  560|  1.49k|    mhd_assert ((old_size == 0) \
  ------------------
  |  |   66|  1.49k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  561|  1.49k|                || (pool->pos > old_offset));
  562|  1.49k|    mhd_assert ((old_size == 0) \
  ------------------
  |  |   66|  1.49k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  563|  1.49k|                || ((pool->end - mhd_RED_ZONE_SIZE) >=
  564|  1.49k|                    (old_offset + old_size)));
  565|       |    /* Try resizing in-place */
  566|  1.49k|    if (shrinking)
  ------------------
  |  Branch (566:9): [True: 1.02k, False: 464]
  ------------------
  567|  1.02k|    {     /* Shrinking in-place, zero-out freed part */
  568|  1.02k|      if (MHD_MEMPOOL_ZEROING_ON_RESET < pool->zeroing)
  ------------------
  |  Branch (568:11): [True: 0, False: 1.02k]
  ------------------
  569|      0|        memset ((uint8_t *)old + new_size, 0, old_size - new_size);
  570|  1.02k|      mhd_POISON_MEMORY ((uint8_t *)old + new_size, old_size - new_size);
  ------------------
  |  |  141|  1.02k|#  define mhd_POISON_MEMORY(pointer, size) (void) 0
  ------------------
  571|  1.02k|    }
  572|  1.49k|    if (pool->pos ==
  ------------------
  |  Branch (572:9): [True: 253, False: 1.24k]
  ------------------
  573|  1.49k|        mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE (old_offset + old_size))
  ------------------
  |  |  140|  1.49k|#  define mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE(n) mhd_ROUND_TO_ALIGN (n)
  |  |  ------------------
  |  |  |  |  133|  1.49k|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.49k|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |  134|  1.49k|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.49k|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.49k|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|    253|    {     /* "old" block is the last allocated block */
  575|    253|      const size_t new_apos =
  576|    253|        mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE (old_offset + new_size);
  ------------------
  |  |  140|    253|#  define mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE(n) mhd_ROUND_TO_ALIGN (n)
  |  |  ------------------
  |  |  |  |  133|    253|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    253|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |  134|    253|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    253|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    253|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  577|    253|      if (!shrinking)
  ------------------
  |  Branch (577:11): [True: 120, False: 133]
  ------------------
  578|    120|      {                               /* Grow in-place, check for enough space. */
  579|    120|        if ((new_apos > pool->end)
  ------------------
  |  Branch (579:13): [True: 0, False: 120]
  ------------------
  580|    120|            || (new_apos < pool->pos)) /* Value wrap */
  ------------------
  |  Branch (580:16): [True: 0, False: 120]
  ------------------
  581|      0|          return NULL;                /* No space */
  582|    120|      }
  583|       |      /* Resized in-place */
  584|    253|      pool->pos = new_apos;
  585|    253|      mhd_UNPOISON_MEMORY (old, new_size);
  ------------------
  |  |  142|    253|#  define mhd_UNPOISON_MEMORY(pointer, size) (void) 0
  ------------------
  586|    253|      return old;
  587|    253|    }
  588|  1.24k|    if (shrinking)
  ------------------
  |  Branch (588:9): [True: 896, False: 344]
  ------------------
  589|    896|      return old;   /* Resized in-place, freed part remains allocated */
  590|  1.24k|  }
  591|       |  /* Need to allocate new block */
  592|    582|  asize = mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE (new_size);
  ------------------
  |  |  140|    582|#  define mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE(n) mhd_ROUND_TO_ALIGN (n)
  |  |  ------------------
  |  |  |  |  133|    582|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    582|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |  134|    582|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    582|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    582|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  593|    582|  if (((0 == asize)
  ------------------
  |  Branch (593:8): [True: 0, False: 582]
  ------------------
  594|      0|       && (0 != new_size))    /* Value wrap, too large new_size. */
  ------------------
  |  Branch (594:11): [True: 0, False: 0]
  ------------------
  595|    582|      || (asize > pool->end - pool->pos)) /* Not enough space */
  ------------------
  |  Branch (595:10): [True: 70, False: 512]
  ------------------
  596|     70|    return NULL;
  597|       |
  598|    512|  new_blc = pool->memory + pool->pos;
  599|    512|  pool->pos += asize;
  600|       |
  601|    512|  mhd_UNPOISON_MEMORY (new_blc, new_size);
  ------------------
  |  |  142|    512|#  define mhd_UNPOISON_MEMORY(pointer, size) (void) 0
  ------------------
  602|    512|  if (0 != old_size)
  ------------------
  |  Branch (602:7): [True: 274, False: 238]
  ------------------
  603|    274|  {
  604|       |    /* Move data to new block, old block remains allocated */
  605|    274|    memcpy (new_blc, old, old_size);
  606|       |    /* Zero-out old block */
  607|    274|    if (MHD_MEMPOOL_ZEROING_ON_RESET < pool->zeroing)
  ------------------
  |  Branch (607:9): [True: 0, False: 274]
  ------------------
  608|      0|      memset (old, 0, old_size);
  609|    274|    mhd_POISON_MEMORY (old, old_size);
  ------------------
  |  |  141|    274|#  define mhd_POISON_MEMORY(pointer, size) (void) 0
  ------------------
  610|    274|  }
  611|    512|  return new_blc;
  612|    582|}
_Z19mhd_pool_deallocateP14mhd_MemoryPoolPvm:
  620|  3.86k|{
  621|  3.86k|  mhd_assert (pool->end >= pool->pos);
  ------------------
  |  |   66|  3.86k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  622|  3.86k|  mhd_assert (pool->size >= pool->end - pool->pos);
  ------------------
  |  |   66|  3.86k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  623|  3.86k|  mhd_assert (block != NULL || block_size == 0);
  ------------------
  |  |   66|  3.86k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  624|  3.86k|  mhd_assert (pool->size >= block_size);
  ------------------
  |  |   66|  3.86k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  625|  3.86k|  mhd_assert (pool->pos == mhd_ROUND_TO_ALIGN (pool->pos));
  ------------------
  |  |   66|  3.86k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  626|       |
  627|  3.86k|  if (NULL != block)
  ------------------
  |  Branch (627:7): [True: 1.29k, False: 2.56k]
  ------------------
  628|  1.29k|  {   /* Have previously allocated data */
  629|  1.29k|    const size_t block_offset = mp_ptr_diff_ (block, pool->memory);
  ------------------
  |  |  153|  1.29k|          ((size_t) (((const uint8_t*) (p1)) - ((const uint8_t*) (p2))))
  ------------------
  630|  1.29k|    mhd_assert (mp_ptr_le_ (pool->memory, block));
  ------------------
  |  |   66|  1.29k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  631|  1.29k|    mhd_assert (block_offset <= pool->size);
  ------------------
  |  |   66|  1.29k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  632|  1.29k|    mhd_assert ((block_offset != pool->pos) || (block_size == 0));
  ------------------
  |  |   66|  1.29k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  633|       |    /* Zero-out deallocated region */
  634|  1.29k|    if (0 != block_size)
  ------------------
  |  Branch (634:9): [True: 1.29k, False: 2]
  ------------------
  635|  1.29k|    {
  636|  1.29k|      if (MHD_MEMPOOL_ZEROING_ON_RESET < pool->zeroing)
  ------------------
  |  Branch (636:11): [True: 0, False: 1.29k]
  ------------------
  637|      0|        memset (block, 0, block_size);
  638|  1.29k|      mhd_POISON_MEMORY (block, block_size);
  ------------------
  |  |  141|  1.29k|#  define mhd_POISON_MEMORY(pointer, size) (void) 0
  ------------------
  639|  1.29k|    }
  640|      2|#if !defined(MHD_FAVOR_SMALL_CODE) && !defined(MHD_ASAN_POISON_ACTIVE)
  641|      2|    else
  642|      2|      return; /* Zero size, no need to do anything */
  643|  1.29k|#endif /* ! MHD_FAVOR_SMALL_CODE && ! MHD_ASAN_POISON_ACTIVE */
  644|  1.29k|    if (block_offset <= pool->pos)
  ------------------
  |  Branch (644:9): [True: 263, False: 1.03k]
  ------------------
  645|    263|    {
  646|       |      /* "Normal" block, not allocated "from the end". */
  647|    263|      const size_t alg_end =
  648|    263|        mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE (block_offset + block_size);
  ------------------
  |  |  140|    263|#  define mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE(n) mhd_ROUND_TO_ALIGN (n)
  |  |  ------------------
  |  |  |  |  133|    263|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    263|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |  134|    263|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    263|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|    263|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  649|    263|      mhd_assert (alg_end <= pool->pos);
  ------------------
  |  |   66|    263|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  650|    263|      if (alg_end == pool->pos)
  ------------------
  |  Branch (650:11): [True: 236, False: 27]
  ------------------
  651|    236|      {
  652|       |        /* The last allocated block, return deallocated block to the pool */
  653|    236|        size_t alg_start = mhd_ROUND_TO_ALIGN (block_offset);
  ------------------
  |  |  133|    236|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  ------------------
  |  |  |  |   62|    236|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  ------------------
  |  |  134|    236|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  ------------------
  |  |  |  |   62|    236|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  ------------------
  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  ------------------
  |  |  |  |   62|    236|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  ------------------
  ------------------
  654|    236|        mhd_assert (alg_start >= block_offset);
  ------------------
  |  |   66|    236|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  655|       |#if defined(MHD_ASAN_POISON_ACTIVE)
  656|       |        if (alg_start != block_offset)
  657|       |        {
  658|       |          mhd_POISON_MEMORY (pool->memory + block_offset, \
  659|       |                             alg_start - block_offset);
  660|       |        }
  661|       |        else if (0 != alg_start)
  662|       |        {
  663|       |          bool need_red_zone_before;
  664|       |          mhd_assert (mhd_RED_ZONE_SIZE <= alg_start);
  665|       |#  if defined(HAVE___ASAN_REGION_IS_POISONED)
  666|       |          need_red_zone_before =
  667|       |            (NULL == __asan_region_is_poisoned (pool->memory
  668|       |                                                + alg_start
  669|       |                                                - mhd_RED_ZONE_SIZE,
  670|       |                                                mhd_RED_ZONE_SIZE));
  671|       |#  elif defined(HAVE___ASAN_ADDRESS_IS_POISONED)
  672|       |          need_red_zone_before =
  673|       |            (0 == __asan_address_is_poisoned (pool->memory + alg_start - 1));
  674|       |#  else  /* ! HAVE___ASAN_ADDRESS_IS_POISONED */
  675|       |          need_red_zone_before = true; /* Unknown, assume new red zone needed */
  676|       |#  endif /* ! HAVE___ASAN_ADDRESS_IS_POISONED */
  677|       |          if (need_red_zone_before)
  678|       |          {
  679|       |            mhd_POISON_MEMORY (pool->memory + alg_start, mhd_RED_ZONE_SIZE);
  680|       |            alg_start += mhd_RED_ZONE_SIZE;
  681|       |          }
  682|       |        }
  683|       |#endif /* MHD_ASAN_POISON_ACTIVE */
  684|    236|        mhd_assert (alg_start <= pool->pos);
  ------------------
  |  |   66|    236|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  685|    236|        mhd_assert (alg_start == mhd_ROUND_TO_ALIGN (alg_start));
  ------------------
  |  |   66|    236|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  686|    236|        pool->pos = alg_start;
  687|    236|      }
  688|    263|    }
  689|  1.03k|    else
  690|  1.03k|    {
  691|       |      /* Allocated "from the end" block. */
  692|       |      /* The size and the pointers of such block should not be manipulated by
  693|       |         MHD code (block split is disallowed). */
  694|  1.03k|      mhd_assert (block_offset >= pool->end);
  ------------------
  |  |   66|  1.03k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  695|  1.03k|      mhd_assert (mhd_ROUND_TO_ALIGN (block_offset) == block_offset);
  ------------------
  |  |   66|  1.03k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  696|  1.03k|      if (block_offset == pool->end)
  ------------------
  |  Branch (696:11): [True: 78, False: 955]
  ------------------
  697|     78|      {
  698|       |        /* The last allocated block, return deallocated block to the pool */
  699|     78|        const size_t alg_end =
  700|     78|          mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE (block_offset + block_size);
  ------------------
  |  |  140|     78|#  define mhd_ROUND_TO_ALIGN_PLUS_RED_ZONE(n) mhd_ROUND_TO_ALIGN (n)
  |  |  ------------------
  |  |  |  |  133|     78|        (((n) + (mhd_MEMPOOL_ALIGN_SIZE - 1)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|     78|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |  134|     78|         / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|     78|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  |  |                        / (mhd_MEMPOOL_ALIGN_SIZE) * (mhd_MEMPOOL_ALIGN_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|     78|#  define mhd_MEMPOOL_ALIGN_SIZE        __BIGGEST_ALIGNMENT__
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|     78|        pool->end = alg_end;
  702|     78|      }
  703|  1.03k|    }
  704|  1.29k|  }
  705|  3.86k|}

http_method_parse.c:_ZL24mhd_GET_32BIT_LE_UNALIGNPKv:
  312|  1.26k|{
  313|  1.26k|  uint32_t aligned_src;
  314|  1.26k|  memcpy (&aligned_src, addr, sizeof(aligned_src));
  315|  1.26k|  return mhd_GET_32BIT_LE (&aligned_src);
  ------------------
  |  |  294|  1.26k|          (*(const uint32_t*) (addr))
  ------------------
  316|  1.26k|}

_Z26mhd_monotonic_msec_counterv:
  627|    866|{
  628|    866|  enum mhd_mono_clock_source source_to_use;
  629|       |
  630|       |  /* Optimise binary if the source is fixed */
  631|       |#if defined(_WIN32) && _WIN32_WINNT >= 0x0600
  632|       |  if (1)
  633|       |    source_to_use = mhd_MCLOCK_SOUCE_GETTICKCOUNT64;
  634|       |  else
  635|       |#endif /* _WIN32 && _WIN32_WINNT >= 0x0600 */
  636|    866|  source_to_use = mono_clock_source;
  637|       |
  638|    866|  mhd_assert (mono_clock_source == source_to_use);
  ------------------
  |  |   66|    866|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  639|       |
  640|    866|  switch (source_to_use)
  641|    866|  {
  642|    866|  case mhd_MCLOCK_SOUCE_NO_SOURCE:
  ------------------
  |  Branch (642:3): [True: 866, False: 0]
  ------------------
  643|    866|    break; /* Use fallbacks */
  644|      0|#ifdef HAVE_CLOCK_GETTIME
  645|      0|  case mhd_MCLOCK_SOUCE_GETTIME:
  ------------------
  |  Branch (645:3): [True: 0, False: 866]
  ------------------
  646|      0|    mhd_assert (mhd_CLOCK_ID_UNWANTED != mono_clock_id);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  647|      0|    if (1)
  ------------------
  |  Branch (647:9): [True: 0, Folded]
  ------------------
  648|      0|    {
  649|      0|      struct timespec ts;
  650|      0|      if (0 == clock_gettime (mono_clock_id,
  ------------------
  |  Branch (650:11): [True: 0, False: 0]
  ------------------
  651|      0|                              &ts))
  652|      0|        return (uint_fast64_t)
  653|      0|               (((uint_fast64_t)(ts.tv_sec - mono_clock_start)) * 1000
  654|      0|                + (uint_fast64_t)(ts.tv_nsec / 1000000));
  655|      0|    }
  656|      0|    break;
  657|      0|#endif /* HAVE_CLOCK_GETTIME */
  658|       |
  659|       |#if defined(mhd_USE_MACH_TIME)
  660|       |  case mhd_MCLOCK_SOUCE_MACH_TIME:
  661|       |    mhd_assert (0 != mach_time_mls_numer);
  662|       |    mhd_assert (0 != mach_time_mls_denom);
  663|       |    if (1)
  664|       |    {
  665|       |      uint64_t t;
  666|       |#  ifdef HAVE_MACH_CONTINUOUS_APPROXIMATE_TIME
  667|       |      t = mach_continuous_approximate_time () - mach_time_start;
  668|       |#  else  /* HAVE_MACH_APPROXIMATE_TIME */
  669|       |      t = mach_approximate_time () - mach_time_start;
  670|       |#  endif
  671|       |#  ifndef MHD_FAVOR_SMALL_CODE
  672|       |      if (1 == mach_time_mls_numer) /* Shortcut for the most common situation */
  673|       |        return (uint_fast64_t)t / mach_time_mls_denom;
  674|       |#  endif /* MHD_FAVOR_SMALL_CODE */
  675|       |
  676|       |      /* Avoid float point arithmetic as it lower precision on higher values.
  677|       |         Two stages calculations to avoid overflow of integer values and keep
  678|       |         precision high enough. */
  679|       |      return (((uint_fast64_t)t) / mach_time_mls_denom) * mach_time_mls_numer
  680|       |             + ((((uint_fast64_t)t) % mach_time_mls_denom)
  681|       |                * mach_time_mls_numer) / mach_time_mls_denom;
  682|       |    }
  683|       |    break;
  684|       |#endif /* mhd_USE_MACH_TIME */
  685|       |
  686|       |#ifdef HAVE_CLOCK_GET_TIME
  687|       |  case mhd_MCLOCK_SOUCE_GET_TIME:
  688|       |    mhd_assert (mhd_CLOCK_SERV_INVALID != mono_clock_service);
  689|       |    if (1)
  690|       |    {
  691|       |      mach_timespec_t cur_time;
  692|       |
  693|       |      if (KERN_SUCCESS == clock_get_time (mono_clock_service,
  694|       |                                          &cur_time))
  695|       |        return (uint_fast64_t)
  696|       |               (((uint_fast64_t)(cur_time.tv_sec - mono_clock_start)) * 1000
  697|       |                + (uint_fast64_t)(cur_time.tv_nsec / 1000000));
  698|       |    }
  699|       |    break;
  700|       |#endif /* HAVE_CLOCK_GET_TIME */
  701|       |
  702|       |#ifdef HAVE_GETHRTIME
  703|       |  case mhd_MCLOCK_SOUCE_GETHRTIME:
  704|       |    return ((uint_fast64_t)(gethrtime () - hrtime_start)) / 1000000;
  705|       |#endif /* HAVE_GETHRTIME */
  706|       |
  707|       |#ifdef _WIN32
  708|       |#  if _WIN32_WINNT >= 0x0600
  709|       |  case mhd_MCLOCK_SOUCE_GETTICKCOUNT64:
  710|       |    return (uint_fast64_t)(GetTickCount64 () - tick_start);
  711|       |#  else  /* _WIN32_WINNT < 0x0600 */
  712|       |  case mhd_MCLOCK_SOUCE_PERFCOUNTER:
  713|       |    mhd_assert (0 != perf_freq);
  714|       |    if (1)
  715|       |    {
  716|       |      LARGE_INTEGER perf_counter;
  717|       |      uint_fast64_t num_ticks;
  718|       |
  719|       |      (void)QueryPerformanceCounter (&perf_counter);    /* never fail on XP and later */
  720|       |      num_ticks = (uint_fast64_t)(perf_counter.QuadPart - perf_start);
  721|       |      return ((num_ticks / perf_freq) * 1000)
  722|       |             + (((num_ticks % perf_freq) * 1000) / perf_freq);
  723|       |    }
  724|       |    break;
  725|       |#  endif /* _WIN32_WINNT < 0x0600 */
  726|       |#endif /* _WIN32 */
  727|      0|  default:
  ------------------
  |  Branch (727:3): [True: 0, False: 866]
  ------------------
  728|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
  729|      0|    break;
  730|    866|  }
  731|       |
  732|       |  /* Fallbacks, affected by system time change */
  733|    866|#ifdef HAVE_TIMESPEC_GET
  734|    866|  if (1)
  ------------------
  |  Branch (734:7): [True: 866, Folded]
  ------------------
  735|    866|  {
  736|    866|    struct timespec ts;
  737|    866|    if (TIME_UTC == timespec_get (&ts, TIME_UTC))
  ------------------
  |  Branch (737:9): [True: 866, False: 0]
  ------------------
  738|    866|      return (uint_fast64_t)
  739|    866|             (((uint_fast64_t)(ts.tv_sec - gettime_start)) * 1000
  740|    866|              + (uint_fast64_t)(ts.tv_nsec / 1000000));
  741|    866|  }
  742|       |#elif defined(HAVE_GETTIMEOFDAY)
  743|       |  if (1)
  744|       |  {
  745|       |    struct timeval tv;
  746|       |    if (0 == gettimeofday (&tv, NULL))
  747|       |      return (uint_fast64_t)
  748|       |             (((uint_fast64_t)(tv.tv_sec - gettime_start)) * 1000
  749|       |              + (uint_fast64_t)(tv.tv_usec / 1000));
  750|       |  }
  751|       |#endif /* HAVE_GETTIMEOFDAY */
  752|       |
  753|       |  /* The last resort fallback with very low resolution */
  754|      0|#ifdef mhd_HAVE_GETTIME_START_VAR
  755|      0|  if (1)
  ------------------
  |  Branch (755:7): [True: 0, Folded]
  ------------------
  756|      0|  {
  757|      0|    time_t time_now;
  758|      0|    time_now = time (NULL);
  759|      0|    if (((time_t)-1) != time_now)
  ------------------
  |  Branch (759:9): [True: 0, False: 0]
  ------------------
  760|      0|      return ((uint_fast64_t)(time_now - sys_clock_start)) * 1000;
  761|      0|  }
  762|      0|  return 0; /* No time source, should not really happen */
  763|       |#else  /* ! mhd_HAVE_GETTIME_START_VAR */
  764|       |  return ((uint_fast64_t)(time (NULL) - sys_clock_start)) * 1000;
  765|       |#endif
  766|      0|}

_Z25mhd_socket_set_hard_closei:
  149|  4.71k|{
  150|  4.71k|#if defined(HAVE_DCLR_SOL_SOCKET) && defined(HAVE_DCLR_SO_LINGER)
  151|  4.71k|  struct linger par;
  152|       |
  153|  4.71k|  par.l_onoff = 1;
  154|  4.71k|  par.l_linger = 0;
  155|       |
  156|  4.71k|  return 0 == mhd_setsockopt (sckt, SOL_SOCKET, SO_LINGER,
  ------------------
  |  |  183|  4.71k|          setsockopt ((sk),(l),(o_name),(po_value),(o_len))
  ------------------
  157|  4.71k|                              (const void *)&par, sizeof (par));
  158|       |#else  /* ! SOL_SOCKET || ! SO_LINGER */
  159|       |  (void)sckt;
  160|       |  return false;
  161|       |#endif /* ! SOL_SOCKET || ! SO_LINGER */
  162|  4.71k|}

_Z28mhd_str_equal_caseless_bin_nPKcS0_m:
 1084|  25.3k|{
 1085|  25.3k|  size_t i;
 1086|       |
 1087|   327k|  for (i = 0; i < len; ++i)
  ------------------
  |  Branch (1087:15): [True: 304k, False: 22.9k]
  ------------------
 1088|   304k|  {
 1089|   304k|    const char c1 = str1[i];
 1090|   304k|    const char c2 = str2[i];
 1091|   304k|    if (charsequalcaseless (c1, c2))
  ------------------
  |  Branch (1091:9): [True: 302k, False: 2.39k]
  ------------------
 1092|   302k|      continue;
 1093|  2.39k|    else
 1094|  2.39k|      return 0;
 1095|   304k|  }
 1096|  22.9k|  return !0;
 1097|  25.3k|}
_Z19mhd_str_to_uint64_nPKcmPm:
 1565|    275|{
 1566|    275|  uint_fast64_t res;
 1567|    275|  size_t i;
 1568|       |
 1569|    275|  if (!maxlen || !isasciidigit (str[0]))
  ------------------
  |  Branch (1569:7): [True: 0, False: 275]
  |  Branch (1569:18): [True: 0, False: 275]
  ------------------
 1570|      0|    return 0;
 1571|       |
 1572|    275|  res = 0;
 1573|    275|  i = 0;
 1574|    275|  do
 1575|    275|  {
 1576|    275|    const int digit = (unsigned char)str[i] - '0';
 1577|    275|    uint_fast64_t prev_res = res;
 1578|       |
 1579|    275|    res *= 10;
 1580|    275|    if (res / 10 != prev_res)
  ------------------
  |  Branch (1580:9): [True: 0, False: 275]
  ------------------
 1581|      0|      return 0;
 1582|    275|    res += (unsigned int)digit;
 1583|    275|    if (res < (unsigned int)digit)
  ------------------
  |  Branch (1583:9): [True: 0, False: 275]
  ------------------
 1584|      0|      return 0;
 1585|    275|    i++;
 1586|    275|  } while ((i < maxlen)
  ------------------
  |  Branch (1586:12): [True: 0, False: 275]
  ------------------
 1587|      0|           && isasciidigit (str[i]));
  ------------------
  |  Branch (1587:15): [True: 0, False: 0]
  ------------------
 1588|       |
 1589|    275|  *out_val = res;
 1590|    275|  return i;
 1591|    275|}
_Z28mhd_str_pct_decode_lenient_nPKcmPcmPb:
 2125|  6.21k|{
 2126|  6.21k|  size_t r;
 2127|  6.21k|  size_t w;
 2128|  6.21k|  r = 0;
 2129|  6.21k|  w = 0;
 2130|  6.21k|  if (NULL != broken_encoding)
  ------------------
  |  Branch (2130:7): [True: 0, False: 6.21k]
  ------------------
 2131|      0|    *broken_encoding = false;
 2132|  6.21k|#ifndef MHD_FAVOR_SMALL_CODE
 2133|  6.21k|  if (buf_size >= pct_encoded_len)
  ------------------
  |  Branch (2133:7): [True: 6.21k, False: 0]
  ------------------
 2134|  6.21k|  {
 2135|   265k|    while (r < pct_encoded_len)
  ------------------
  |  Branch (2135:12): [True: 258k, False: 6.21k]
  ------------------
 2136|   258k|    {
 2137|   258k|      const char chr = pct_encoded[r];
 2138|   258k|      if ('%' == chr)
  ------------------
  |  Branch (2138:11): [True: 6.45k, False: 252k]
  ------------------
 2139|  6.45k|      {
 2140|  6.45k|        if (2 >= pct_encoded_len - r)
  ------------------
  |  Branch (2140:13): [True: 1.68k, False: 4.77k]
  ------------------
 2141|  1.68k|        {
 2142|  1.68k|          if (NULL != broken_encoding)
  ------------------
  |  Branch (2142:15): [True: 0, False: 1.68k]
  ------------------
 2143|      0|            *broken_encoding = true;
 2144|  1.68k|          decoded[w] = chr; /* Copy "as is" */
 2145|  1.68k|        }
 2146|  4.77k|        else
 2147|  4.77k|        {
 2148|  4.77k|          const char c1 = pct_encoded[++r];
 2149|  4.77k|          const char c2 = pct_encoded[++r];
 2150|  4.77k|          const int h = xdigittovalue (c1);
 2151|  4.77k|          const int l = xdigittovalue (c2);
 2152|  4.77k|          unsigned char out;
 2153|  4.77k|          if ((0 > h) || (0 > l))
  ------------------
  |  Branch (2153:15): [True: 2.13k, False: 2.64k]
  |  Branch (2153:26): [True: 1.73k, False: 909]
  ------------------
 2154|  3.86k|          {
 2155|  3.86k|            r -= 2;
 2156|  3.86k|            if (NULL != broken_encoding)
  ------------------
  |  Branch (2156:17): [True: 0, False: 3.86k]
  ------------------
 2157|      0|              *broken_encoding = true;
 2158|  3.86k|            decoded[w] = chr; /* Copy "as is" */
 2159|  3.86k|          }
 2160|    909|          else
 2161|    909|          {
 2162|    909|            out =
 2163|    909|              (unsigned char)
 2164|    909|              (((uint8_t)(((uint8_t)((unsigned int)h)) << 4))
 2165|    909|               | ((uint8_t)((unsigned int)l)));
 2166|    909|            decoded[w] = (char)out;
 2167|    909|          }
 2168|  4.77k|        }
 2169|  6.45k|      }
 2170|   252k|      else
 2171|   252k|        decoded[w] = chr;
 2172|   258k|      ++r;
 2173|   258k|      ++w;
 2174|   258k|    }
 2175|  6.21k|    return w;
 2176|  6.21k|  }
 2177|      0|#endif /* ! MHD_FAVOR_SMALL_CODE */
 2178|      0|  while (r < pct_encoded_len)
  ------------------
  |  Branch (2178:10): [True: 0, False: 0]
  ------------------
 2179|      0|  {
 2180|      0|    const char chr = pct_encoded[r];
 2181|      0|    if (w >= buf_size)
  ------------------
  |  Branch (2181:9): [True: 0, False: 0]
  ------------------
 2182|      0|      return 0;
 2183|      0|    if ('%' == chr)
  ------------------
  |  Branch (2183:9): [True: 0, False: 0]
  ------------------
 2184|      0|    {
 2185|      0|      if (2 >= pct_encoded_len - r)
  ------------------
  |  Branch (2185:11): [True: 0, False: 0]
  ------------------
 2186|      0|      {
 2187|      0|        if (NULL != broken_encoding)
  ------------------
  |  Branch (2187:13): [True: 0, False: 0]
  ------------------
 2188|      0|          *broken_encoding = true;
 2189|      0|        decoded[w] = chr; /* Copy "as is" */
 2190|      0|      }
 2191|      0|      else
 2192|      0|      {
 2193|      0|        const char c1 = pct_encoded[++r];
 2194|      0|        const char c2 = pct_encoded[++r];
 2195|      0|        const int h = xdigittovalue (c1);
 2196|      0|        const int l = xdigittovalue (c2);
 2197|      0|        if ((0 > h) || (0 > l))
  ------------------
  |  Branch (2197:13): [True: 0, False: 0]
  |  Branch (2197:24): [True: 0, False: 0]
  ------------------
 2198|      0|        {
 2199|      0|          r -= 2;
 2200|      0|          if (NULL != broken_encoding)
  ------------------
  |  Branch (2200:15): [True: 0, False: 0]
  ------------------
 2201|      0|            *broken_encoding = true;
 2202|      0|          decoded[w] = chr; /* Copy "as is" */
 2203|      0|        }
 2204|      0|        else
 2205|      0|        {
 2206|      0|          unsigned char out;
 2207|      0|          out =
 2208|      0|            (unsigned char)
 2209|      0|            (((uint8_t)(((uint8_t)((unsigned int)h)) << 4))
 2210|      0|             | ((uint8_t)((unsigned int)l)));
 2211|      0|          decoded[w] = (char)out;
 2212|      0|        }
 2213|      0|      }
 2214|      0|    }
 2215|      0|    else
 2216|      0|      decoded[w] = chr;
 2217|      0|    ++r;
 2218|      0|    ++w;
 2219|      0|  }
 2220|      0|  return w;
 2221|      0|}
_Z15mhd_str_unquotePKcmPc:
 2683|    330|{
 2684|    330|  size_t r;
 2685|    330|  size_t w;
 2686|       |
 2687|    330|  r = 0;
 2688|    330|  w = 0;
 2689|       |
 2690|   102k|  while (quoted_len > r)
  ------------------
  |  Branch (2690:10): [True: 102k, False: 225]
  ------------------
 2691|   102k|  {
 2692|   102k|    if ('\\' == quoted[r])
  ------------------
  |  Branch (2692:9): [True: 3.96k, False: 98.4k]
  ------------------
 2693|  3.96k|    {
 2694|  3.96k|      ++r;
 2695|  3.96k|      if (quoted_len == r)
  ------------------
  |  Branch (2695:11): [True: 105, False: 3.85k]
  ------------------
 2696|    105|        return 0; /* Last backslash is not followed by char to unescape */
 2697|  3.96k|    }
 2698|   102k|    result[w++] = quoted[r++];
 2699|   102k|  }
 2700|    225|  return w;
 2701|    330|}
_Z35mhd_str_starts_with_token_req_paramPK10MHD_StringS1_S1_P15mhd_BufferConstPb:
 3051|  11.7k|{
 3052|  11.7k|  size_t i;
 3053|  11.7k|  const char *const restrict cstr = str->cstr;
 3054|  11.7k|  bool token_found;
 3055|  11.7k|  bool param_found;
 3056|       |
 3057|  11.7k|  mhd_assert (0 != token->len);
  ------------------
  |  |   66|  11.7k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3058|  11.7k|  mhd_assert (NULL == memchr (token->cstr, '=', token->len));
  ------------------
  |  |   66|  11.7k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3059|  11.7k|  mhd_assert (NULL == memchr (token->cstr, ' ', token->len));
  ------------------
  |  |   66|  11.7k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3060|  11.7k|  mhd_assert (NULL == memchr (token->cstr, '\t', token->len));
  ------------------
  |  |   66|  11.7k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3061|  11.7k|  mhd_assert (NULL == memchr (par->cstr, '=', par->len));
  ------------------
  |  |   66|  11.7k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3062|  11.7k|  mhd_assert (NULL == memchr (par->cstr, ' ', par->len));
  ------------------
  |  |   66|  11.7k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3063|  11.7k|  mhd_assert (NULL == memchr (par->cstr, '\t', par->len));
  ------------------
  |  |   66|  11.7k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3064|       |
 3065|  11.7k|  par_value->data = NULL;
 3066|  11.7k|  par_value->size = 0;
 3067|       |
 3068|  11.7k|  if (str->len < token->len)
  ------------------
  |  Branch (3068:7): [True: 218, False: 11.5k]
  ------------------
 3069|    218|    return mhd_STR_STARTS_W_TOKEN_NO_TOKEN; /* The string is too short to match */
 3070|       |
 3071|  11.5k|  if (!mhd_str_equal_caseless_bin_n (cstr,
  ------------------
  |  Branch (3071:7): [True: 396, False: 11.1k]
  ------------------
 3072|  11.5k|                                     token->cstr,
 3073|  11.5k|                                     token->len))
 3074|    396|    return mhd_STR_STARTS_W_TOKEN_NO_TOKEN; /* The string does not start with the token */
 3075|  11.1k|  token_found = false;
 3076|  11.1k|  param_found = false;
 3077|       |
 3078|  11.1k|  i = token->len;
 3079|  11.1k|  do
 3080|  21.5k|  {
 3081|       |    /* Find start of the next parameter */
 3082|  59.5k|    for ((void)0; i < str->len; ++i)
  ------------------
  |  Branch (3082:19): [True: 59.0k, False: 493]
  ------------------
 3083|  59.0k|    {
 3084|  59.0k|      const char c = cstr[i];
 3085|  59.0k|      if ((' ' == c) || ('\t' == c))
  ------------------
  |  Branch (3085:11): [True: 1.02k, False: 58.0k]
  |  Branch (3085:25): [True: 36.9k, False: 21.1k]
  ------------------
 3086|  37.9k|        continue;
 3087|  21.1k|      if (';' == c)
  ------------------
  |  Branch (3087:11): [True: 19.9k, False: 1.11k]
  ------------------
 3088|  19.9k|      {
 3089|       |        /* Found the start of the next token parameter */
 3090|  19.9k|        if (param_found)
  ------------------
  |  Branch (3090:13): [True: 1.21k, False: 18.7k]
  ------------------
 3091|  1.21k|          return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN;
 3092|  18.7k|        ++i; /* Move to the next char */
 3093|  18.7k|        break;
 3094|  19.9k|      }
 3095|  1.11k|      if (',' == c)
  ------------------
  |  Branch (3095:11): [True: 250, False: 865]
  ------------------
 3096|    250|        return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN; /* Found the start of the next token */
 3097|       |
 3098|    865|      if (!token_found)
  ------------------
  |  Branch (3098:11): [True: 854, False: 11]
  ------------------
 3099|    854|      {
 3100|    854|        if (i == token->len)
  ------------------
  |  Branch (3100:13): [True: 820, False: 34]
  ------------------
 3101|    820|        {
 3102|       |          /* The initial part of the string does not fully match the token or
 3103|       |             formatting is not correct */
 3104|    820|          return mhd_STR_STARTS_W_TOKEN_NO_TOKEN;
 3105|    820|        }
 3106|       |        /* The string has garbage after the token and whitespace */
 3107|     34|        return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN_BAD_FORMAT;
 3108|    854|      }
 3109|       |      /* The garbage after the parameter */
 3110|     11|      return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN_BAD_FORMAT;
 3111|    865|    }
 3112|  19.2k|    token_found = true;
 3113|       |
 3114|  19.2k|    if (i == str->len)
  ------------------
  |  Branch (3114:9): [True: 504, False: 18.7k]
  ------------------
 3115|    504|      return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN;
 3116|       |
 3117|       |    /* 'i' is at the start of the parameter */
 3118|       |
 3119|  26.9k|    while ((' ' == cstr[i]) || ('\t' == cstr[i]))
  ------------------
  |  Branch (3119:12): [True: 8.05k, False: 18.8k]
  |  Branch (3119:32): [True: 558, False: 18.3k]
  ------------------
 3120|  8.61k|    {
 3121|  8.61k|      if (++i == str->len)
  ------------------
  |  Branch (3121:11): [True: 432, False: 8.18k]
  ------------------
 3122|    432|        return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN;
 3123|  8.61k|    }
 3124|       |
 3125|       |    /* 'i' is at the start of the parameter name */
 3126|       |
 3127|  18.3k|    if (par->len > str->len - i - 1)
  ------------------
  |  Branch (3127:9): [True: 2.61k, False: 15.7k]
  ------------------
 3128|  2.61k|      return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN; /* the token is found, but the parameter is not */
 3129|  15.7k|    else
 3130|  15.7k|    { /* Check the parameter */
 3131|  15.7k|      bool val_needs_unquote;
 3132|  15.7k|      size_t j;
 3133|  15.7k|      const char *const prm_str = cstr + i;
 3134|       |
 3135|  62.6k|      for (j = 0; j < par->len; ++j)
  ------------------
  |  Branch (3135:19): [True: 56.4k, False: 6.25k]
  ------------------
 3136|  56.4k|        if (!charsequalcaseless (prm_str[j],
  ------------------
  |  Branch (3136:13): [True: 9.44k, False: 46.9k]
  ------------------
 3137|  56.4k|                                 par->cstr[j]))
 3138|  9.44k|          break;
 3139|  15.7k|      i += j;
 3140|  15.7k|      mhd_assert (str->len > i);
  ------------------
  |  |   66|  15.7k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3141|  15.7k|      if ((j == par->len)
  ------------------
  |  Branch (3141:11): [True: 6.25k, False: 9.44k]
  ------------------
 3142|  6.25k|          && ('=' == cstr[i]))
  ------------------
  |  Branch (3142:14): [True: 5.16k, False: 1.09k]
  ------------------
 3143|  5.16k|      {
 3144|       |        /* The parameter name matches required parameter */
 3145|  5.16k|        param_found = true;
 3146|  5.16k|        par_value->data = cstr + i + 1;
 3147|  5.16k|      }
 3148|  10.5k|      else
 3149|  10.5k|      {
 3150|       |        /* i points to the char in the parameter name */
 3151|  70.9k|        while ('=' != cstr[i])
  ------------------
  |  Branch (3151:16): [True: 60.4k, False: 10.4k]
  ------------------
 3152|  60.4k|        {
 3153|  60.4k|          if ((';' == cstr[i])      /* end of the parameter */
  ------------------
  |  Branch (3153:15): [True: 4, False: 60.4k]
  ------------------
 3154|  60.4k|              || (',' == cstr[i])   /* end of the token */
  ------------------
  |  Branch (3154:18): [True: 0, False: 60.4k]
  ------------------
 3155|  60.4k|              || (str->len == ++i)) /* end of the field string */
  ------------------
  |  Branch (3155:18): [True: 36, False: 60.4k]
  ------------------
 3156|     40|          {
 3157|       |            /* parameter without the value */
 3158|     40|            return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN_BAD_FORMAT;
 3159|     40|          }
 3160|  60.4k|        }
 3161|  10.5k|      }
 3162|  15.6k|      mhd_assert (str->len > i);
  ------------------
  |  |   66|  15.6k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3163|  15.6k|      mhd_assert ('=' == cstr[i]);
  ------------------
  |  |   66|  15.6k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3164|       |
 3165|       |      /* 'i' points to '=' between parameter name and parameter value */
 3166|       |
 3167|  15.6k|      ++i; /* Advance to the first char in the parameter value */
 3168|  15.6k|      if (str->len == i)
  ------------------
  |  Branch (3168:11): [True: 530, False: 15.1k]
  ------------------
 3169|    530|        return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN; /* Zero-length parameter value */
 3170|       |
 3171|  15.1k|      val_needs_unquote = false;
 3172|       |
 3173|       |      /* 'i' points to the char after '=' */
 3174|       |
 3175|  15.1k|      if ('"' == cstr[i])
  ------------------
  |  Branch (3175:11): [True: 3.87k, False: 11.2k]
  ------------------
 3176|  3.87k|      {
 3177|       |        /* The value is quoted */
 3178|  3.87k|        if (param_found)
  ------------------
  |  Branch (3178:13): [True: 2.43k, False: 1.44k]
  ------------------
 3179|  2.43k|          ++(par_value->data); /* Point to the first quoted char */
 3180|  3.87k|        do
 3181|   217k|        {
 3182|   217k|          ++i; /* Advance to the next char */
 3183|   217k|          if (str->len == i)
  ------------------
  |  Branch (3183:15): [True: 10, False: 217k]
  ------------------
 3184|     10|            return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN_BAD_FORMAT; /* No closing quote */
 3185|   217k|          if ('\\' == cstr[i])
  ------------------
  |  Branch (3185:15): [True: 8.48k, False: 209k]
  ------------------
 3186|  8.48k|          {
 3187|  8.48k|            val_needs_unquote = true;
 3188|  8.48k|            ++i; /* Skip quoted char */
 3189|  8.48k|            if (str->len == i)
  ------------------
  |  Branch (3189:17): [True: 1, False: 8.48k]
  ------------------
 3190|      1|              return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN_BAD_FORMAT; /* No closing quote */
 3191|  8.48k|          }
 3192|   217k|        } while ('"' != cstr[i]);
  ------------------
  |  Branch (3192:18): [True: 213k, False: 3.86k]
  ------------------
 3193|  3.86k|        if (param_found)
  ------------------
  |  Branch (3193:13): [True: 2.42k, False: 1.43k]
  ------------------
 3194|  2.42k|        {
 3195|  2.42k|          par_value->size = (size_t)((cstr + i) - par_value->data);
 3196|  2.42k|          *par_value_needs_unquote = val_needs_unquote;
 3197|  2.42k|        }
 3198|       |        /* Complete value found */
 3199|       |        /* Check for the garbage data at the end */
 3200|  3.86k|        ++i; /* Advance to the next char */
 3201|  3.86k|      }
 3202|  11.2k|      else
 3203|  11.2k|      {
 3204|       |        /* The value is not quoted */
 3205|  52.9k|        while ((' ' != cstr[i])
  ------------------
  |  Branch (3205:16): [True: 52.5k, False: 375]
  ------------------
 3206|  52.5k|               && ('\t' != cstr[i]))
  ------------------
  |  Branch (3206:19): [True: 52.5k, False: 1]
  ------------------
 3207|  52.5k|        {
 3208|  52.5k|          if ((';' == cstr[i])      /* end of the parameter */
  ------------------
  |  Branch (3208:15): [True: 7.70k, False: 44.8k]
  ------------------
 3209|  44.8k|              || (',' == cstr[i])   /* end of the token */
  ------------------
  |  Branch (3209:18): [True: 8, False: 44.8k]
  ------------------
 3210|  44.8k|              || (str->len == ++i)) /* end of the field string */
  ------------------
  |  Branch (3210:18): [True: 3.17k, False: 41.6k]
  ------------------
 3211|  10.8k|            break;
 3212|  52.5k|        }
 3213|       |        /* The end parameter value */
 3214|  11.2k|        if (param_found)
  ------------------
  |  Branch (3214:13): [True: 2.40k, False: 8.86k]
  ------------------
 3215|  2.40k|        {
 3216|  2.40k|          par_value->size = (size_t)((cstr + i) - par_value->data);
 3217|  2.40k|          *par_value_needs_unquote = false;
 3218|  2.40k|        }
 3219|       |        /* Check for the garbage data at the end */
 3220|  11.2k|      }
 3221|       |
 3222|       |      /* 'i' points to the next char after end of the parameter value */
 3223|  15.1k|    }
 3224|  18.3k|  } while (i < str->len);
  ------------------
  |  Branch (3224:12): [True: 10.4k, False: 4.66k]
  ------------------
 3225|       |
 3226|  4.66k|  mhd_assert (token_found);
  ------------------
  |  |   66|  4.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3227|  4.66k|  return mhd_STR_STARTS_W_TOKEN_HAS_TOKEN;
 3228|  11.1k|}
mhd_str.c:_ZL18charsequalcaselesscc:
  840|   361k|{
  841|   361k|  if (c1 == c2)
  ------------------
  |  Branch (841:7): [True: 329k, False: 31.4k]
  ------------------
  842|   329k|    return true;
  843|       |  /* Fold case on both sides */
  844|  31.4k|  c1 = ((char)(~0x20u & (unsigned char)c1));
  845|  31.4k|  c2 = ((char)(~0x20u & (unsigned char)c2));
  846|  31.4k|  return (c1 == c2) && isasciiupper (c1);
  ------------------
  |  Branch (846:10): [True: 19.6k, False: 11.8k]
  |  Branch (846:24): [True: 19.6k, False: 2]
  ------------------
  847|   361k|}
mhd_str.c:_ZL12isasciiupperc:
  104|  19.6k|{
  105|  19.6k|  const unsigned int uc = (unsigned int)(unsigned char)c;
  106|  19.6k|  const unsigned int t = uc - (unsigned int)(unsigned char)'A';
  107|  19.6k|  return (((unsigned int)('Z' - 'A')) >= t);
  108|  19.6k|}
mhd_str.c:_ZL12isasciidigitc:
  136|    275|{
  137|    275|  return (c <= '9') && (c >= '0');
  ------------------
  |  Branch (137:10): [True: 275, False: 0]
  |  Branch (137:24): [True: 275, False: 0]
  ------------------
  138|    275|}
mhd_str.c:_ZL13xdigittovaluec:
  238|  9.55k|{
  239|  9.55k|  const unsigned char uc = (unsigned char)c;  /* Force unsigned value */
  240|  9.55k|#  if !defined(MHD_FAVOR_SMALL_CODE)
  241|  9.55k|  static const signed char map_xdigit_to_value[256] = {
  242|  9.55k|    -1 /* 0x00 (NUL) */,
  243|  9.55k|    -1 /* 0x01 (SOH) */,
  244|  9.55k|    -1 /* 0x02 (STX) */,
  245|  9.55k|    -1 /* 0x03 (ETX) */,
  246|  9.55k|    -1 /* 0x04 (EOT) */,
  247|  9.55k|    -1 /* 0x05 (ENQ) */,
  248|  9.55k|    -1 /* 0x06 (ACK) */,
  249|  9.55k|    -1 /* 0x07 (BEL) */,
  250|  9.55k|    -1 /* 0x08 (BS)  */,
  251|  9.55k|    -1 /* 0x09 (HT)  */,
  252|  9.55k|    -1 /* 0x0A (LF)  */,
  253|  9.55k|    -1 /* 0x0B (VT)  */,
  254|  9.55k|    -1 /* 0x0C (FF)  */,
  255|  9.55k|    -1 /* 0x0D (CR)  */,
  256|  9.55k|    -1 /* 0x0E (SO)  */,
  257|  9.55k|    -1 /* 0x0F (SI)  */,
  258|  9.55k|    -1 /* 0x10 (DLE) */,
  259|  9.55k|    -1 /* 0x11 (DC1) */,
  260|  9.55k|    -1 /* 0x12 (DC2) */,
  261|  9.55k|    -1 /* 0x13 (DC3) */,
  262|  9.55k|    -1 /* 0x14 (DC4) */,
  263|  9.55k|    -1 /* 0x15 (NAK) */,
  264|  9.55k|    -1 /* 0x16 (SYN) */,
  265|  9.55k|    -1 /* 0x17 (ETB) */,
  266|  9.55k|    -1 /* 0x18 (CAN) */,
  267|  9.55k|    -1 /* 0x19 (EM)  */,
  268|  9.55k|    -1 /* 0x1A (SUB) */,
  269|  9.55k|    -1 /* 0x1B (ESC) */,
  270|  9.55k|    -1 /* 0x1C (FS)  */,
  271|  9.55k|    -1 /* 0x1D (GS)  */,
  272|  9.55k|    -1 /* 0x1E (RS)  */,
  273|  9.55k|    -1 /* 0x1F (US)  */,
  274|  9.55k|    -1 /* 0x20 (' ') */,
  275|  9.55k|    -1 /* 0x21 ('!') */,
  276|  9.55k|    -1 /* 0x22 ('"') */,
  277|  9.55k|    -1 /* 0x23 ('#') */,
  278|  9.55k|    -1 /* 0x24 ('$') */,
  279|  9.55k|    -1 /* 0x25 ('%') */,
  280|  9.55k|    -1 /* 0x26 ('&') */,
  281|  9.55k|    -1 /* 0x27 ('\'') */,
  282|  9.55k|    -1 /* 0x28 ('(') */,
  283|  9.55k|    -1 /* 0x29 (')') */,
  284|  9.55k|    -1 /* 0x2A ('*') */,
  285|  9.55k|    -1 /* 0x2B ('+') */,
  286|  9.55k|    -1 /* 0x2C (',') */,
  287|  9.55k|    -1 /* 0x2D ('-') */,
  288|  9.55k|    -1 /* 0x2E ('.') */,
  289|  9.55k|    -1 /* 0x2F ('/') */,
  290|  9.55k|    0 /*  0x30 ('0') */,
  291|  9.55k|    1 /*  0x31 ('1') */,
  292|  9.55k|    2 /*  0x32 ('2') */,
  293|  9.55k|    3 /*  0x33 ('3') */,
  294|  9.55k|    4 /*  0x34 ('4') */,
  295|  9.55k|    5 /*  0x35 ('5') */,
  296|  9.55k|    6 /*  0x36 ('6') */,
  297|  9.55k|    7 /*  0x37 ('7') */,
  298|  9.55k|    8 /*  0x38 ('8') */,
  299|  9.55k|    9 /*  0x39 ('9') */,
  300|  9.55k|    -1 /* 0x3A (':') */,
  301|  9.55k|    -1 /* 0x3B (';') */,
  302|  9.55k|    -1 /* 0x3C ('<') */,
  303|  9.55k|    -1 /* 0x3D ('=') */,
  304|  9.55k|    -1 /* 0x3E ('>') */,
  305|  9.55k|    -1 /* 0x3F ('?') */,
  306|  9.55k|    -1 /* 0x40 ('@') */,
  307|  9.55k|    10 /* 0x41 ('A') */,
  308|  9.55k|    11 /* 0x42 ('B') */,
  309|  9.55k|    12 /* 0x43 ('C') */,
  310|  9.55k|    13 /* 0x44 ('D') */,
  311|  9.55k|    14 /* 0x45 ('E') */,
  312|  9.55k|    15 /* 0x46 ('F') */,
  313|  9.55k|    -1 /* 0x47 ('G') */,
  314|  9.55k|    -1 /* 0x48 ('H') */,
  315|  9.55k|    -1 /* 0x49 ('I') */,
  316|  9.55k|    -1 /* 0x4A ('J') */,
  317|  9.55k|    -1 /* 0x4B ('K') */,
  318|  9.55k|    -1 /* 0x4C ('L') */,
  319|  9.55k|    -1 /* 0x4D ('M') */,
  320|  9.55k|    -1 /* 0x4E ('N') */,
  321|  9.55k|    -1 /* 0x4F ('O') */,
  322|  9.55k|    -1 /* 0x50 ('P') */,
  323|  9.55k|    -1 /* 0x51 ('Q') */,
  324|  9.55k|    -1 /* 0x52 ('R') */,
  325|  9.55k|    -1 /* 0x53 ('S') */,
  326|  9.55k|    -1 /* 0x54 ('T') */,
  327|  9.55k|    -1 /* 0x55 ('U') */,
  328|  9.55k|    -1 /* 0x56 ('V') */,
  329|  9.55k|    -1 /* 0x57 ('W') */,
  330|  9.55k|    -1 /* 0x58 ('X') */,
  331|  9.55k|    -1 /* 0x59 ('Y') */,
  332|  9.55k|    -1 /* 0x5A ('Z') */,
  333|  9.55k|    -1 /* 0x5B ('[') */,
  334|  9.55k|    -1 /* 0x5C ('\') */,
  335|  9.55k|    -1 /* 0x5D (']') */,
  336|  9.55k|    -1 /* 0x5E ('^') */,
  337|  9.55k|    -1 /* 0x5F ('_') */,
  338|  9.55k|    -1 /* 0x60 ('`') */,
  339|  9.55k|    10 /* 0x61 ('a') */,
  340|  9.55k|    11 /* 0x62 ('b') */,
  341|  9.55k|    12 /* 0x63 ('c') */,
  342|  9.55k|    13 /* 0x64 ('d') */,
  343|  9.55k|    14 /* 0x65 ('e') */,
  344|  9.55k|    15 /* 0x66 ('f') */,
  345|  9.55k|    -1 /* 0x67 ('g') */,
  346|  9.55k|    -1 /* 0x68 ('h') */,
  347|  9.55k|    -1 /* 0x69 ('i') */,
  348|  9.55k|    -1 /* 0x6A ('j') */,
  349|  9.55k|    -1 /* 0x6B ('k') */,
  350|  9.55k|    -1 /* 0x6C ('l') */,
  351|  9.55k|    -1 /* 0x6D ('m') */,
  352|  9.55k|    -1 /* 0x6E ('n') */,
  353|  9.55k|    -1 /* 0x6F ('o') */,
  354|  9.55k|    -1 /* 0x70 ('p') */,
  355|  9.55k|    -1 /* 0x71 ('q') */,
  356|  9.55k|    -1 /* 0x72 ('r') */,
  357|  9.55k|    -1 /* 0x73 ('s') */,
  358|  9.55k|    -1 /* 0x74 ('t') */,
  359|  9.55k|    -1 /* 0x75 ('u') */,
  360|  9.55k|    -1 /* 0x76 ('v') */,
  361|  9.55k|    -1 /* 0x77 ('w') */,
  362|  9.55k|    -1 /* 0x78 ('x') */,
  363|  9.55k|    -1 /* 0x79 ('y') */,
  364|  9.55k|    -1 /* 0x7A ('z') */,
  365|  9.55k|    -1 /* 0x7B ('{') */,
  366|  9.55k|    -1 /* 0x7C ('|') */,
  367|  9.55k|    -1 /* 0x7D ('}') */,
  368|  9.55k|    -1 /* 0x7E ('~') */,
  369|  9.55k|    -1 /* 0x7F (DEL) */,
  370|  9.55k|    -1 /* 0x80 (EXT) */,
  371|  9.55k|    -1 /* 0x81 (EXT) */,
  372|  9.55k|    -1 /* 0x82 (EXT) */,
  373|  9.55k|    -1 /* 0x83 (EXT) */,
  374|  9.55k|    -1 /* 0x84 (EXT) */,
  375|  9.55k|    -1 /* 0x85 (EXT) */,
  376|  9.55k|    -1 /* 0x86 (EXT) */,
  377|  9.55k|    -1 /* 0x87 (EXT) */,
  378|  9.55k|    -1 /* 0x88 (EXT) */,
  379|  9.55k|    -1 /* 0x89 (EXT) */,
  380|  9.55k|    -1 /* 0x8A (EXT) */,
  381|  9.55k|    -1 /* 0x8B (EXT) */,
  382|  9.55k|    -1 /* 0x8C (EXT) */,
  383|  9.55k|    -1 /* 0x8D (EXT) */,
  384|  9.55k|    -1 /* 0x8E (EXT) */,
  385|  9.55k|    -1 /* 0x8F (EXT) */,
  386|  9.55k|    -1 /* 0x90 (EXT) */,
  387|  9.55k|    -1 /* 0x91 (EXT) */,
  388|  9.55k|    -1 /* 0x92 (EXT) */,
  389|  9.55k|    -1 /* 0x93 (EXT) */,
  390|  9.55k|    -1 /* 0x94 (EXT) */,
  391|  9.55k|    -1 /* 0x95 (EXT) */,
  392|  9.55k|    -1 /* 0x96 (EXT) */,
  393|  9.55k|    -1 /* 0x97 (EXT) */,
  394|  9.55k|    -1 /* 0x98 (EXT) */,
  395|  9.55k|    -1 /* 0x99 (EXT) */,
  396|  9.55k|    -1 /* 0x9A (EXT) */,
  397|  9.55k|    -1 /* 0x9B (EXT) */,
  398|  9.55k|    -1 /* 0x9C (EXT) */,
  399|  9.55k|    -1 /* 0x9D (EXT) */,
  400|  9.55k|    -1 /* 0x9E (EXT) */,
  401|  9.55k|    -1 /* 0x9F (EXT) */,
  402|  9.55k|    -1 /* 0xA0 (EXT) */,
  403|  9.55k|    -1 /* 0xA1 (EXT) */,
  404|  9.55k|    -1 /* 0xA2 (EXT) */,
  405|  9.55k|    -1 /* 0xA3 (EXT) */,
  406|  9.55k|    -1 /* 0xA4 (EXT) */,
  407|  9.55k|    -1 /* 0xA5 (EXT) */,
  408|  9.55k|    -1 /* 0xA6 (EXT) */,
  409|  9.55k|    -1 /* 0xA7 (EXT) */,
  410|  9.55k|    -1 /* 0xA8 (EXT) */,
  411|  9.55k|    -1 /* 0xA9 (EXT) */,
  412|  9.55k|    -1 /* 0xAA (EXT) */,
  413|  9.55k|    -1 /* 0xAB (EXT) */,
  414|  9.55k|    -1 /* 0xAC (EXT) */,
  415|  9.55k|    -1 /* 0xAD (EXT) */,
  416|  9.55k|    -1 /* 0xAE (EXT) */,
  417|  9.55k|    -1 /* 0xAF (EXT) */,
  418|  9.55k|    -1 /* 0xB0 (EXT) */,
  419|  9.55k|    -1 /* 0xB1 (EXT) */,
  420|  9.55k|    -1 /* 0xB2 (EXT) */,
  421|  9.55k|    -1 /* 0xB3 (EXT) */,
  422|  9.55k|    -1 /* 0xB4 (EXT) */,
  423|  9.55k|    -1 /* 0xB5 (EXT) */,
  424|  9.55k|    -1 /* 0xB6 (EXT) */,
  425|  9.55k|    -1 /* 0xB7 (EXT) */,
  426|  9.55k|    -1 /* 0xB8 (EXT) */,
  427|  9.55k|    -1 /* 0xB9 (EXT) */,
  428|  9.55k|    -1 /* 0xBA (EXT) */,
  429|  9.55k|    -1 /* 0xBB (EXT) */,
  430|  9.55k|    -1 /* 0xBC (EXT) */,
  431|  9.55k|    -1 /* 0xBD (EXT) */,
  432|  9.55k|    -1 /* 0xBE (EXT) */,
  433|  9.55k|    -1 /* 0xBF (EXT) */,
  434|  9.55k|    -1 /* 0xC0 (EXT) */,
  435|  9.55k|    -1 /* 0xC1 (EXT) */,
  436|  9.55k|    -1 /* 0xC2 (EXT) */,
  437|  9.55k|    -1 /* 0xC3 (EXT) */,
  438|  9.55k|    -1 /* 0xC4 (EXT) */,
  439|  9.55k|    -1 /* 0xC5 (EXT) */,
  440|  9.55k|    -1 /* 0xC6 (EXT) */,
  441|  9.55k|    -1 /* 0xC7 (EXT) */,
  442|  9.55k|    -1 /* 0xC8 (EXT) */,
  443|  9.55k|    -1 /* 0xC9 (EXT) */,
  444|  9.55k|    -1 /* 0xCA (EXT) */,
  445|  9.55k|    -1 /* 0xCB (EXT) */,
  446|  9.55k|    -1 /* 0xCC (EXT) */,
  447|  9.55k|    -1 /* 0xCD (EXT) */,
  448|  9.55k|    -1 /* 0xCE (EXT) */,
  449|  9.55k|    -1 /* 0xCF (EXT) */,
  450|  9.55k|    -1 /* 0xD0 (EXT) */,
  451|  9.55k|    -1 /* 0xD1 (EXT) */,
  452|  9.55k|    -1 /* 0xD2 (EXT) */,
  453|  9.55k|    -1 /* 0xD3 (EXT) */,
  454|  9.55k|    -1 /* 0xD4 (EXT) */,
  455|  9.55k|    -1 /* 0xD5 (EXT) */,
  456|  9.55k|    -1 /* 0xD6 (EXT) */,
  457|  9.55k|    -1 /* 0xD7 (EXT) */,
  458|  9.55k|    -1 /* 0xD8 (EXT) */,
  459|  9.55k|    -1 /* 0xD9 (EXT) */,
  460|  9.55k|    -1 /* 0xDA (EXT) */,
  461|  9.55k|    -1 /* 0xDB (EXT) */,
  462|  9.55k|    -1 /* 0xDC (EXT) */,
  463|  9.55k|    -1 /* 0xDD (EXT) */,
  464|  9.55k|    -1 /* 0xDE (EXT) */,
  465|  9.55k|    -1 /* 0xDF (EXT) */,
  466|  9.55k|    -1 /* 0xE0 (EXT) */,
  467|  9.55k|    -1 /* 0xE1 (EXT) */,
  468|  9.55k|    -1 /* 0xE2 (EXT) */,
  469|  9.55k|    -1 /* 0xE3 (EXT) */,
  470|  9.55k|    -1 /* 0xE4 (EXT) */,
  471|  9.55k|    -1 /* 0xE5 (EXT) */,
  472|  9.55k|    -1 /* 0xE6 (EXT) */,
  473|  9.55k|    -1 /* 0xE7 (EXT) */,
  474|  9.55k|    -1 /* 0xE8 (EXT) */,
  475|  9.55k|    -1 /* 0xE9 (EXT) */,
  476|  9.55k|    -1 /* 0xEA (EXT) */,
  477|  9.55k|    -1 /* 0xEB (EXT) */,
  478|  9.55k|    -1 /* 0xEC (EXT) */,
  479|  9.55k|    -1 /* 0xED (EXT) */,
  480|  9.55k|    -1 /* 0xEE (EXT) */,
  481|  9.55k|    -1 /* 0xEF (EXT) */,
  482|  9.55k|    -1 /* 0xF0 (EXT) */,
  483|  9.55k|    -1 /* 0xF1 (EXT) */,
  484|  9.55k|    -1 /* 0xF2 (EXT) */,
  485|  9.55k|    -1 /* 0xF3 (EXT) */,
  486|  9.55k|    -1 /* 0xF4 (EXT) */,
  487|  9.55k|    -1 /* 0xF5 (EXT) */,
  488|  9.55k|    -1 /* 0xF6 (EXT) */,
  489|  9.55k|    -1 /* 0xF7 (EXT) */,
  490|  9.55k|    -1 /* 0xF8 (EXT) */,
  491|  9.55k|    -1 /* 0xF9 (EXT) */,
  492|  9.55k|    -1 /* 0xFA (EXT) */,
  493|  9.55k|    -1 /* 0xFB (EXT) */,
  494|  9.55k|    -1 /* 0xFC (EXT) */,
  495|  9.55k|    -1 /* 0xFD (EXT) */,
  496|  9.55k|    -1 /* 0xFE (EXT) */,
  497|  9.55k|    -1   /* 0xFF (EXT) */
  498|  9.55k|  };
  499|  9.55k|  return map_xdigit_to_value[uc];
  500|       |#  else  /* MHD_FAVOR_SMALL_CODE */
  501|       |  unsigned int try_val;
  502|       |
  503|       |  try_val = uc - (unsigned char)'0';
  504|       |  if (9 >= try_val)
  505|       |    return (int)(unsigned int)try_val;
  506|       |  try_val = (uc | 0x20u /* fold case */) - (unsigned char)'a';
  507|       |  if (5 >= try_val)
  508|       |    return (int)(unsigned int)(try_val + 10u);
  509|       |
  510|       |  return -1;
  511|       |#  endif /* MHD_FAVOR_SMALL_CODE */
  512|  9.55k|}

_Z33mhd_stream_prepare_for_post_parseP14MHD_Connection:
  448|  4.90k|{
  449|  4.90k|  mhd_assert (mhd_ACTION_POST_PARSE == c->rq.app_act.head_act.act);
  ------------------
  |  |   66|  4.90k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  450|  4.90k|  if (MHD_HTTP_POST_ENCODING_OTHER ==
  ------------------
  |  Branch (450:7): [True: 234, False: 4.67k]
  ------------------
  451|  4.90k|      c->rq.app_act.head_act.data.post_parse.enc)
  452|    234|  {
  453|    234|    if (!detect_post_enc (c))
  ------------------
  |  Branch (453:9): [True: 234, False: 0]
  ------------------
  454|    234|    {
  455|    234|      mhd_assert (MHD_POST_PARSE_RES_OK != c->rq.u_proc.post.parse_result);
  ------------------
  |  |   66|    234|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  456|    234|      c->discard_request = true;
  457|    234|      c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
  458|    234|      return false;
  459|    234|    }
  460|    234|  }
  461|  4.67k|  else if (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ==
  ------------------
  |  Branch (461:12): [True: 2.41k, False: 2.26k]
  ------------------
  462|  4.67k|           c->rq.app_act.head_act.data.post_parse.enc)
  463|  2.41k|  {
  464|  2.41k|    if (!detect_mpart_boundary_from_the_header (c))
  ------------------
  |  Branch (464:9): [True: 171, False: 2.23k]
  ------------------
  465|    171|    {
  466|    171|      mhd_assert (MHD_POST_PARSE_RES_OK != c->rq.u_proc.post.parse_result);
  ------------------
  |  |   66|    171|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  467|    171|      c->discard_request = true;
  468|    171|      c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
  469|    171|      return false;
  470|    171|    }
  471|  2.41k|  }
  472|  2.26k|  else
  473|  2.26k|    c->rq.u_proc.post.enc = c->rq.app_act.head_act.data.post_parse.enc;
  474|       |
  475|  4.50k|  mhd_assert (MHD_HTTP_POST_ENCODING_OTHER != \
  ------------------
  |  |   66|  4.50k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  476|  4.50k|              c->rq.u_proc.post.enc);
  477|  4.50k|  mhd_assert ((MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA != \
  ------------------
  |  |   66|  4.50k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  478|  4.50k|               c->rq.u_proc.post.enc) \
  479|  4.50k|              || (4 < c->rq.u_proc.post.e_d.m_form.delim.size));
  480|       |
  481|  4.50k|  init_post_parse_data (c);
  482|       |
  483|  4.50k|  return true;
  484|  4.90k|}
_Z21mhd_stream_post_parseP14MHD_ConnectionPmPc:
 2593|  2.35k|{
 2594|  2.35k|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 2595|  2.35k|  size_t lbuf_left;
 2596|       |
 2597|  2.35k|  mhd_assert (MHD_HTTP_POST_ENCODING_OTHER != p_data->enc);
  ------------------
  |  |   66|  2.35k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2598|  2.35k|  mhd_assert (c->rq.cntn.lbuf.size <= p_data->lbuf_limit);
  ------------------
  |  |   66|  2.35k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2599|       |
 2600|  2.35k|  if ((MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA == p_data->enc)
  ------------------
  |  Branch (2600:7): [True: 1.11k, False: 1.24k]
  ------------------
 2601|  1.11k|      && (mhd_POST_MPART_ST_EPILOGUE == p_data->e_d.m_form.st))
  ------------------
  |  Branch (2601:10): [True: 0, False: 1.11k]
  ------------------
 2602|      0|  {
 2603|       |    /* No need to process the data */
 2604|      0|    *pdata_size = 0; /* All data has been "processed" */
 2605|      0|    return false; /* Continue normal processing */
 2606|      0|  }
 2607|       |
 2608|       |  // TODO: support process in the connection buffer
 2609|       |
 2610|  2.35k|  mhd_assert (c->rq.cntn.lbuf.size >= p_data->lbuf_used);
  ------------------
  |  |   66|  2.35k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2611|  2.35k|  lbuf_left = c->rq.cntn.lbuf.size - p_data->lbuf_used;
 2612|       |
 2613|  2.35k|  if (*pdata_size + 1 > lbuf_left)
  ------------------
  |  Branch (2613:7): [True: 1.55k, False: 801]
  ------------------
 2614|  1.55k|    (void)extend_lbuf_up_to (c,
 2615|  1.55k|                             *pdata_size + 1 - lbuf_left,
 2616|  1.55k|                             &(c->rq.cntn.lbuf));
 2617|       |
 2618|  3.18k|  while ((0 != *pdata_size)
  ------------------
  |  Branch (2618:10): [True: 2.72k, False: 463]
  ------------------
 2619|  2.72k|         && (c->rq.cntn.lbuf.size > p_data->lbuf_used))
  ------------------
  |  Branch (2619:13): [True: 2.60k, False: 111]
  ------------------
 2620|  2.60k|  {
 2621|  2.60k|    size_t data_size_before_parse;
 2622|  2.60k|    size_t copy_size = *pdata_size;
 2623|  2.60k|    lbuf_left = c->rq.cntn.lbuf.size - p_data->lbuf_used;
 2624|  2.60k|    if (lbuf_left < copy_size)
  ------------------
  |  Branch (2624:9): [True: 1.04k, False: 1.56k]
  ------------------
 2625|  1.04k|      copy_size = lbuf_left;
 2626|       |
 2627|  2.60k|    memcpy (c->rq.cntn.lbuf.data + p_data->lbuf_used,
 2628|  2.60k|            buf,
 2629|  2.60k|            copy_size);
 2630|  2.60k|    p_data->lbuf_used += copy_size;
 2631|  2.60k|    *pdata_size -= copy_size;
 2632|       |
 2633|  2.60k|    data_size_before_parse = p_data->lbuf_used;
 2634|  2.60k|    switch (p_data->enc)
 2635|  2.60k|    {
 2636|    338|    case MHD_HTTP_POST_ENCODING_FORM_URLENCODED:
  ------------------
  |  Branch (2636:5): [True: 338, False: 2.27k]
  ------------------
 2637|    338|      if (parse_post_urlenc (c,
  ------------------
  |  Branch (2637:11): [True: 102, False: 236]
  ------------------
 2638|    338|                             &(p_data->lbuf_used),
 2639|    338|                             c->rq.cntn.lbuf.data))
 2640|    102|        return true;
 2641|    236|      break;
 2642|  1.48k|    case MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA:
  ------------------
  |  Branch (2642:5): [True: 1.48k, False: 1.12k]
  ------------------
 2643|  1.48k|      if (parse_post_mpart (c,
  ------------------
  |  Branch (2643:11): [True: 381, False: 1.09k]
  ------------------
 2644|  1.48k|                            &(p_data->lbuf_used),
 2645|  1.48k|                            c->rq.cntn.lbuf.data))
 2646|    381|        return true;
 2647|  1.09k|      break;
 2648|  1.09k|    case MHD_HTTP_POST_ENCODING_TEXT_PLAIN:
  ------------------
  |  Branch (2648:5): [True: 791, False: 1.81k]
  ------------------
 2649|    791|      if (parse_post_text (c,
  ------------------
  |  Branch (2649:11): [True: 404, False: 387]
  ------------------
 2650|    791|                           &(p_data->lbuf_used),
 2651|    791|                           c->rq.cntn.lbuf.data))
 2652|    404|        return true;
 2653|    387|      break;
 2654|    387|    case MHD_HTTP_POST_ENCODING_OTHER:
  ------------------
  |  Branch (2654:5): [True: 0, False: 2.60k]
  ------------------
 2655|      0|    default:
  ------------------
  |  Branch (2655:5): [True: 0, False: 2.60k]
  ------------------
 2656|      0|      mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 2657|      0|      p_data->parse_result =
 2658|      0|        MHD_POST_PARSE_RES_PARTIAL_INVALID_POST_FORMAT;
 2659|      0|      c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
 2660|      0|      return true;
 2661|  2.60k|    }
 2662|  1.72k|    if (data_size_before_parse == p_data->lbuf_used)
  ------------------
  |  Branch (2662:9): [True: 896, False: 826]
  ------------------
 2663|    896|      break; /* Nothing consumed, not possible to add new data to the buffer now */
 2664|  1.72k|  }
 2665|       |
 2666|  1.47k|  if (0 != *pdata_size)
  ------------------
  |  Branch (2666:7): [True: 452, False: 1.01k]
  ------------------
 2667|    452|    return report_low_lbuf_mem (c);
 2668|       |
 2669|  1.01k|  return false; /* Continue normal processing */
 2670|  1.47k|}
_Z30mhd_stream_process_post_finishP14MHD_Connection:
 3141|  2.45k|{
 3142|  2.45k|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 3143|  2.45k|  const struct MHD_UploadAction *act;
 3144|  2.45k|  bool state_changed;
 3145|       |
 3146|  2.45k|  if ((MHD_POST_PARSE_RES_OK == p_data->parse_result)
  ------------------
  |  Branch (3146:7): [True: 1.42k, False: 1.02k]
  ------------------
 3147|  1.42k|      && !c->discard_request)
  ------------------
  |  Branch (3147:10): [True: 1.15k, False: 269]
  ------------------
 3148|  1.15k|  {
 3149|       |    // TODO: implement processing in the connection buffer
 3150|  1.15k|    if (check_post_leftovers (c))
  ------------------
  |  Branch (3150:9): [True: 0, False: 1.15k]
  ------------------
 3151|      0|      return true;
 3152|  1.15k|  }
 3153|       |
 3154|  2.45k|  act = c->rq.app_act.head_act.data.post_parse.done_cb (
 3155|  2.45k|    &(c->rq),
 3156|  2.45k|    c->rq.app_act.head_act.data.post_parse.done_cb_cls,
 3157|  2.45k|    p_data->parse_result);
 3158|       |
 3159|  2.45k|  state_changed = mhd_stream_process_upload_action (c, act, true);
 3160|  2.45k|  if (!c->suspended)
  ------------------
  |  Branch (3160:7): [True: 2.45k, False: 0]
  ------------------
 3161|  2.45k|    mhd_daemon_free_lbuf (c->daemon, &(c->rq.cntn.lbuf));
 3162|  2.45k|  return state_changed;
 3163|  2.45k|}
post_parser_funcs.c:_ZL15detect_post_encP14MHD_Connection:
  218|    234|{
  219|    234|  struct MHD_StringNullable hdr_cnt_tp;
  220|       |
  221|    234|  mhd_assert (mhd_HTTP_STAGE_BODY_RECEIVING > c->stage);
  ------------------
  |  |   66|    234|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  222|       |
  223|    234|  if (!mhd_request_get_value_st (&(c->rq),
  ------------------
  |  |  101|    234|          mhd_request_get_value_n ((r),(k),mhd_SSTR_LEN (str),(str),(v_out))
  |  |  ------------------
  |  |  |  |   54|    234|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
  |  Branch (223:7): [True: 234, False: 0]
  ------------------
  224|    234|                                 MHD_VK_HEADER,
  225|    234|                                 MHD_HTTP_HEADER_CONTENT_TYPE,
  226|    234|                                 &hdr_cnt_tp))
  227|    234|  {
  228|    234|    mhd_LOG_MSG (c->daemon, MHD_SC_REQ_POST_PARSE_FAILED_NO_CNTN_TYPE, \
  ------------------
  |  |   80|    234|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
  229|    234|                 "The request POST data cannot be parsed because " \
  230|    234|                 "the request has no 'Content-Type:' header and no " \
  231|    234|                 "explicit POST encoding is set.");
  232|    234|    c->rq.u_proc.post.parse_result = MHD_POST_PARSE_RES_FAILED_NO_CNTN_TYPE;
  233|    234|    return false;  /* The "Content-Type:" is not defined by the client */
  234|    234|  }
  235|       |
  236|      0|  mhd_assert (NULL != hdr_cnt_tp.cstr);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  237|       |
  238|      0|  if (mhd_str_equal_caseless_n_st ("application/x-www-form-urlencoded",
  ------------------
  |  |  142|      0|        ((mhd_SSTR_LEN (arr) == (l)) \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |  |  Branch (142:10): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|         && mhd_str_equal_caseless_bin_n (arr,str,l))
  |  |  ------------------
  |  |  |  Branch (143:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  239|      0|                                   hdr_cnt_tp.cstr,
  240|      0|                                   hdr_cnt_tp.len))
  241|      0|  {
  242|      0|    c->rq.u_proc.post.enc = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;
  243|      0|    return true;
  244|      0|  }
  245|       |
  246|      0|  if (1)
  ------------------
  |  Branch (246:7): [True: 0, Folded]
  ------------------
  247|      0|  {
  248|      0|    enum mhd_MPartDetectResult res;
  249|       |
  250|      0|    res = process_mpart_header (c,
  251|      0|                                (const struct MHD_String *)(const void *)
  252|      0|                                &hdr_cnt_tp);
  253|       |
  254|      0|    if (mhd_MPART_DET_OK == res)
  ------------------
  |  Branch (254:9): [True: 0, False: 0]
  ------------------
  255|      0|      return true;
  256|       |
  257|      0|    if (mhd_MPART_DET_ERROR_SET == res)
  ------------------
  |  Branch (257:9): [True: 0, False: 0]
  ------------------
  258|      0|      return false;
  259|       |
  260|      0|    mhd_assert (mhd_MPART_DET_NO_MPART == res);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  261|      0|  }
  262|       |
  263|      0|  if (1)
  ------------------
  |  Branch (263:7): [True: 0, Folded]
  ------------------
  264|      0|  {
  265|      0|    static const struct MHD_String txt_tkn = mhd_MSTR_INIT ("text/plain");
  ------------------
  |  |   59|      0|#define mhd_MSTR_INIT(sstr) { mhd_SSTR_LEN (sstr), (sstr)}
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
  266|      0|    struct MHD_String h_cnt_tp_copy;
  267|      0|    mhd_assert (NULL != hdr_cnt_tp.cstr);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  268|      0|    h_cnt_tp_copy.len = hdr_cnt_tp.len;
  269|      0|    h_cnt_tp_copy.cstr = hdr_cnt_tp.cstr;
  270|       |
  271|      0|    if (mhd_str_starts_with_token_opt_param (&h_cnt_tp_copy,
  ------------------
  |  Branch (271:9): [True: 0, False: 0]
  ------------------
  272|      0|                                             &txt_tkn))
  273|      0|    {
  274|      0|      c->rq.u_proc.post.enc = MHD_HTTP_POST_ENCODING_TEXT_PLAIN;
  275|      0|      return true;
  276|      0|    }
  277|      0|  }
  278|      0|  mhd_LOG_MSG (c->daemon, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
  279|      0|               MHD_SC_REQ_POST_PARSE_FAILED_UNKNOWN_CNTN_TYPE, \
  280|      0|               "The request POST data cannot be parsed because " \
  281|      0|               "'Content-Type' header value is unknown or unsupported.");
  282|      0|  c->rq.u_proc.post.parse_result =
  283|      0|    MHD_POST_PARSE_RES_FAILED_UNKNOWN_CNTN_TYPE;
  284|      0|  return false;
  285|      0|}
post_parser_funcs.c:_ZL20process_mpart_headerP14MHD_ConnectionPK10MHD_String:
  110|  2.24k|{
  111|  2.24k|  static const struct MHD_String mpart_token =
  112|  2.24k|    mhd_MSTR_INIT ("multipart/form-data");
  ------------------
  |  |   59|  2.24k|#define mhd_MSTR_INIT(sstr) { mhd_SSTR_LEN (sstr), (sstr)}
  |  |  ------------------
  |  |  |  |   54|  2.24k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
  113|  2.24k|  static const struct MHD_String mpart_bound_par =
  114|  2.24k|    mhd_MSTR_INIT ("boundary");
  ------------------
  |  |   59|  2.24k|#define mhd_MSTR_INIT(sstr) { mhd_SSTR_LEN (sstr), (sstr)}
  |  |  ------------------
  |  |  |  |   54|  2.24k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
  115|  2.24k|  struct mhd_BufferConst mpart_bound;
  116|  2.24k|  bool mpart_bound_quoted;
  117|  2.24k|  enum mhd_StringStartsWithTokenResult res;
  118|  2.24k|  char *buf;
  119|       |
  120|  2.24k|  mhd_assert (NULL != h_cnt_tp->cstr);
  ------------------
  |  |   66|  2.24k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  121|       |
  122|  2.24k|  res = mhd_str_starts_with_token_req_param (h_cnt_tp,
  123|  2.24k|                                             &mpart_token,
  124|  2.24k|                                             &mpart_bound_par,
  125|  2.24k|                                             &mpart_bound,
  126|  2.24k|                                             &mpart_bound_quoted);
  127|       |
  128|  2.24k|  if (mhd_STR_STARTS_W_TOKEN_NO_TOKEN == res)
  ------------------
  |  Branch (128:7): [True: 0, False: 2.24k]
  ------------------
  129|      0|    return mhd_MPART_DET_NO_MPART;
  130|       |
  131|  2.24k|  if (mhd_STR_STARTS_W_TOKEN_HAS_TOKEN_BAD_FORMAT == res)
  ------------------
  |  Branch (131:7): [True: 0, False: 2.24k]
  ------------------
  132|      0|  {
  133|      0|    mhd_LOG_PRINT (c->daemon, \
  ------------------
  |  |   97|      0|#  define mhd_LOG_PRINT mhd_logger
  ------------------
  134|      0|                   MHD_SC_REQ_POST_PARSE_FAILED_HEADER_MISFORMED, \
  135|      0|                   mhd_LOG_FMT ("The request POST data cannot be parsed " \
  ------------------
  |  |  103|      0|#  define mhd_LOG_FMT(format_string) format_string
  ------------------
  136|      0|                                "because 'Content-Type: " \
  137|      0|                                "multipart/form-data' header is " \
  138|      0|                                "misformed: %.*s%s"), \
  139|      0|                   (int)((h_cnt_tp->len <= 127) ? h_cnt_tp->len : 127),
  ------------------
  |  Branch (139:26): [True: 0, False: 0]
  ------------------
  140|      0|                   h_cnt_tp->cstr,
  141|      0|                   (h_cnt_tp->len <= 127) ? "" : "...");
  ------------------
  |  Branch (141:20): [True: 0, False: 0]
  ------------------
  142|      0|    c->rq.u_proc.post.parse_result =
  143|      0|      MHD_POST_PARSE_RES_FAILED_HEADER_MISFORMED;
  144|      0|    return mhd_MPART_DET_ERROR_SET;
  145|      0|  }
  146|       |
  147|  2.24k|  mhd_assert (mhd_STR_STARTS_W_TOKEN_HAS_TOKEN == res);
  ------------------
  |  |   66|  2.24k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  148|       |
  149|  2.24k|  if (0 == mpart_bound.size)
  ------------------
  |  Branch (149:7): [True: 0, False: 2.24k]
  ------------------
  150|      0|  {
  151|      0|    mhd_LOG_MSG (c->daemon, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
  152|      0|                 MHD_SC_REQ_POST_PARSE_FAILED_HEADER_NO_BOUNDARY, \
  153|      0|                 "The request POST data cannot be parsed because " \
  154|      0|                 "'Content-Type: multipart/form-data' header has " \
  155|      0|                 "no 'boundary' parameter value.");
  156|      0|    c->rq.u_proc.post.parse_result =
  157|      0|      MHD_POST_PARSE_RES_FAILED_HEADER_NO_BOUNDARY;
  158|      0|    return mhd_MPART_DET_ERROR_SET;
  159|      0|  }
  160|       |
  161|  2.24k|  mhd_assert (NULL != mpart_bound.data);
  ------------------
  |  |   66|  2.24k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  162|       |
  163|  2.24k|  buf = (char *)
  164|  2.24k|        mhd_stream_alloc_memory (c,
  165|  2.24k|                                 mpart_bound.size + 4);
  166|  2.24k|  if (NULL == buf)
  ------------------
  |  Branch (166:7): [True: 7, False: 2.23k]
  ------------------
  167|      7|  {
  168|       |    /* It is very low probability that pool would not have memory just
  169|       |     * to held the small boundary string. While it could be possible
  170|       |     * to allocate memory from "large buffer", it would over-complicate
  171|       |     * code here and at freeing part. */
  172|      7|    mhd_LOG_MSG (c->daemon, MHD_SC_REQ_POST_PARSE_FAILED_NO_POOL_MEM, \
  ------------------
  |  |   80|      7|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
  173|      7|                 "The request POST data cannot be parsed because " \
  174|      7|                 "there is not enough pool memory.");
  175|      7|    c->rq.u_proc.post.parse_result = MHD_POST_PARSE_RES_FAILED_NO_POOL_MEM;
  176|      7|    return mhd_MPART_DET_ERROR_SET;
  177|      7|  }
  178|       |
  179|  2.23k|  c->rq.u_proc.post.enc = MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA;
  180|       |
  181|  2.23k|  buf[0] = '\r';
  182|  2.23k|  buf[1] = '\n';
  183|  2.23k|  buf[2] = '-';
  184|  2.23k|  buf[3] = '-';
  185|       |
  186|  2.23k|  if (!mpart_bound_quoted)
  ------------------
  |  Branch (186:7): [True: 2.23k, False: 0]
  ------------------
  187|  2.23k|  {
  188|  2.23k|    memcpy (buf + 4,
  189|  2.23k|            mpart_bound.data,
  190|  2.23k|            mpart_bound.size);
  191|  2.23k|    c->rq.u_proc.post.e_d.m_form.delim.data = buf;
  192|  2.23k|    c->rq.u_proc.post.e_d.m_form.delim.size = mpart_bound.size + 4;
  193|  2.23k|  }
  194|      0|  else
  195|      0|  {
  196|      0|    size_t unq_size;
  197|      0|    mhd_assert (2 <= mpart_bound.size); /* At least one char and at least one '\' */
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  198|       |
  199|      0|    unq_size = mhd_str_unquote (mpart_bound.data,
  200|      0|                                mpart_bound.size,
  201|      0|                                buf + 4);
  202|      0|    c->rq.u_proc.post.e_d.m_form.delim.data = buf;
  203|      0|    c->rq.u_proc.post.e_d.m_form.delim.size = unq_size + 4;
  204|      0|  }
  205|  2.23k|  mhd_assert (4 < c->rq.u_proc.post.e_d.m_form.delim.size);
  ------------------
  |  |   66|  2.23k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  206|  2.23k|  return mhd_MPART_DET_OK;
  207|  2.24k|}
post_parser_funcs.c:_ZL37detect_mpart_boundary_from_the_headerP14MHD_Connection:
  296|  2.41k|{
  297|  2.41k|  struct MHD_StringNullable hdr_cnt_tp;
  298|  2.41k|  enum mhd_MPartDetectResult res;
  299|       |
  300|  2.41k|  mhd_assert (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA == \
  ------------------
  |  |   66|  2.41k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  301|  2.41k|              c->rq.app_act.head_act.data.post_parse.enc);
  302|       |
  303|  2.41k|  if (!mhd_request_get_value_st (&(c->rq),
  ------------------
  |  |  101|  2.41k|          mhd_request_get_value_n ((r),(k),mhd_SSTR_LEN (str),(str),(v_out))
  |  |  ------------------
  |  |  |  |   54|  2.41k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
  |  Branch (303:7): [True: 164, False: 2.24k]
  ------------------
  304|  2.41k|                                 MHD_VK_HEADER,
  305|  2.41k|                                 MHD_HTTP_HEADER_CONTENT_TYPE,
  306|  2.41k|                                 &hdr_cnt_tp))
  307|    164|  {
  308|    164|    mhd_LOG_MSG (c->daemon, MHD_SC_REQ_POST_PARSE_FAILED_NO_CNTN_TYPE, \
  ------------------
  |  |   80|    164|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
  309|    164|                 "The request POST data cannot be parsed because " \
  310|    164|                 "'multipart/form-data' requires 'boundary' parameter, but " \
  311|    164|                 "the request has no 'Content-Type:' header.");
  312|    164|    c->rq.u_proc.post.parse_result = MHD_POST_PARSE_RES_FAILED_NO_CNTN_TYPE;
  313|    164|    return false;
  314|    164|  }
  315|       |
  316|  2.24k|  mhd_assert (NULL != hdr_cnt_tp.cstr);
  ------------------
  |  |   66|  2.24k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  317|       |
  318|  2.24k|  res = process_mpart_header (c,
  319|  2.24k|                              (const struct MHD_String *)(const void *)
  320|  2.24k|                              &hdr_cnt_tp);
  321|       |
  322|  2.24k|  if (mhd_MPART_DET_OK == res)
  ------------------
  |  Branch (322:7): [True: 2.23k, False: 7]
  ------------------
  323|  2.23k|    return true;
  324|       |
  325|      7|  if (mhd_MPART_DET_NO_MPART == res)
  ------------------
  |  Branch (325:7): [True: 0, False: 7]
  ------------------
  326|      0|  {
  327|      0|    mhd_LOG_MSG (c->daemon, MHD_SC_REQ_POST_PARSE_FAILED_HEADER_NOT_MPART, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
  328|      0|                 "The request POST data cannot be parsed because " \
  329|      0|                 "'multipart/form-data' requires 'boundary' parameter, but " \
  330|      0|                 "the request has no 'Content-Type: multipart/form-data' " \
  331|      0|                 "header.");
  332|      0|    c->rq.u_proc.post.parse_result = MHD_POST_PARSE_RES_FAILED_HEADER_NOT_MPART;
  333|      0|    return false;
  334|      0|  }
  335|       |
  336|      7|  mhd_assert (mhd_MPART_DET_ERROR_SET == res);
  ------------------
  |  |   66|      7|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  337|      7|  return false;
  338|      7|}
post_parser_funcs.c:_ZL20init_post_parse_dataP14MHD_Connection:
  415|  4.50k|{
  416|  4.50k|  struct mhd_PostParserData *const pdata =
  417|  4.50k|    &(c->rq.u_proc.post);
  418|       |
  419|  4.50k|  mhd_assert (mhd_ACTION_POST_PARSE == c->rq.app_act.head_act.act);
  ------------------
  |  |   66|  4.50k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  420|  4.50k|  mhd_assert (MHD_HTTP_POST_ENCODING_OTHER != \
  ------------------
  |  |   66|  4.50k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  421|  4.50k|              c->rq.u_proc.post.enc);
  422|  4.50k|  mhd_assert (0 == pdata->lbuf_used);
  ------------------
  |  |   66|  4.50k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  423|       |
  424|  4.50k|  pdata->lbuf_limit = c->rq.app_act.head_act.data.post_parse.buffer_size;
  425|       |
  426|  4.50k|  switch (pdata->enc)
  427|  4.50k|  {
  428|    514|  case MHD_HTTP_POST_ENCODING_FORM_URLENCODED:
  ------------------
  |  Branch (428:3): [True: 514, False: 3.98k]
  ------------------
  429|    514|    reset_parse_field_data_urlenc (pdata);
  430|    514|    break;
  431|  2.23k|  case MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA:
  ------------------
  |  Branch (431:3): [True: 2.23k, False: 2.26k]
  ------------------
  432|  2.23k|    reset_parse_field_data_mpart_init (pdata);
  433|  2.23k|    break;
  434|  1.74k|  case MHD_HTTP_POST_ENCODING_TEXT_PLAIN:
  ------------------
  |  Branch (434:3): [True: 1.74k, False: 2.75k]
  ------------------
  435|  1.74k|    reset_parse_field_data_text (pdata);
  436|  1.74k|    break;
  437|      0|  case MHD_HTTP_POST_ENCODING_OTHER:
  ------------------
  |  Branch (437:3): [True: 0, False: 4.50k]
  ------------------
  438|      0|  default:
  ------------------
  |  Branch (438:3): [True: 0, False: 4.50k]
  ------------------
  439|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
  440|      0|    break;
  441|  4.50k|  }
  442|  4.50k|}
post_parser_funcs.c:_ZL29reset_parse_field_data_urlencP18mhd_PostParserData:
  347|  3.58k|{
  348|  3.58k|  mhd_assert (MHD_HTTP_POST_ENCODING_FORM_URLENCODED == pdata->enc);
  ------------------
  |  |   66|  3.58k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  349|  3.58k|  memset (&(pdata->e_d.u_enc), 0, sizeof(pdata->e_d.u_enc));
  350|  3.58k|  pdata->field_start = 0;
  351|  3.58k|}
post_parser_funcs.c:_ZL33reset_parse_field_data_mpart_initP18mhd_PostParserData:
  360|  2.23k|{
  361|  2.23k|  mhd_assert (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA == pdata->enc);
  ------------------
  |  |   66|  2.23k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  362|  2.23k|  memset (&(pdata->e_d.m_form.f), 0, sizeof(pdata->e_d.m_form.f));
  363|  2.23k|  pdata->e_d.m_form.st = mhd_POST_MPART_ST_NOT_STARTED;
  364|  2.23k|  pdata->e_d.m_form.line_start = mhd_POST_INVALID_POS;
  ------------------
  |  |   58|  2.23k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
  365|  2.23k|  pdata->e_d.m_form.delim_check_start = mhd_POST_INVALID_POS;
  ------------------
  |  |   58|  2.23k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
  366|  2.23k|  mhd_assert (NULL != pdata->e_d.m_form.delim.data);
  ------------------
  |  |   66|  2.23k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  367|  2.23k|  mhd_assert (4 < pdata->e_d.m_form.delim.size);
  ------------------
  |  |   66|  2.23k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  368|  2.23k|  mhd_assert (0 == memcmp (pdata->e_d.m_form.delim.data, "\r\n--", 4));
  ------------------
  |  |   66|  2.23k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  369|  2.23k|  mhd_assert (NULL == memchr (pdata->e_d.m_form.delim.data + 4, '\r', \
  ------------------
  |  |   66|  2.23k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  370|  2.23k|                              pdata->e_d.m_form.delim.size - 4));
  371|  2.23k|  mhd_assert (NULL == memchr (pdata->e_d.m_form.delim.data + 4, '\n', \
  ------------------
  |  |   66|  2.23k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  372|  2.23k|                              pdata->e_d.m_form.delim.size - 4));
  373|  2.23k|  pdata->field_start = 0;
  374|  2.23k|}
post_parser_funcs.c:_ZL27reset_parse_field_data_textP18mhd_PostParserData:
  402|  12.9k|{
  403|  12.9k|  mhd_assert (MHD_HTTP_POST_ENCODING_TEXT_PLAIN == pdata->enc);
  ------------------
  |  |   66|  12.9k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  404|  12.9k|  memset (&(pdata->e_d.text), 0, sizeof(pdata->e_d.text));
  405|  12.9k|  pdata->field_start = 0;
  406|  12.9k|}
post_parser_funcs.c:_ZL17extend_lbuf_up_toP14MHD_ConnectionmP10mhd_Buffer:
  559|  1.57k|{
  560|  1.57k|  mhd_assert (mhd_ACTION_POST_PARSE == c->rq.app_act.head_act.act);
  ------------------
  |  |   66|  1.57k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  561|  1.57k|  mhd_assert (c->rq.u_proc.post.lbuf_limit >= buf->size);
  ------------------
  |  |   66|  1.57k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  562|       |
  563|  1.57k|  if (buf->size + desired_grow_size > c->rq.u_proc.post.lbuf_limit)
  ------------------
  |  Branch (563:7): [True: 903, False: 676]
  ------------------
  564|    903|    desired_grow_size = c->rq.u_proc.post.lbuf_limit - buf->size;
  565|       |
  566|  1.57k|  if (0 == desired_grow_size)
  ------------------
  |  Branch (566:7): [True: 114, False: 1.46k]
  ------------------
  567|    114|    return 0;
  568|       |
  569|  1.46k|  return mhd_daemon_extend_lbuf_up_to (c->daemon,
  570|  1.46k|                                       desired_grow_size,
  571|  1.46k|                                       buf);
  572|  1.57k|}
post_parser_funcs.c:_ZL17parse_post_urlencP14MHD_ConnectionPmPc:
 1197|    338|{
 1198|    338|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 1199|    338|  struct mhd_PostParserUrlEncData *const uf = &(p_data->e_d.u_enc); /**< the current "url-enc" field */
 1200|    338|  size_t i;
 1201|       |
 1202|    338|  mhd_assert (MHD_HTTP_POST_ENCODING_FORM_URLENCODED == c->rq.u_proc.post.enc);
  ------------------
  |  |   66|    338|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1203|    338|  mhd_assert (MHD_POST_PARSE_RES_OK == p_data->parse_result);
  ------------------
  |  |   66|    338|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1204|    338|  mhd_assert (!c->discard_request);
  ------------------
  |  |   66|    338|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1205|    338|  mhd_assert (p_data->next_parse_pos < *pdata_size);
  ------------------
  |  |   66|    338|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1206|       |
 1207|    338|  if ((mhd_POST_UENC_ST_VALUE == uf->st)
  ------------------
  |  Branch (1207:7): [True: 0, False: 338]
  ------------------
 1208|      0|      && (0 != uf->value_len))
  ------------------
  |  Branch (1208:10): [True: 0, False: 0]
  ------------------
 1209|      0|  {
 1210|       |    /* The 'value' was partially decoded, but not processed because application
 1211|       |     * asked for 'suspend' action */
 1212|      0|    mhd_assert (NULL != c->rq.app_act.head_act.data.post_parse.stream_reader);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1213|      0|    if (process_partial_value (c,
  ------------------
  |  Branch (1213:9): [True: 0, False: 0]
  ------------------
 1214|      0|                               buf,
 1215|      0|                               &p_data->next_parse_pos,
 1216|      0|                               pdata_size,
 1217|      0|                               uf->name_idx,
 1218|      0|                               uf->name_len,
 1219|      0|                               uf->value_idx,
 1220|      0|                               uf->value_len))
 1221|      0|      return true;
 1222|      0|    uf->value_len = 0;
 1223|      0|  }
 1224|       |
 1225|    338|  i = p_data->next_parse_pos;
 1226|  10.2k|  while (*pdata_size > i)
  ------------------
  |  Branch (1226:10): [True: 9.91k, False: 325]
  ------------------
 1227|  9.91k|  {
 1228|  9.91k|    switch (uf->st)
 1229|  9.91k|    {
 1230|  3.39k|    case mhd_POST_UENC_ST_NOT_STARTED:
  ------------------
  |  Branch (1230:5): [True: 3.39k, False: 6.52k]
  ------------------
 1231|  3.39k|      mhd_assert (0 == p_data->field_start);
  ------------------
  |  |   66|  3.39k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1232|  3.39k|      mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|  3.39k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1233|  3.39k|      p_data->field_start = i;
 1234|  3.39k|      uf->name_idx = i;
 1235|  3.39k|      uf->last_pct_idx = mhd_POST_INVALID_POS;
  ------------------
  |  |   58|  3.39k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
 1236|  3.39k|      uf->st = mhd_POST_UENC_ST_NAME;
 1237|  3.39k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  3.39k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1238|       |    /* Intentional fallthrough */
 1239|  3.39k|    case mhd_POST_UENC_ST_NAME:
  ------------------
  |  Branch (1239:5): [True: 0, False: 9.91k]
  ------------------
 1240|  3.39k|      do /* Fast local loop */
 1241|  61.7k|      {
 1242|  61.7k|        if ('+' == buf[i])
  ------------------
  |  Branch (1242:13): [True: 413, False: 61.3k]
  ------------------
 1243|    413|          buf[i] = ' ';
 1244|  61.3k|        else if ('%' == buf[i])
  ------------------
  |  Branch (1244:18): [True: 2.22k, False: 59.1k]
  ------------------
 1245|  2.22k|          uf->last_pct_idx = i;
 1246|  59.1k|        else if ('=' == buf[i])
  ------------------
  |  Branch (1246:18): [True: 1.72k, False: 57.4k]
  ------------------
 1247|  1.72k|        {
 1248|  1.72k|          uf->st = mhd_POST_UENC_ST_AT_EQ;
 1249|  1.72k|          break;
 1250|  1.72k|        }
 1251|  57.4k|        else if ('&' == buf[i])
  ------------------
  |  Branch (1251:18): [True: 1.54k, False: 55.8k]
  ------------------
 1252|  1.54k|        {
 1253|  1.54k|          uf->st = mhd_POST_UENC_ST_AT_AMPRSND;
 1254|  1.54k|          break;
 1255|  1.54k|        }
 1256|  61.7k|      } while (*pdata_size > ++i);
  ------------------
  |  Branch (1256:16): [True: 58.3k, False: 130]
  ------------------
 1257|  3.39k|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|  3.39k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1258|  3.39k|                  || (mhd_POST_UENC_ST_AT_EQ == uf->st) \
 1259|  3.39k|                  || (mhd_POST_UENC_ST_AT_AMPRSND == uf->st));
 1260|  3.39k|      continue;
 1261|  1.72k|    case mhd_POST_UENC_ST_AT_EQ:
  ------------------
  |  Branch (1261:5): [True: 1.72k, False: 8.19k]
  ------------------
 1262|  1.72k|      mhd_assert (i > uf->name_idx);
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1263|  1.72k|      mhd_assert (0 == uf->name_len);
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1264|  1.72k|      mhd_assert (uf->last_pct_idx >= p_data->field_start);
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1265|  1.72k|      mhd_assert (uf->last_pct_idx >= uf->name_idx);
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1266|  1.72k|      mhd_assert ((uf->last_pct_idx == mhd_POST_INVALID_POS) \
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1267|  1.72k|                  || (uf->last_pct_idx < i));
 1268|  1.72k|      mhd_assert (0 == uf->value_len);
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1269|  1.72k|      if (uf->last_pct_idx != mhd_POST_INVALID_POS)
  ------------------
  |  |   58|  1.72k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
  |  Branch (1269:11): [True: 492, False: 1.23k]
  ------------------
 1270|    492|        uf->name_len = mhd_str_pct_decode_lenient_n (buf + uf->name_idx,
 1271|    492|                                                     i - uf->name_idx,
 1272|    492|                                                     buf + uf->name_idx,
 1273|    492|                                                     i - uf->name_idx,
 1274|    492|                                                     NULL);
 1275|  1.23k|      else
 1276|  1.23k|        uf->name_len = i - uf->name_idx;
 1277|  1.72k|      buf[uf->name_idx + uf->name_len] = 0; /* Zero-terminate the name */
 1278|       |
 1279|  1.72k|      uf->st = mhd_POST_UENC_ST_EQ_FOUND;
 1280|  1.72k|      ++i; /* Process the next char */
 1281|  1.72k|      continue; /* Check whether the next char is available */
 1282|  1.72k|    case mhd_POST_UENC_ST_EQ_FOUND:
  ------------------
  |  Branch (1282:5): [True: 1.72k, False: 8.19k]
  ------------------
 1283|  1.72k|      mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1284|  1.72k|      mhd_assert (0 == uf->value_idx);
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1285|  1.72k|      mhd_assert (0 == uf->value_len);
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1286|  1.72k|      mhd_assert (0 != i && "the 'value' should follow the 'name'");
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1287|  1.72k|      uf->last_pct_idx = mhd_POST_INVALID_POS;
  ------------------
  |  |   58|  1.72k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
 1288|  1.72k|      uf->value_idx = i;
 1289|  1.72k|      uf->st = mhd_POST_UENC_ST_VALUE;
 1290|  1.72k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  1.72k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1291|       |    /* Intentional fallthrough */
 1292|  1.72k|    case mhd_POST_UENC_ST_VALUE:
  ------------------
  |  Branch (1292:5): [True: 0, False: 9.91k]
  ------------------
 1293|  1.72k|      do /* Fast local loop */
 1294|   253k|      {
 1295|   253k|        if ('+' == buf[i])
  ------------------
  |  Branch (1295:13): [True: 591, False: 252k]
  ------------------
 1296|    591|          buf[i] = ' ';
 1297|   252k|        else if ('%' == buf[i])
  ------------------
  |  Branch (1297:18): [True: 4.10k, False: 248k]
  ------------------
 1298|  4.10k|          uf->last_pct_idx = i;
 1299|   248k|        else if ('&' == buf[i])
  ------------------
  |  Branch (1299:18): [True: 1.53k, False: 247k]
  ------------------
 1300|  1.53k|        {
 1301|  1.53k|          uf->st = mhd_POST_UENC_ST_AT_AMPRSND;
 1302|  1.53k|          break;
 1303|  1.53k|        }
 1304|   253k|      } while (*pdata_size > ++i);
  ------------------
  |  Branch (1304:16): [True: 251k, False: 192]
  ------------------
 1305|  1.72k|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|  1.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1306|  1.72k|                  || (mhd_POST_UENC_ST_AT_AMPRSND == uf->st));
 1307|  1.72k|      continue;
 1308|  3.07k|    case mhd_POST_UENC_ST_AT_AMPRSND:
  ------------------
  |  Branch (1308:5): [True: 3.07k, False: 6.84k]
  ------------------
 1309|  3.07k|      mhd_assert (0 == uf->value_len);
  ------------------
  |  |   66|  3.07k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1310|  3.07k|      mhd_assert ((uf->last_pct_idx == mhd_POST_INVALID_POS) \
  ------------------
  |  |   66|  3.07k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1311|  3.07k|                  || (uf->last_pct_idx < i));
 1312|  3.07k|      mhd_assert ((uf->last_pct_idx == mhd_POST_INVALID_POS) \
  ------------------
  |  |   66|  3.07k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1313|  3.07k|                  || ((uf->name_idx + uf->name_len) < i));
 1314|  3.07k|      if (0 != uf->value_idx)
  ------------------
  |  Branch (1314:11): [True: 1.53k, False: 1.54k]
  ------------------
 1315|  1.53k|      {
 1316|       |        /* Have 'name' and 'value' */
 1317|  1.53k|        if (uf->last_pct_idx != mhd_POST_INVALID_POS)
  ------------------
  |  |   58|  1.53k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
  |  Branch (1317:13): [True: 532, False: 998]
  ------------------
 1318|    532|          uf->value_len = mhd_str_pct_decode_lenient_n (buf + uf->value_idx,
 1319|    532|                                                        i - uf->value_idx,
 1320|    532|                                                        buf + uf->value_idx,
 1321|    532|                                                        i - uf->value_idx,
 1322|    532|                                                        NULL);
 1323|    998|        else
 1324|    998|          uf->value_len = i - uf->value_idx;
 1325|  1.53k|        buf[uf->value_idx + uf->value_len] = 0; /* Zero-terminate the value */
 1326|  1.53k|      }
 1327|  1.54k|      else
 1328|  1.54k|      {
 1329|       |        /* Have 'name' only (without any 'value') */
 1330|  1.54k|        if (uf->last_pct_idx != mhd_POST_INVALID_POS)
  ------------------
  |  |   58|  1.54k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
  |  Branch (1330:13): [True: 790, False: 755]
  ------------------
 1331|    790|          uf->name_len = mhd_str_pct_decode_lenient_n (buf + uf->name_idx,
 1332|    790|                                                       i - uf->name_idx,
 1333|    790|                                                       buf + uf->name_idx,
 1334|    790|                                                       i - uf->name_idx,
 1335|    790|                                                       NULL);
 1336|    755|        else
 1337|    755|          uf->name_len = i - uf->name_idx;
 1338|  1.54k|        buf[uf->name_idx + uf->name_len] = 0; /* Zero-terminate the name */
 1339|  1.54k|      }
 1340|  3.07k|      uf->st = mhd_POST_UENC_ST_FULL_FIELD_FOUND;
 1341|  3.07k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  3.07k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1342|       |    /* Intentional fallthrough */
 1343|  3.07k|    case mhd_POST_UENC_ST_FULL_FIELD_FOUND:
  ------------------
  |  Branch (1343:5): [True: 0, False: 9.91k]
  ------------------
 1344|  3.07k|      ++i; /* Consume current character,
 1345|       |              advance to the next char to be checked */
 1346|  3.07k|      if (process_complete_field (c,
  ------------------
  |  Branch (1346:11): [True: 13, False: 3.06k]
  ------------------
 1347|  3.07k|                                  buf,
 1348|  3.07k|                                  &i,
 1349|  3.07k|                                  pdata_size,
 1350|  3.07k|                                  p_data->field_start,
 1351|  3.07k|                                  uf->name_idx,
 1352|  3.07k|                                  uf->name_len,
 1353|  3.07k|                                  uf->value_idx,
 1354|  3.07k|                                  uf->value_len))
 1355|     13|      {
 1356|     13|        if (c->suspended)
  ------------------
  |  Branch (1356:13): [True: 0, False: 13]
  ------------------
 1357|      0|          --i; /* Go back to the same position */
 1358|     13|        else
 1359|     13|          reset_parse_field_data_urlenc (p_data);
 1360|     13|        p_data->next_parse_pos = i;
 1361|     13|        return true;
 1362|     13|      }
 1363|  3.06k|      mhd_assert (*pdata_size >= i);
  ------------------
  |  |   66|  3.06k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1364|  3.06k|      reset_parse_field_data_urlenc (p_data);
 1365|  3.06k|      continue; /* Process the next char */
 1366|      0|    default:
  ------------------
  |  Branch (1366:5): [True: 0, False: 9.91k]
  ------------------
 1367|      0|      mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 1368|      0|      break;
 1369|  9.91k|    }
 1370|      0|    mhd_assert (0 && "Should be unreachable");
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1371|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 1372|      0|    break;
 1373|  9.91k|  }
 1374|       |
 1375|    325|  mhd_assert (*pdata_size == i);
  ------------------
  |  |   66|    325|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1376|       |
 1377|    325|  mhd_assert (mhd_POST_UENC_ST_AT_EQ != uf->st);
  ------------------
  |  |   66|    325|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1378|    325|  mhd_assert (mhd_POST_UENC_ST_AT_AMPRSND != uf->st);
  ------------------
  |  |   66|    325|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1379|    325|  mhd_assert (mhd_POST_UENC_ST_FULL_FIELD_FOUND != uf->st);
  ------------------
  |  |   66|    325|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1380|    325|  mhd_assert ((mhd_POST_UENC_ST_VALUE != uf->st) \
  ------------------
  |  |   66|    325|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1381|    325|              || (0 == uf->value_len));
 1382|       |
 1383|    325|  mhd_assert (*pdata_size == i);
  ------------------
  |  |   66|    325|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1384|       |
 1385|    325|  if ((mhd_POST_UENC_ST_VALUE == uf->st)
  ------------------
  |  Branch (1385:7): [True: 192, False: 133]
  ------------------
 1386|    192|      && (i != uf->value_idx) /* Encoded value position must be larger then zero */
  ------------------
  |  Branch (1386:10): [True: 192, False: 0]
  ------------------
 1387|    192|      && is_value_streaming_needed (c, i - p_data->field_start))
  ------------------
  |  Branch (1387:10): [True: 91, False: 101]
  ------------------
 1388|     91|  {
 1389|     91|    size_t len_of_value_part;
 1390|     91|    if (uf->last_pct_idx != mhd_POST_INVALID_POS)
  ------------------
  |  |   58|     91|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
  |  Branch (1390:9): [True: 76, False: 15]
  ------------------
 1391|     76|    {
 1392|     76|      mhd_assert (uf->last_pct_idx < i);
  ------------------
  |  |   66|     76|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1393|     76|      mhd_assert (uf->last_pct_idx >= uf->value_idx);
  ------------------
  |  |   66|     76|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1394|       |
 1395|     76|      if (2 >= (i - uf->last_pct_idx))
  ------------------
  |  Branch (1395:11): [True: 19, False: 57]
  ------------------
 1396|     19|        i = uf->last_pct_idx;  /* The last percent-encoded character is incomplete */
 1397|       |
 1398|     76|      len_of_value_part =
 1399|     76|        mhd_str_pct_decode_lenient_n (buf + uf->value_idx,
 1400|     76|                                      i - uf->value_idx,
 1401|     76|                                      buf + uf->value_idx,
 1402|     76|                                      i - uf->value_idx,
 1403|     76|                                      NULL);
 1404|     76|    }
 1405|     15|    else
 1406|     15|      len_of_value_part = i - uf->value_idx;
 1407|       |
 1408|     91|    if (0 != len_of_value_part)
  ------------------
  |  Branch (1408:9): [True: 89, False: 2]
  ------------------
 1409|     89|    {
 1410|     89|      bool proc_res;
 1411|       |
 1412|     89|      proc_res =
 1413|     89|        process_partial_value (c,
 1414|     89|                               buf,
 1415|     89|                               &i,
 1416|     89|                               pdata_size,
 1417|     89|                               uf->name_idx,
 1418|     89|                               uf->name_len,
 1419|     89|                               uf->value_idx,
 1420|     89|                               len_of_value_part);
 1421|       |
 1422|       |      /* Reset position of last '%' char: it was already decoded or
 1423|       |       * 'i' points to it and it will be processed again next time */
 1424|     89|      uf->last_pct_idx = mhd_POST_INVALID_POS;
  ------------------
  |  |   58|     89|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
 1425|       |
 1426|     89|      if (proc_res)
  ------------------
  |  Branch (1426:11): [True: 89, False: 0]
  ------------------
 1427|     89|      {
 1428|     89|        if (c->suspended)
  ------------------
  |  Branch (1428:13): [True: 0, False: 89]
  ------------------
 1429|      0|          uf->value_len = len_of_value_part; /* Indicate that value has been
 1430|       |                                                partially decoded and needs
 1431|       |                                                to be "streamed" again */
 1432|     89|        p_data->next_parse_pos = i;
 1433|     89|        return true;
 1434|     89|      }
 1435|     89|    }
 1436|     91|  }
 1437|       |
 1438|    236|  p_data->next_parse_pos = i;
 1439|    236|  return false; /* Continue parsing */
 1440|    325|}
post_parser_funcs.c:_ZL21process_partial_valueP14MHD_ConnectionPcPmS2_mmmm:
 1159|    103|{
 1160|    103|  mhd_assert (mhd_HTTP_STAGE_REQ_RECV_FINISHED >= c->stage);
  ------------------
  |  |   66|    103|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1161|    103|  mhd_assert (part_value_start + part_value_len <= *pnext_pos);
  ------------------
  |  |   66|    103|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1162|    103|  mhd_assert (name_start + name_len < part_value_start);
  ------------------
  |  |   66|    103|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1163|    103|  mhd_assert (0 != part_value_start);
  ------------------
  |  |   66|    103|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1164|    103|  mhd_assert (0 != part_value_len);
  ------------------
  |  |   66|    103|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1165|    103|  mhd_assert (name_start + name_len < *pnext_pos);
  ------------------
  |  |   66|    103|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1166|       |
 1167|       |
 1168|    103|  mhd_assert (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA != \
  ------------------
  |  |   66|    103|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1169|    103|              c->rq.u_proc.post.enc);
 1170|       |
 1171|    103|  return process_partial_value_all (c,
 1172|    103|                                    buf,
 1173|    103|                                    pnext_pos,
 1174|    103|                                    pdata_size,
 1175|    103|                                    name_start,
 1176|    103|                                    name_len,
 1177|    103|                                    0, 0, 0, 0, 0, 0,
 1178|    103|                                    part_value_start,
 1179|    103|                                    part_value_len);
 1180|    103|}
post_parser_funcs.c:_ZL25process_partial_value_allP14MHD_ConnectionPcPmS2_mmmmmmmmmm:
 1048|    193|{
 1049|    193|  struct mhd_PostParseActionData *const p_par =
 1050|    193|    &(c->rq.app_act.head_act.data.post_parse);
 1051|    193|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 1052|    193|  struct MHD_String name;
 1053|    193|  struct MHD_StringNullable filename;
 1054|    193|  struct MHD_StringNullable content_type;
 1055|    193|  struct MHD_StringNullable encoding;
 1056|    193|  const struct MHD_UploadAction *act;
 1057|    193|  bool res;
 1058|       |
 1059|    193|  mhd_assert (mhd_HTTP_STAGE_REQ_RECV_FINISHED >= c->stage);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1060|    193|  mhd_assert (*pnext_pos <= *pdata_size);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1061|    193|  mhd_assert (part_value_start + part_value_len <= *pnext_pos);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1062|    193|  mhd_assert (0 != part_value_start);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1063|    193|  mhd_assert (0 != part_value_len);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1064|    193|  mhd_assert (name_start + name_len < *pnext_pos);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1065|    193|  mhd_assert (filename_start + filename_len < part_value_start);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1066|    193|  mhd_assert (filename_start + filename_len < *pnext_pos);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1067|    193|  mhd_assert (cntn_type_start + cntn_type_len < part_value_start);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1068|    193|  mhd_assert (cntn_type_start + cntn_type_len < *pnext_pos);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1069|    193|  mhd_assert (enc_start + enc_len < part_value_start);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1070|    193|  mhd_assert (enc_start + enc_len < *pnext_pos);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1071|    193|  mhd_assert ((0 != filename_start) || (0 == filename_len));
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1072|    193|  mhd_assert ((0 != cntn_type_start) || (0 == cntn_type_len));
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1073|    193|  mhd_assert ((0 != enc_start) || (0 == enc_len));
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1074|    193|  mhd_assert (NULL != p_par->stream_reader);
  ------------------
  |  |   66|    193|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1075|       |
 1076|    193|  make_post_strings_from_buf_and_indices (buf,
 1077|    193|                                          name_start,
 1078|    193|                                          name_len,
 1079|    193|                                          filename_start,
 1080|    193|                                          filename_len,
 1081|    193|                                          cntn_type_start,
 1082|    193|                                          cntn_type_len,
 1083|    193|                                          enc_start,
 1084|    193|                                          enc_len,
 1085|    193|                                          &name,
 1086|    193|                                          &filename,
 1087|    193|                                          &content_type,
 1088|    193|                                          &encoding);
 1089|       |
 1090|    193|  act = p_par->stream_reader (&(c->rq),
 1091|    193|                              p_par->reader_cls,
 1092|    193|                              &name,
 1093|    193|                              &filename,
 1094|    193|                              &content_type,
 1095|    193|                              &encoding,
 1096|    193|                              part_value_len,
 1097|    193|                              buf + part_value_start,
 1098|    193|                              p_data->value_off,
 1099|    193|                              MHD_NO);
 1100|       |
 1101|    193|  p_data->some_data_provided = true;
 1102|    193|  p_data->force_streamed = true;
 1103|       |
 1104|    193|  res = mhd_stream_process_upload_action (c, act, false);
 1105|    193|  if (c->suspended)
  ------------------
  |  Branch (1105:7): [True: 0, False: 193]
  ------------------
 1106|      0|    return true;
 1107|       |
 1108|    193|  p_data->value_off += part_value_len;
 1109|    193|  if (*pdata_size > *pnext_pos)
  ------------------
  |  Branch (1109:7): [True: 38, False: 155]
  ------------------
 1110|     38|  {
 1111|     38|    size_t consumed_size;
 1112|       |
 1113|     38|    memmove (buf + part_value_start,
 1114|     38|             buf + *pnext_pos,
 1115|     38|             *pdata_size - *pnext_pos);
 1116|     38|    consumed_size = *pnext_pos - part_value_start;
 1117|     38|    *pnext_pos = part_value_start;
 1118|     38|    *pdata_size -= consumed_size;
 1119|     38|  }
 1120|    155|  else
 1121|    155|  {
 1122|    155|    mhd_assert (*pdata_size == *pnext_pos);
  ------------------
  |  |   66|    155|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1123|    155|    *pnext_pos = part_value_start;
 1124|    155|    *pdata_size = part_value_start;
 1125|    155|  }
 1126|    193|  return res;
 1127|    193|}
post_parser_funcs.c:_ZL38make_post_strings_from_buf_and_indicesPKcmmmmmmmmP10MHD_StringP18MHD_StringNullableS4_S4_:
  715|    392|{
  716|    392|  name->len = name_len;
  717|    392|  name->cstr = buf + name_start;
  718|       |
  719|    392|  if (0 != filename_start)
  ------------------
  |  Branch (719:7): [True: 154, False: 238]
  ------------------
  720|    154|  {
  721|    154|    filename->len = filename_len;
  722|    154|    filename->cstr = buf + filename_start;
  723|    154|  }
  724|    238|  else
  725|    238|  {
  726|    238|    filename->len = 0;
  727|    238|    filename->cstr = NULL;
  728|    238|  }
  729|    392|  if (0 != cntn_type_start)
  ------------------
  |  Branch (729:7): [True: 0, False: 392]
  ------------------
  730|      0|  {
  731|      0|    content_type->len = cntn_type_len;
  732|      0|    content_type->cstr = buf + cntn_type_start;
  733|      0|  }
  734|    392|  else
  735|    392|  {
  736|    392|    content_type->len = 0;
  737|    392|    content_type->cstr = NULL;
  738|    392|  }
  739|    392|  if (0 != enc_start)
  ------------------
  |  Branch (739:7): [True: 0, False: 392]
  ------------------
  740|      0|  {
  741|      0|    encoding->len = enc_len;
  742|      0|    encoding->cstr = buf + enc_start;
  743|      0|  }
  744|    392|  else
  745|    392|  {
  746|    392|    encoding->len = 0;
  747|       |    encoding->cstr = NULL;
  748|    392|  }
  749|    392|}
post_parser_funcs.c:_ZL22process_complete_fieldP14MHD_ConnectionPcPmS2_mmmmm:
  973|  9.93k|{
  974|  9.93k|  mhd_assert (mhd_HTTP_STAGE_REQ_RECV_FINISHED >= c->stage);
  ------------------
  |  |   66|  9.93k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  975|  9.93k|  mhd_assert (value_start + value_len <= *pfield_next_pos);
  ------------------
  |  |   66|  9.93k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  976|  9.93k|  mhd_assert ((mhd_HTTP_STAGE_FULL_REQ_RECEIVED <= c->stage) \
  ------------------
  |  |   66|  9.93k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  977|  9.93k|              || (value_start + value_len < *pfield_next_pos));
  978|  9.93k|  mhd_assert ((name_start + name_len < value_start) \
  ------------------
  |  |   66|  9.93k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  979|  9.93k|              || (0 == value_start));
  980|  9.93k|  mhd_assert (name_start + name_len <= *pfield_next_pos);
  ------------------
  |  |   66|  9.93k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  981|  9.93k|  mhd_assert ((mhd_HTTP_STAGE_FULL_REQ_RECEIVED <= c->stage) \
  ------------------
  |  |   66|  9.93k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  982|  9.93k|              || (name_start + name_len < *pfield_next_pos));
  983|  9.93k|  mhd_assert (field_start <= name_start);
  ------------------
  |  |   66|  9.93k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  984|  9.93k|  mhd_assert ((field_start <= value_start) || (0 == value_start));
  ------------------
  |  |   66|  9.93k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  985|       |
  986|  9.93k|  mhd_assert (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA != \
  ------------------
  |  |   66|  9.93k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  987|  9.93k|              c->rq.u_proc.post.enc);
  988|       |
  989|  9.93k|  return process_complete_field_all (c,
  990|  9.93k|                                     buf,
  991|  9.93k|                                     pfield_next_pos,
  992|  9.93k|                                     pdata_size,
  993|  9.93k|                                     field_start,
  994|  9.93k|                                     name_start,
  995|  9.93k|                                     name_len,
  996|  9.93k|                                     0, 0, 0, 0, 0, 0,
  997|  9.93k|                                     value_start,
  998|  9.93k|                                     value_len);
  999|  9.93k|}
post_parser_funcs.c:_ZL26process_complete_field_allP14MHD_ConnectionPcPmS2_mmmmmmmmmmm:
  798|  12.5k|{
  799|  12.5k|  struct mhd_PostParseActionData *const p_par =
  800|  12.5k|    &(c->rq.app_act.head_act.data.post_parse);
  801|  12.5k|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
  802|       |
  803|  12.5k|  mhd_assert (mhd_ACTION_POST_PARSE == c->rq.app_act.head_act.act);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  804|       |
  805|  12.5k|  mhd_assert ((0 == filename_start) \
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  806|  12.5k|              || (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA == p_data->enc));
  807|  12.5k|  mhd_assert ((0 == cntn_type_start) \
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  808|  12.5k|              || (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA == p_data->enc));
  809|  12.5k|  mhd_assert ((0 == enc_start) \
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  810|  12.5k|              || (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA == p_data->enc));
  811|       |
  812|  12.5k|  mhd_assert (mhd_HTTP_STAGE_REQ_RECV_FINISHED >= c->stage);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  813|  12.5k|  mhd_assert (value_start + value_len <= *pfield_next_pos);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  814|  12.5k|  mhd_assert ((mhd_HTTP_STAGE_FULL_REQ_RECEIVED <= c->stage) \
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  815|  12.5k|              || (value_start + value_len < *pfield_next_pos));
  816|  12.5k|  mhd_assert (*pfield_next_pos <= *pdata_size);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  817|  12.5k|  mhd_assert ((name_start + name_len < value_start) \
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  818|  12.5k|              || (0 == value_start));
  819|  12.5k|  mhd_assert (value_start + value_len <= *pfield_next_pos);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  820|  12.5k|  mhd_assert ((mhd_HTTP_STAGE_FULL_REQ_RECEIVED <= c->stage) \
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  821|  12.5k|              || (name_start + name_len < *pfield_next_pos));
  822|  12.5k|  mhd_assert ((filename_start + filename_len < value_start) \
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  823|  12.5k|              || (0 == value_start));
  824|  12.5k|  mhd_assert (filename_start + filename_len <= *pfield_next_pos);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  825|  12.5k|  mhd_assert ((cntn_type_start + cntn_type_len < value_start) \
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  826|  12.5k|              || (0 == value_start));
  827|  12.5k|  mhd_assert (cntn_type_start + cntn_type_len <= *pfield_next_pos);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  828|  12.5k|  mhd_assert ((enc_start + enc_len < value_start) \
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  829|  12.5k|              || (0 == value_start));
  830|  12.5k|  mhd_assert (enc_start + enc_len <= *pfield_next_pos);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  831|  12.5k|  mhd_assert (field_start <= name_start);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  832|  12.5k|  mhd_assert ((field_start <= filename_start) || (0 == filename_start));
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  833|  12.5k|  mhd_assert ((field_start <= cntn_type_start) || (0 == cntn_type_start));
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  834|  12.5k|  mhd_assert ((field_start <= enc_start) || (0 == enc_start));
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  835|  12.5k|  mhd_assert ((field_start <= value_start) || (0 == value_start));
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  836|  12.5k|  mhd_assert ((0 != filename_start) || (0 == filename_len));
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  837|  12.5k|  mhd_assert ((0 != cntn_type_start) || (0 == cntn_type_len));
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  838|  12.5k|  mhd_assert ((0 != enc_start) || (0 == enc_len));
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  839|  12.5k|  mhd_assert ((0 != value_start) || (0 == value_len));
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  840|  12.5k|  mhd_assert (0 == buf[name_start + name_len]);
  ------------------
  |  |   66|  12.5k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  841|       |
  842|  12.5k|  p_data->some_data_provided = true;
  843|       |
  844|  12.5k|  if (is_value_streaming_needed (c, (*pfield_next_pos - field_start)))
  ------------------
  |  Branch (844:7): [True: 199, False: 12.3k]
  ------------------
  845|    199|  {
  846|    199|    bool res;
  847|    199|    const struct MHD_UploadAction *act;
  848|    199|    struct MHD_String name;
  849|    199|    struct MHD_StringNullable filename;
  850|    199|    struct MHD_StringNullable content_type;
  851|    199|    struct MHD_StringNullable encoding;
  852|       |
  853|    199|    make_post_strings_from_buf_and_indices (buf,
  854|    199|                                            name_start,
  855|    199|                                            name_len,
  856|    199|                                            filename_start,
  857|    199|                                            filename_len,
  858|    199|                                            cntn_type_start,
  859|    199|                                            cntn_type_len,
  860|    199|                                            enc_start,
  861|    199|                                            enc_len,
  862|    199|                                            &name,
  863|    199|                                            &filename,
  864|    199|                                            &content_type,
  865|    199|                                            &encoding);
  866|       |
  867|    199|    act = p_par->stream_reader (&(c->rq),
  868|    199|                                p_par->reader_cls,
  869|    199|                                &name,
  870|    199|                                &filename,
  871|    199|                                &content_type,
  872|    199|                                &encoding,
  873|    199|                                value_len,
  874|    199|                                buf + value_start,
  875|    199|                                p_data->value_off,
  876|    199|                                MHD_YES);
  877|    199|    p_data->some_data_provided = true;
  878|    199|    res = mhd_stream_process_upload_action (c, act, false);
  879|    199|    if (c->suspended)
  ------------------
  |  Branch (879:9): [True: 0, False: 199]
  ------------------
  880|      0|      return true;
  881|    199|    p_data->force_streamed = false;
  882|    199|    p_data->value_off = 0;
  883|    199|    if (*pdata_size > *pfield_next_pos)
  ------------------
  |  Branch (883:9): [True: 198, False: 1]
  ------------------
  884|    198|    {
  885|    198|      size_t consumed_size;
  886|    198|      memmove (buf + field_start,
  887|    198|               buf + *pfield_next_pos,
  888|    198|               *pdata_size - *pfield_next_pos);
  889|    198|      consumed_size = *pfield_next_pos - field_start;
  890|    198|      *pfield_next_pos = field_start;
  891|    198|      *pdata_size -= consumed_size;
  892|    198|    }
  893|      1|    else
  894|      1|    {
  895|      1|      *pfield_next_pos = field_start;
  896|      1|      *pdata_size = field_start;
  897|      1|    }
  898|    199|    return res;
  899|    199|  }
  900|  12.3k|  else
  901|  12.3k|  {
  902|  12.3k|    struct mhd_PositionAndLength name_i;
  903|  12.3k|    struct mhd_PositionAndLength filename_i;
  904|  12.3k|    struct mhd_PositionAndLength content_type_i;
  905|  12.3k|    struct mhd_PositionAndLength encoding_i;
  906|  12.3k|    struct mhd_PositionAndLength value_i;
  907|       |
  908|  12.3k|    mhd_assert (!p_data->force_streamed);
  ------------------
  |  |   66|  12.3k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  909|  12.3k|    mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|  12.3k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  910|  12.3k|    mhd_assert ((0 == value_start) || (0 == buf[value_start + value_len]));
  ------------------
  |  |   66|  12.3k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  911|       |
  912|  12.3k|    name_i.pos = name_start;
  913|  12.3k|    name_i.len = name_len;
  914|  12.3k|    filename_i.pos = filename_start;
  915|  12.3k|    filename_i.len = filename_len;
  916|  12.3k|    content_type_i.pos = cntn_type_start;
  917|  12.3k|    content_type_i.len = cntn_type_len;
  918|  12.3k|    encoding_i.pos = enc_start;
  919|  12.3k|    encoding_i.len = enc_len;
  920|  12.3k|    value_i.pos = value_start;
  921|  12.3k|    value_i.len = value_len;
  922|       |
  923|  12.3k|    if (!add_parsed_post_field (c,
  ------------------
  |  Branch (923:9): [True: 38, False: 12.3k]
  ------------------
  924|  12.3k|                                &name_i,
  925|  12.3k|                                &filename_i,
  926|  12.3k|                                &content_type_i,
  927|  12.3k|                                &encoding_i,
  928|  12.3k|                                &value_i))
  929|     38|    {
  930|     38|      c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
  931|     38|      mhd_LOG_MSG (c->daemon, MHD_SC_REQ_POST_PARSE_FAILED_NO_POOL_MEM, \
  ------------------
  |  |   80|     38|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
  932|     38|                   "The request POST data cannot be parsed completely " \
  933|     38|                   "because there is not enough pool memory.");
  934|     38|      p_data->parse_result = MHD_POST_PARSE_RES_FAILED_NO_POOL_MEM;
  935|     38|      return true;
  936|     38|    }
  937|       |
  938|  12.3k|    p_data->some_data_provided = true;
  939|  12.3k|  }
  940|       |
  941|  12.3k|  return false; /* Continue parsing */
  942|  12.5k|}
post_parser_funcs.c:_ZL21add_parsed_post_fieldP14MHD_ConnectionP21mhd_PositionAndLengthS2_S2_S2_S2_:
  669|  12.3k|{
  670|  12.3k|  struct mhd_RequestPostField *pfield;
  671|       |
  672|  12.3k|  mhd_assert ((0 != filename->pos) || (0 == filename->len));
  ------------------
  |  |   66|  12.3k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  673|  12.3k|  mhd_assert ((0 != content_type->pos) || (0 == content_type->len));
  ------------------
  |  |   66|  12.3k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  674|  12.3k|  mhd_assert ((0 != transfer_encoding->pos) \
  ------------------
  |  |   66|  12.3k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  675|  12.3k|              || (0 == transfer_encoding->len));
  676|  12.3k|  mhd_assert ((0 != value->pos) || (0 == value->len));
  ------------------
  |  |   66|  12.3k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  677|       |
  678|  12.3k|  pfield = (struct mhd_RequestPostField *)
  679|  12.3k|           mhd_stream_alloc_memory (c,
  680|  12.3k|                                    sizeof (struct mhd_RequestPostField));
  681|  12.3k|  if (NULL == pfield)
  ------------------
  |  Branch (681:7): [True: 38, False: 12.3k]
  ------------------
  682|     38|    return false;
  683|       |
  684|  12.3k|  pfield->field.name = *name;
  685|  12.3k|  pfield->field.value = *value;
  686|  12.3k|  pfield->field.filename = *filename;
  687|  12.3k|  pfield->field.content_type = *content_type;
  688|  12.3k|  pfield->field.transfer_encoding = *transfer_encoding;
  689|       |
  690|  12.3k|  mhd_DLINKEDL_INIT_LINKS (pfield, post_fields);
  ------------------
  |  |  313|  12.3k|        do {(p_obj)->links_name.prev = NULL;       \
  |  |  314|  12.3k|            (p_obj)->links_name.next = NULL;} while (0)
  |  |  ------------------
  |  |  |  Branch (314:54): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  691|       |
  692|  12.3k|  mhd_DLINKEDL_INS_LAST (&(c->rq), pfield, post_fields);
  ------------------
  |  |  340|  12.3k|        mhd_DLINKEDL_INS_LAST_D (&((p_own)->l_name),(p_obj),l_name)
  |  |  ------------------
  |  |  |  |  192|  12.3k|#define mhd_DLINKEDL_INS_LAST_D(p_list, p_obj, links_name) do { \
  |  |  |  |  193|  12.3k|        mhd_ASSUME (NULL == (p_obj)->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  12.3k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  12.3k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  194|  12.3k|        mhd_ASSUME (NULL == (p_obj)->links_name.next); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  12.3k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  12.3k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  195|  12.3k|        mhd_ASSUME ((p_obj) != (p_list)->first);       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  12.3k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  12.3k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  196|  12.3k|        mhd_ASSUME ((p_obj) != (p_list)->last);        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  12.3k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  12.3k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  197|  12.3k|        if (NULL != (p_list)->last)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (197:13): [True: 10.9k, False: 1.42k]
  |  |  |  |  ------------------
  |  |  |  |  198|  12.3k|        { mhd_ASSUME (NULL == (p_list)->last->links_name.next);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  10.9k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  10.9k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  199|  10.9k|          mhd_ASSUME (NULL == (p_list)->first->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  10.9k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  10.9k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  200|  10.9k|          mhd_ASSUME ((p_obj) != (p_list)->last->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  10.9k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  10.9k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  201|  10.9k|          mhd_ASSUME (NULL != (p_list)->first);                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  10.9k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  10.9k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  202|  10.9k|          ((p_obj)->links_name.prev = (p_list)->last)           \
  |  |  |  |  203|  10.9k|          ->links_name.next = (p_obj); } else \
  |  |  |  |  204|  12.3k|        { mhd_ASSUME (NULL == (p_list)->first);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  1.42k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  1.42k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  205|  1.42k|          (p_list)->first = (p_obj); }                      \
  |  |  |  |  206|  12.3k|        (p_list)->last = (p_obj);  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (206:45): [Folded, False: 12.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  693|       |
  694|  12.3k|  return true;
  695|  12.3k|}
post_parser_funcs.c:_ZL25is_value_streaming_neededP14MHD_Connectionm:
  628|  13.2k|{
  629|  13.2k|  struct mhd_PostParseActionData *const p_par =
  630|  13.2k|    &(c->rq.app_act.head_act.data.post_parse);
  631|  13.2k|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
  632|       |
  633|  13.2k|  if (NULL == p_par->stream_reader)
  ------------------
  |  Branch (633:7): [True: 0, False: 13.2k]
  ------------------
  634|      0|  {
  635|      0|    mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  636|      0|    mhd_assert (!p_data->force_streamed);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  637|      0|    return false; /* No value streaming possible */
  638|      0|  }
  639|       |
  640|       |  /* If part of the value has been already provided to "stream"
  641|       |     reader, the rest of the value should be provided
  642|       |     in the same way */
  643|  13.2k|  mhd_assert ((0 == p_data->value_off) || p_data->force_streamed);
  ------------------
  |  |   66|  13.2k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  644|  13.2k|  if (p_data->force_streamed)
  ------------------
  |  Branch (644:7): [True: 0, False: 13.2k]
  ------------------
  645|      0|    return true;
  646|       |
  647|  13.2k|  return (p_par->max_nonstream_size < field_cur_size);
  648|  13.2k|}
post_parser_funcs.c:_ZL16parse_post_mpartP14MHD_ConnectionPmPc:
 1457|  1.48k|{
 1458|  1.48k|  const int discp_lvl = c->daemon->req_cfg.strictness;
 1459|  1.48k|  const bool bare_lf_as_crlf = (-2 >= discp_lvl); /* Bare LF termination is dangerous when used in "multipart/form-data" */
 1460|  1.48k|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 1461|  1.48k|  struct mhd_PostParserMPartFormData *const mf = &(p_data->e_d.m_form); /**< the current "form-data" parsing details */
 1462|  1.48k|  size_t i;
 1463|       |
 1464|  1.48k|  mhd_assert (NULL != mf->delim.data);
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1465|  1.48k|  mhd_assert (4 < mf->delim.size);
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1466|  1.48k|  mhd_assert (0 == memcmp (mf->delim.data, "\r\n--", 4));
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1467|  1.48k|  mhd_assert (NULL == memchr (mf->delim.data + 4, '\r', mf->delim.size - 4));
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1468|  1.48k|  mhd_assert (NULL == memchr (mf->delim.data + 4, '\n', mf->delim.size - 4));
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1469|  1.48k|  mhd_assert (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA == \
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1470|  1.48k|              c->rq.u_proc.post.enc);
 1471|  1.48k|  mhd_assert (MHD_POST_PARSE_RES_OK == p_data->parse_result);
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1472|  1.48k|  mhd_assert (mhd_POST_MPART_ST_FORMAT_ERROR != mf->st);
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1473|  1.48k|  mhd_assert (!c->discard_request);
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1474|  1.48k|  mhd_assert (p_data->next_parse_pos < *pdata_size);
  ------------------
  |  |   66|  1.48k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1475|       |
 1476|  1.48k|  i = p_data->next_parse_pos;
 1477|  34.2k|  while (*pdata_size > i)
  ------------------
  |  Branch (1477:10): [True: 33.7k, False: 481]
  ------------------
 1478|  33.7k|  {
 1479|  33.7k|    switch (mf->st)
 1480|  33.7k|    {
 1481|  1.11k|    case mhd_POST_MPART_ST_BACK_TO_PREAMBL:
  ------------------
  |  Branch (1481:5): [True: 1.11k, False: 32.6k]
  ------------------
 1482|  1.11k|      mhd_assert (mhd_POST_INVALID_POS != mf->delim_check_start);
  ------------------
  |  |   66|  1.11k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1483|  1.11k|      mf->line_start = mhd_POST_INVALID_POS;
  ------------------
  |  |   58|  1.11k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
 1484|  1.11k|      mf->st = mhd_POST_MPART_ST_PREAMBL;
 1485|  1.11k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  1.11k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1486|       |    /* Intentional fallthrough */
 1487|  1.11k|    case mhd_POST_MPART_ST_PREAMBL:
  ------------------
  |  Branch (1487:5): [True: 0, False: 33.7k]
  ------------------
 1488|  1.11k|      mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|  1.11k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1489|  1.11k|      mhd_assert (mhd_POST_INVALID_POS == mf->delim_check_start);
  ------------------
  |  |   66|  1.11k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1490|  1.11k|      mhd_assert (mhd_POST_INVALID_POS == mf->line_start);
  ------------------
  |  |   66|  1.11k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1491|  1.11k|#ifdef HAVE_MEMMEM
 1492|  1.11k|      if (mf->delim.size <= *pdata_size - i)
  ------------------
  |  Branch (1492:11): [True: 1.10k, False: 8]
  ------------------
 1493|  1.10k|      {
 1494|  1.10k|        const char *delim_ptr;
 1495|  1.10k|        if (!bare_lf_as_crlf)
  ------------------
  |  Branch (1495:13): [True: 1.10k, False: 0]
  ------------------
 1496|  1.10k|          delim_ptr = (const char *)memmem (buf + i,
 1497|  1.10k|                                            *pdata_size - i,
 1498|  1.10k|                                            mf->delim.data,
 1499|  1.10k|                                            mf->delim.size);
 1500|      0|        else
 1501|      0|          delim_ptr = (const char *)memmem (buf + i,
 1502|      0|                                            *pdata_size - i,
 1503|      0|                                            mf->delim.data + 1,
 1504|      0|                                            mf->delim.size - 1);
 1505|  1.10k|        if (NULL != delim_ptr)
  ------------------
  |  Branch (1505:13): [True: 1.10k, False: 0]
  ------------------
 1506|  1.10k|        {
 1507|  1.10k|          size_t delim_pos;
 1508|       |
 1509|  1.10k|          mhd_assert (delim_ptr >= buf + i);
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1510|  1.10k|          mhd_assert (delim_ptr + mf->delim.size - 1 <= buf + *pdata_size);
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1511|       |
 1512|  1.10k|          delim_pos = (size_t)(delim_ptr - buf);
 1513|       |
 1514|  1.10k|          mhd_assert (i <= delim_pos);
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1515|       |
 1516|  1.10k|          if (!bare_lf_as_crlf)
  ------------------
  |  Branch (1516:15): [True: 1.10k, False: 0]
  ------------------
 1517|  1.10k|          {
 1518|  1.10k|            mf->line_start = delim_pos + 2u; /* '2' for CRLF */
 1519|  1.10k|            i = delim_pos + mf->delim.size;
 1520|  1.10k|          }
 1521|      0|          else
 1522|      0|          {
 1523|      0|            mf->line_start = delim_pos + 1u; /* '1' for LF */
 1524|      0|            i = delim_pos + mf->delim.size - 1;
 1525|      0|          }
 1526|  1.10k|          mf->st = mhd_POST_MPART_ST_FIRST_DELIM_FOUND;
 1527|  1.10k|          continue;
 1528|  1.10k|        }
 1529|      0|        i = *pdata_size - mf->delim.size + 1u; /* '+ 1u' to move to then next position */
 1530|      0|        if (!bare_lf_as_crlf)
  ------------------
  |  Branch (1530:13): [True: 0, False: 0]
  ------------------
 1531|      0|          i += 1u;
 1532|      0|      }
 1533|      8|#endif /* HAVE_MEMMEM */
 1534|      8|      do /* Fast local loop */
 1535|      8|      {
 1536|      8|#ifndef MHD_FAVOR_SMALL_CODE
 1537|      8|        const char *lf_ptr;
 1538|      8|        size_t lf_pos;
 1539|       |
 1540|      8|        lf_ptr = (const char *)memchr (buf + i, '\n', *pdata_size - i);
 1541|      8|        if (NULL == lf_ptr)
  ------------------
  |  Branch (1541:13): [True: 2, False: 6]
  ------------------
 1542|      2|        {
 1543|      2|          if ('\r' == buf[*pdata_size - 1])
  ------------------
  |  Branch (1543:15): [True: 2, False: 0]
  ------------------
 1544|      2|            mf->st = mhd_POST_MPART_ST_PREAMBL_CR_FOUND;
 1545|      2|          i = *pdata_size;
 1546|      2|          break;
 1547|      2|        }
 1548|      6|        lf_pos = (size_t)(lf_ptr - buf);
 1549|      6|        mhd_assert (i <= lf_pos);
  ------------------
  |  |   66|      6|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1550|      6|        mhd_assert (*pdata_size > i);
  ------------------
  |  |   66|      6|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1551|      6|        if (bare_lf_as_crlf)
  ------------------
  |  Branch (1551:13): [True: 0, False: 6]
  ------------------
 1552|      0|        {
 1553|      0|          i = lf_pos + 1;
 1554|      0|          mf->st = mhd_POST_MPART_ST_PREAMBL_LINE_START;
 1555|      0|          break;
 1556|      0|        }
 1557|      6|        else if ((i < lf_pos)
  ------------------
  |  Branch (1557:18): [True: 6, False: 0]
  ------------------
 1558|      6|                 && ('\r' == buf[lf_pos - 1]))
  ------------------
  |  Branch (1558:21): [True: 6, False: 0]
  ------------------
 1559|      6|        {
 1560|      6|          i = lf_pos + 1;
 1561|      6|          mf->st = mhd_POST_MPART_ST_PREAMBL_LINE_START;
 1562|      6|          break;
 1563|      6|        }
 1564|      0|        i = lf_pos;
 1565|       |#else  /* MHD_FAVOR_SMALL_CODE */
 1566|       |        if ('\r' == buf[i])
 1567|       |        {
 1568|       |          mf->st = mhd_POST_MPART_ST_PREAMBL_CR_FOUND;
 1569|       |          ++i; /* Go to the next char */
 1570|       |          break;
 1571|       |        }
 1572|       |        else if (('\n' == buf[i]) && bare_lf_as_crlf)
 1573|       |        {
 1574|       |          mf->st = mhd_POST_MPART_ST_PREAMBL_LINE_START;
 1575|       |          ++i; /* Go to the next char */
 1576|       |          break;
 1577|       |        }
 1578|       |#endif /* MHD_FAVOR_SMALL_CODE */
 1579|      0|      } while (*pdata_size > ++i);
  ------------------
  |  Branch (1579:16): [True: 0, False: 0]
  ------------------
 1580|      8|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|      8|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1581|      8|                  || (mhd_POST_MPART_ST_PREAMBL_CR_FOUND == mf->st) \
 1582|      8|                  || (mhd_POST_MPART_ST_PREAMBL_LINE_START == mf->st));
 1583|      8|      continue;
 1584|      0|    case mhd_POST_MPART_ST_PREAMBL_CR_FOUND:
  ------------------
  |  Branch (1584:5): [True: 0, False: 33.7k]
  ------------------
 1585|      0|      mhd_assert (mhd_POST_INVALID_POS != mf->delim_check_start);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1586|      0|      mhd_assert (mhd_POST_INVALID_POS == mf->line_start);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1587|      0|      if ('\n' == buf[i])
  ------------------
  |  Branch (1587:11): [True: 0, False: 0]
  ------------------
 1588|      0|      {
 1589|      0|        mf->st = mhd_POST_MPART_ST_PREAMBL_LINE_START;
 1590|      0|        ++i;
 1591|      0|      }
 1592|      0|      else
 1593|      0|        mf->st = mhd_POST_MPART_ST_PREAMBL;
 1594|      0|      continue;
 1595|  1.11k|    case mhd_POST_MPART_ST_NOT_STARTED:
  ------------------
  |  Branch (1595:5): [True: 1.11k, False: 32.6k]
  ------------------
 1596|  1.11k|      mhd_assert (0 == p_data->field_start);
  ------------------
  |  |   66|  1.11k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1597|  1.11k|      mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|  1.11k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1598|  1.11k|      mf->delim_check_start = mhd_POST_INVALID_POS; /* Ignored for first delimiter */
  ------------------
  |  |   58|  1.11k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
 1599|  1.11k|      p_data->field_start = i;
 1600|  1.11k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  1.11k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1601|       |    /* Intentional fallthrough */
 1602|  1.12k|    case mhd_POST_MPART_ST_PREAMBL_LINE_START:
  ------------------
  |  Branch (1602:5): [True: 6, False: 33.7k]
  ------------------
 1603|  1.12k|      mhd_assert (mhd_POST_INVALID_POS == mf->delim_check_start);
  ------------------
  |  |   66|  1.12k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1604|  1.12k|      mhd_assert (mhd_POST_INVALID_POS == mf->line_start);
  ------------------
  |  |   66|  1.12k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1605|  1.12k|      mf->line_start = i;
 1606|  1.12k|#ifndef MHD_FAVOR_SMALL_CODE
 1607|  1.12k|      if (*pdata_size - i >= mf->delim.size - 2) /* Exclude CRLF prefix for the first delimiter */
  ------------------
  |  Branch (1607:11): [True: 1.11k, False: 12]
  ------------------
 1608|  1.11k|      { /* Exclude CRLF prefix for the first delimiter */
 1609|  1.11k|        if (0 == memcmp (buf + i, mf->delim.data + 2, mf->delim.size - 2))
  ------------------
  |  Branch (1609:13): [True: 0, False: 1.11k]
  ------------------
 1610|      0|        {
 1611|      0|          mf->st = mhd_POST_MPART_ST_FIRST_DELIM_FOUND;
 1612|      0|          i += mf->delim.size - 2;
 1613|      0|        }
 1614|  1.11k|        else
 1615|  1.11k|          mf->st = mhd_POST_MPART_ST_BACK_TO_PREAMBL;
 1616|  1.11k|        continue;
 1617|  1.11k|      }
 1618|     12|#endif /* ! MHD_FAVOR_SMALL_CODE */
 1619|     12|      mf->st = mhd_POST_MPART_ST_PREAMBL_CHECKING_FOR_DELIM;
 1620|     12|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|     12|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1621|       |    /* Intentional fallthrough */
 1622|     12|    case mhd_POST_MPART_ST_PREAMBL_CHECKING_FOR_DELIM:
  ------------------
  |  Branch (1622:5): [True: 0, False: 33.7k]
  ------------------
 1623|     12|      mhd_assert (mhd_POST_INVALID_POS == mf->delim_check_start); /* Ignored for first delimiter */
  ------------------
  |  |   66|     12|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1624|     12|      mhd_assert (i >= mf->line_start);
  ------------------
  |  |   66|     12|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1625|     12|      mhd_assert (*pdata_size >= mf->line_start);
  ------------------
  |  |   66|     12|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1626|     12|      mhd_assert (i < mf->line_start + (mf->delim.size - 2));
  ------------------
  |  |   66|     12|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1627|     12|      if (*pdata_size - mf->line_start >= (mf->delim.size - 2))
  ------------------
  |  Branch (1627:11): [True: 0, False: 12]
  ------------------
 1628|      0|      {
 1629|       |        /* Enough data for the delimiter */
 1630|      0|        if (0 == memcmp (buf + mf->line_start,
  ------------------
  |  Branch (1630:13): [True: 0, False: 0]
  ------------------
 1631|      0|                         mf->delim.data + 2,
 1632|      0|                         mf->delim.size - 2))
 1633|      0|        {
 1634|      0|          mf->st = mhd_POST_MPART_ST_FIRST_DELIM_FOUND;
 1635|      0|          i = mf->line_start + (mf->delim.size - 2);
 1636|      0|        }
 1637|      0|        else
 1638|      0|          mf->st = mhd_POST_MPART_ST_BACK_TO_PREAMBL;
 1639|      0|      }
 1640|     12|      else
 1641|     12|      {
 1642|       |        /* Not enough data for the delimiter */
 1643|     12|        if (0 == memcmp (buf + mf->line_start,
  ------------------
  |  Branch (1643:13): [True: 6, False: 6]
  ------------------
 1644|     12|                         mf->delim.data + 2,
 1645|     12|                         *pdata_size - mf->line_start))
 1646|      6|          i = *pdata_size;
 1647|      6|        else
 1648|      6|          mf->st = mhd_POST_MPART_ST_BACK_TO_PREAMBL;
 1649|     12|      }
 1650|     12|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|     12|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1651|     12|                  || (mhd_POST_MPART_ST_FIRST_DELIM_FOUND == mf->st) \
 1652|     12|                  || (mhd_POST_MPART_ST_BACK_TO_PREAMBL == mf->st));
 1653|     12|      continue;
 1654|  1.10k|    case mhd_POST_MPART_ST_FIRST_DELIM_FOUND:
  ------------------
  |  Branch (1654:5): [True: 1.10k, False: 32.6k]
  ------------------
 1655|  1.10k|      mhd_assert (mhd_POST_INVALID_POS == mf->delim_check_start); /* Ignored for first delimiter */
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1656|  1.10k|      mhd_assert (mhd_POST_INVALID_POS != mf->line_start);
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1657|  1.10k|      mhd_assert (i >= mf->line_start + mf->delim.size - 2);
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1658|  1.10k|      do /* Fast local loop */
 1659|  2.21k|      {
 1660|  2.21k|        if ('\n' == buf[i])
  ------------------
  |  Branch (1660:13): [True: 1.10k, False: 1.10k]
  ------------------
 1661|  1.10k|        {
 1662|  1.10k|          if (bare_lf_as_crlf
  ------------------
  |  Branch (1662:15): [True: 0, False: 1.10k]
  ------------------
 1663|  1.10k|              || ('\r' == buf[i - 1]))
  ------------------
  |  Branch (1663:18): [True: 1.10k, False: 0]
  ------------------
 1664|  1.10k|          {
 1665|  1.10k|            mf->st = mhd_POST_MPART_ST_FIRST_PART_START;
 1666|  1.10k|            ++i;
 1667|  1.10k|          }
 1668|      0|          else
 1669|      0|            mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1670|       |
 1671|  1.10k|          break;
 1672|  1.10k|        }
 1673|  1.10k|        else if ('\r' == buf[i - 1])
  ------------------
  |  Branch (1673:18): [True: 0, False: 1.10k]
  ------------------
 1674|      0|        {
 1675|      0|          mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1676|      0|          break;
 1677|      0|        }
 1678|  1.10k|        else if ((i == mf->line_start + (mf->delim.size - 2) + 1)
  ------------------
  |  Branch (1678:18): [True: 0, False: 1.10k]
  ------------------
 1679|      0|                 && ('-' == buf[i - 1])
  ------------------
  |  Branch (1679:21): [True: 0, False: 0]
  ------------------
 1680|      0|                 && ('-' == buf[i]))
  ------------------
  |  Branch (1680:21): [True: 0, False: 0]
  ------------------
 1681|      0|        {
 1682|      0|          mf->st = mhd_POST_MPART_ST_EPILOGUE;
 1683|      0|          break;
 1684|      0|        }
 1685|  2.21k|      } while (*pdata_size > ++i);
  ------------------
  |  Branch (1685:16): [True: 1.10k, False: 1]
  ------------------
 1686|  1.10k|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1687|  1.10k|                  || (mhd_POST_MPART_ST_FIRST_PART_START == mf->st) \
 1688|  1.10k|                  || (mhd_POST_MPART_ST_FORMAT_ERROR == mf->st) \
 1689|  1.10k|                  || (mhd_POST_MPART_ST_EPILOGUE == mf->st));
 1690|  1.10k|      continue;
 1691|  1.10k|    case mhd_POST_MPART_ST_FIRST_PART_START:
  ------------------
  |  Branch (1691:5): [True: 1.10k, False: 32.6k]
  ------------------
 1692|  1.10k|      mhd_assert (mhd_POST_INVALID_POS == mf->delim_check_start); /* Ignored for first delimiter */
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1693|  1.10k|      mhd_assert (i > p_data->field_start);
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1694|  1.10k|      mhd_assert (*pdata_size > i);
  ------------------
  |  |   66|  1.10k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1695|  1.10k|      if ((c->rq.app_act.head_act.data.post_parse.max_nonstream_size <
  ------------------
  |  Branch (1695:11): [True: 152, False: 955]
  ------------------
 1696|  1.10k|           i - p_data->field_start)
 1697|    955|          || (*pdata_size - i < i - p_data->field_start))
  ------------------
  |  Branch (1697:14): [True: 2, False: 953]
  ------------------
 1698|    154|      {
 1699|       |        /* Discard unused data */
 1700|    154|        memmove (buf + p_data->field_start,
 1701|    154|                 buf + i,
 1702|    154|                 *pdata_size - i);
 1703|    154|        *pdata_size -= (i - p_data->field_start);
 1704|    154|        i = p_data->field_start;
 1705|    154|      }
 1706|  1.10k|      mf->delim_check_start = p_data->field_start;
 1707|  1.10k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  1.10k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1708|       |    /* Intentional fallthrough */
 1709|  3.17k|    case mhd_POST_MPART_ST_PART_START:
  ------------------
  |  Branch (1709:5): [True: 2.06k, False: 31.7k]
  ------------------
 1710|  3.17k|      mhd_assert (0 == mf->f.name_len);
  ------------------
  |  |   66|  3.17k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1711|  3.17k|      mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|  3.17k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1712|  3.17k|      mhd_assert (mhd_POST_INVALID_POS != mf->delim_check_start);
  ------------------
  |  |   66|  3.17k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1713|  3.17k|      p_data->field_start = mf->delim_check_start;
 1714|  3.17k|      mf->delim_check_start = mhd_POST_INVALID_POS;
  ------------------
  |  |   58|  3.17k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
 1715|  3.17k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  3.17k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1716|       |    /* Intentional fallthrough */
 1717|  12.0k|    case mhd_POST_MPART_ST_HEADER_LINE_START:
  ------------------
  |  Branch (1717:5): [True: 8.89k, False: 24.8k]
  ------------------
 1718|  12.0k|      mf->line_start = i;
 1719|  12.0k|      mf->st = mhd_POST_MPART_ST_HEADER_LINE;
 1720|  12.0k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  12.0k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1721|       |    /* Intentional fallthrough */
 1722|  12.1k|    case mhd_POST_MPART_ST_HEADER_LINE:
  ------------------
  |  Branch (1722:5): [True: 31, False: 33.7k]
  ------------------
 1723|  12.1k|      mhd_assert (i >= mf->line_start);
  ------------------
  |  |   66|  12.1k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1724|  12.1k|      mhd_assert (mhd_POST_INVALID_POS != mf->line_start);
  ------------------
  |  |   66|  12.1k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1725|  12.1k|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|  12.1k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1726|  12.1k|      do /* Fast local loop */
 1727|   616k|      {
 1728|   616k|        if ('\r' == buf[i])
  ------------------
  |  Branch (1728:13): [True: 10.2k, False: 606k]
  ------------------
 1729|  10.2k|        {
 1730|  10.2k|          mf->st = mhd_POST_MPART_ST_HEADER_LINE_CR_FOUND;
 1731|  10.2k|          ++i;
 1732|  10.2k|          break;
 1733|  10.2k|        }
 1734|   606k|        else if ('\n' == buf[i])
  ------------------
  |  Branch (1734:18): [True: 2, False: 606k]
  ------------------
 1735|      2|        {
 1736|      2|          if (bare_lf_as_crlf)
  ------------------
  |  Branch (1736:15): [True: 0, False: 2]
  ------------------
 1737|      0|            mf->st = mhd_POST_MPART_ST_HEADER_LINE_END;
 1738|      2|          else
 1739|      2|            mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1740|      2|          break;
 1741|      2|        }
 1742|   606k|        else if (mf->line_start + (mf->delim.size - 2) == i + 1)
  ------------------
  |  Branch (1742:18): [True: 9.99k, False: 596k]
  ------------------
 1743|  9.99k|        {
 1744|  9.99k|          if (0 == memcmp (buf + mf->line_start,
  ------------------
  |  Branch (1744:15): [True: 1.78k, False: 8.20k]
  ------------------
 1745|  9.99k|                           mf->delim.data + 2,
 1746|  9.99k|                           mf->delim.size - 2))
 1747|  1.78k|          {
 1748|       |            /* The delimiter before the end of the header */
 1749|  1.78k|            if (2 > mf->line_start)
  ------------------
  |  Branch (1749:17): [True: 0, False: 1.78k]
  ------------------
 1750|      0|              mf->delim_check_start = mf->line_start;
 1751|  1.78k|            else if (!bare_lf_as_crlf)
  ------------------
  |  Branch (1751:22): [True: 1.78k, False: 0]
  ------------------
 1752|  1.78k|              mf->delim_check_start = mf->line_start - 2;
 1753|      0|            else
 1754|      0|              mf->delim_check_start = mf->line_start - 1; /* Actually can be one char earlier */
 1755|  1.78k|            mf->st = mhd_POST_MPART_ST_DELIM_FOUND;
 1756|  1.78k|            break;
 1757|  1.78k|          }
 1758|  9.99k|        }
 1759|   616k|      } while (*pdata_size > ++i);
  ------------------
  |  Branch (1759:16): [True: 604k, False: 67]
  ------------------
 1760|  12.1k|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|  12.1k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1761|  12.1k|                  || (mhd_POST_MPART_ST_HEADER_LINE_CR_FOUND == mf->st) \
 1762|  12.1k|                  || (mhd_POST_MPART_ST_HEADER_LINE_END == mf->st) \
 1763|  12.1k|                  || (mhd_POST_MPART_ST_DELIM_FOUND == mf->st) \
 1764|  12.1k|                  || (mhd_POST_MPART_ST_FORMAT_ERROR == mf->st));
 1765|  12.1k|      continue;
 1766|  10.2k|    case mhd_POST_MPART_ST_HEADER_LINE_CR_FOUND:
  ------------------
  |  Branch (1766:5): [True: 10.2k, False: 23.5k]
  ------------------
 1767|  10.2k|      if ('\n' != buf[i])
  ------------------
  |  Branch (1767:11): [True: 15, False: 10.2k]
  ------------------
 1768|     15|      {
 1769|     15|        mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1770|     15|        continue;
 1771|     15|      }
 1772|  10.2k|      mf->st = mhd_POST_MPART_ST_HEADER_LINE_END;
 1773|  10.2k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  10.2k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1774|       |    /* Intentional fallthrough */
 1775|  10.2k|    case mhd_POST_MPART_ST_HEADER_LINE_END:
  ------------------
  |  Branch (1775:5): [True: 0, False: 33.7k]
  ------------------
 1776|  10.2k|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|  10.2k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1777|  10.2k|      mhd_assert (i >= mf->line_start);
  ------------------
  |  |   66|  10.2k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1778|  10.2k|      mhd_assert (mhd_POST_INVALID_POS != mf->line_start);
  ------------------
  |  |   66|  10.2k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1779|  10.2k|      if (1)
  ------------------
  |  Branch (1779:11): [True: 10.2k, Folded]
  ------------------
 1780|  10.2k|      {
 1781|  10.2k|        size_t line_len;
 1782|  10.2k|        if (i == mf->line_start)
  ------------------
  |  Branch (1782:13): [True: 0, False: 10.2k]
  ------------------
 1783|      0|          line_len = 0;
 1784|  10.2k|        else if ('\r' == buf[i - 1])
  ------------------
  |  Branch (1784:18): [True: 10.2k, False: 0]
  ------------------
 1785|  10.2k|          line_len = i - mf->line_start - 1;
 1786|      0|        else
 1787|      0|          line_len = i - mf->line_start;
 1788|       |
 1789|  10.2k|        if (0 == line_len)
  ------------------
  |  Branch (1789:13): [True: 1.21k, False: 9.01k]
  ------------------
 1790|  1.21k|        {
 1791|  1.21k|          ++i;
 1792|  1.21k|          mf->st = mhd_POST_MPART_ST_VALUE_START;
 1793|  1.21k|          continue;
 1794|  1.21k|        }
 1795|  9.01k|        else
 1796|  9.01k|        {
 1797|  9.01k|          static const struct MHD_String hdr =
 1798|  9.01k|            mhd_MSTR_INIT ("Content-Disposition:");
  ------------------
  |  |   59|  9.01k|#define mhd_MSTR_INIT(sstr) { mhd_SSTR_LEN (sstr), (sstr)}
  |  |  ------------------
  |  |  |  |   54|  9.01k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
 1799|  9.01k|          static const struct MHD_String tkn = mhd_MSTR_INIT ("form-data");
  ------------------
  |  |   59|  9.01k|#define mhd_MSTR_INIT(sstr) { mhd_SSTR_LEN (sstr), (sstr)}
  |  |  ------------------
  |  |  |  |   54|  9.01k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
 1800|  9.01k|          static const struct MHD_String n_par = mhd_MSTR_INIT ("name");
  ------------------
  |  |   59|  9.01k|#define mhd_MSTR_INIT(sstr) { mhd_SSTR_LEN (sstr), (sstr)}
  |  |  ------------------
  |  |  |  |   54|  9.01k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
 1801|       |
 1802|  9.01k|          if ((hdr.len + tkn.len + n_par.len + 2 <= line_len)
  ------------------
  |  Branch (1802:15): [True: 7.52k, False: 1.49k]
  ------------------
 1803|  7.52k|              && mhd_str_equal_caseless_bin_n (hdr.cstr,
  ------------------
  |  Branch (1803:18): [True: 5.52k, False: 1.99k]
  ------------------
 1804|  7.52k|                                               buf + mf->line_start,
 1805|  7.52k|                                               hdr.len))
 1806|  5.52k|          {
 1807|  5.52k|            size_t hdr_val_start;
 1808|  5.52k|            struct MHD_String hdr_val;
 1809|  5.52k|            enum mhd_StringStartsWithTokenResult res;
 1810|  5.52k|            struct mhd_BufferConst name_buf;
 1811|  5.52k|            bool hdr_has_name;
 1812|  5.52k|            bool name_needs_unq;
 1813|       |
 1814|  5.52k|            buf[mf->line_start + line_len] = 0;  /* Zero-terminate the header line */
 1815|  5.52k|            hdr_val_start = mf->line_start + hdr.len;
 1816|       |            /* Skip all whitespace chars */
 1817|  12.0k|            while ((' ' == buf[hdr_val_start]) || ('\t' == buf[hdr_val_start]))
  ------------------
  |  Branch (1817:20): [True: 3.79k, False: 8.21k]
  |  Branch (1817:51): [True: 2.69k, False: 5.52k]
  ------------------
 1818|  6.48k|              ++hdr_val_start;
 1819|       |
 1820|  5.52k|            mhd_assert (hdr_val_start <= i);
  ------------------
  |  |   66|  5.52k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1821|       |
 1822|  5.52k|            hdr_val.cstr = buf + hdr_val_start;
 1823|  5.52k|            hdr_val.len = mf->line_start + line_len - hdr_val_start;
 1824|       |
 1825|  5.52k|            res = mhd_str_starts_with_token_req_param (&hdr_val,
 1826|  5.52k|                                                       &tkn,
 1827|  5.52k|                                                       &n_par,
 1828|  5.52k|                                                       &name_buf,
 1829|  5.52k|                                                       &name_needs_unq);
 1830|  5.52k|            if (mhd_STR_STARTS_W_TOKEN_HAS_TOKEN_BAD_FORMAT == res)
  ------------------
  |  Branch (1830:17): [True: 94, False: 5.43k]
  ------------------
 1831|     94|            {
 1832|       |              /* Found two names for one field */
 1833|     94|              mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1834|     94|              continue;
 1835|     94|            }
 1836|  5.43k|            else if (mhd_STR_STARTS_W_TOKEN_HAS_TOKEN == res)
  ------------------
  |  Branch (1836:22): [True: 3.99k, False: 1.43k]
  ------------------
 1837|  3.99k|            {
 1838|  3.99k|              static const struct MHD_String fn_par =
 1839|  3.99k|                mhd_MSTR_INIT ("filename");
  ------------------
  |  |   59|  3.99k|#define mhd_MSTR_INIT(sstr) { mhd_SSTR_LEN (sstr), (sstr)}
  |  |  ------------------
  |  |  |  |   54|  3.99k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
 1840|  3.99k|              struct mhd_BufferConst fname_buf;
 1841|  3.99k|              bool fname_needs_unq;
 1842|       |
 1843|  3.99k|              if (NULL != name_buf.data)
  ------------------
  |  Branch (1843:19): [True: 1.83k, False: 2.15k]
  ------------------
 1844|  1.83k|              {
 1845|  1.83k|                mhd_assert (buf < name_buf.data);
  ------------------
  |  |   66|  1.83k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1846|  1.83k|                if (0 != mf->f.name_idx)
  ------------------
  |  Branch (1846:21): [True: 22, False: 1.81k]
  ------------------
 1847|     22|                {
 1848|       |                  /* Found two names for one field */
 1849|     22|                  mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1850|     22|                  continue;
 1851|     22|                }
 1852|  1.81k|                mf->f.name_idx = (size_t)(name_buf.data - buf);
 1853|  1.81k|                mf->f.name_len = name_buf.size;
 1854|  1.81k|                hdr_has_name = true;
 1855|       |
 1856|       |                /* Do not process (unquote, url-decode, zero-terminate) here yet
 1857|       |                 * as it may break the header format */
 1858|  1.81k|              }
 1859|  2.15k|              else
 1860|  2.15k|                hdr_has_name = false;
 1861|       |
 1862|  3.97k|              res = mhd_str_starts_with_token_req_param (&hdr_val,
 1863|  3.97k|                                                         &tkn,
 1864|  3.97k|                                                         &fn_par,
 1865|  3.97k|                                                         &fname_buf,
 1866|  3.97k|                                                         &fname_needs_unq);
 1867|  3.97k|              if (mhd_STR_STARTS_W_TOKEN_HAS_TOKEN_BAD_FORMAT == res)
  ------------------
  |  Branch (1867:19): [True: 2, False: 3.97k]
  ------------------
 1868|      2|              {
 1869|      2|                mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1870|      2|                continue;
 1871|      2|              }
 1872|  3.97k|              else if (mhd_STR_STARTS_W_TOKEN_HAS_TOKEN == res)
  ------------------
  |  Branch (1872:24): [True: 3.97k, False: 0]
  ------------------
 1873|  3.97k|              {
 1874|  3.97k|                if (NULL != fname_buf.data)
  ------------------
  |  Branch (1874:21): [True: 1.07k, False: 2.89k]
  ------------------
 1875|  1.07k|                {
 1876|  1.07k|                  mhd_assert (buf < fname_buf.data);
  ------------------
  |  |   66|  1.07k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1877|  1.07k|                  if (0 != mf->f.filename_idx)
  ------------------
  |  Branch (1877:23): [True: 0, False: 1.07k]
  ------------------
 1878|      0|                  {
 1879|       |                    /* Found two filenames for one field */
 1880|      0|                    mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1881|      0|                    continue;
 1882|      0|                  }
 1883|  1.07k|                  mf->f.filename_idx = (size_t)(fname_buf.data - buf);
 1884|  1.07k|                  if (!fname_needs_unq)
  ------------------
  |  Branch (1884:23): [True: 1.07k, False: 0]
  ------------------
 1885|  1.07k|                    mf->f.filename_len = fname_buf.size;
 1886|      0|                  else
 1887|      0|                  {
 1888|      0|                    mf->f.filename_len =
 1889|      0|                      mhd_str_unquote (fname_buf.data,
 1890|      0|                                       fname_buf.size,
 1891|      0|                                       buf + mf->f.filename_idx);
 1892|      0|                    if ((0 == mf->f.filename_len) && (0 != fname_buf.size))
  ------------------
  |  Branch (1892:25): [True: 0, False: 0]
  |  Branch (1892:54): [True: 0, False: 0]
  ------------------
 1893|      0|                    {
 1894|      0|                      mhd_assert (0 && "broken quoting must be detected " \
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1895|      0|                                  "earlier by " \
 1896|      0|                                  "mhd_str_starts_with_token_req_param()");
 1897|      0|                      mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 1898|      0|                      mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1899|      0|                      continue;
 1900|      0|                    }
 1901|      0|                  }
 1902|  1.07k|                  mhd_assert (mf->f.filename_idx + mf->f.filename_len <= i);
  ------------------
  |  |   66|  1.07k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1903|  1.07k|                  mf->f.filename_len =
 1904|  1.07k|                    mhd_str_pct_decode_lenient_n (buf + mf->f.filename_idx,
 1905|  1.07k|                                                  mf->f.filename_len,
 1906|  1.07k|                                                  buf + mf->f.filename_idx,
 1907|  1.07k|                                                  mf->f.filename_len,
 1908|  1.07k|                                                  NULL);
 1909|  1.07k|                  mhd_assert (mf->f.filename_idx + mf->f.filename_len <= i);
  ------------------
  |  |   66|  1.07k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1910|       |
 1911|  1.07k|                  buf[mf->f.filename_idx + mf->f.filename_len] = 0; /* Zero-terminate the filename */
 1912|  1.07k|                }
 1913|  3.97k|              }
 1914|      0|              else
 1915|      0|              {
 1916|      0|                mhd_assert (mhd_STR_STARTS_W_TOKEN_NO_TOKEN == res);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1917|      0|                mhd_assert (0 && "The presence of the token was "
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1918|      0|                            "checked earlier");
 1919|      0|                mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 1920|      0|              }
 1921|       |
 1922|  3.97k|              if (hdr_has_name)
  ------------------
  |  Branch (1922:19): [True: 1.81k, False: 2.15k]
  ------------------
 1923|  1.81k|              {
 1924|  1.81k|                if (name_needs_unq)
  ------------------
  |  Branch (1924:21): [True: 330, False: 1.48k]
  ------------------
 1925|    330|                {
 1926|    330|                  mf->f.name_len = mhd_str_unquote (buf + mf->f.name_idx,
 1927|    330|                                                    mf->f.name_len,
 1928|    330|                                                    buf + mf->f.name_idx);
 1929|    330|                  if ((0 == mf->f.name_len) && (0 != name_buf.size))
  ------------------
  |  Branch (1929:23): [True: 214, False: 116]
  |  Branch (1929:48): [True: 0, False: 214]
  ------------------
 1930|      0|                  {
 1931|      0|                    mhd_assert (0 && "broken quoting must be detected " \
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1932|      0|                                "earlier by " \
 1933|      0|                                "mhd_str_starts_with_token_req_param()");
 1934|      0|                    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 1935|      0|                    mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 1936|      0|                    continue;
 1937|      0|                  }
 1938|    330|                }
 1939|  1.81k|                mhd_assert (mf->f.name_idx + mf->f.name_len <= i);
  ------------------
  |  |   66|  1.81k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1940|  1.81k|                mf->f.name_len =
 1941|  1.81k|                  mhd_str_pct_decode_lenient_n (buf + mf->f.name_idx,
 1942|  1.81k|                                                mf->f.name_len,
 1943|  1.81k|                                                buf + mf->f.name_idx,
 1944|  1.81k|                                                mf->f.name_len,
 1945|  1.81k|                                                NULL);
 1946|  1.81k|                mhd_assert (mf->f.name_idx + mf->f.name_len <= i);
  ------------------
  |  |   66|  1.81k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1947|       |
 1948|  1.81k|                buf[mf->f.name_idx + mf->f.name_len] = 0; /* Zero-terminate the name */
 1949|  1.81k|              }
 1950|  3.97k|            }
 1951|  5.52k|          }
 1952|  9.01k|        }
 1953|  10.2k|      }
 1954|  8.89k|      ++i;
 1955|  8.89k|      mf->st = mhd_POST_MPART_ST_HEADER_LINE_START;
 1956|  8.89k|      continue;
 1957|  1.21k|    case mhd_POST_MPART_ST_VALUE_START:
  ------------------
  |  Branch (1957:5): [True: 1.21k, False: 32.5k]
  ------------------
 1958|  1.21k|      mhd_assert (mhd_POST_INVALID_POS == mf->delim_check_start);
  ------------------
  |  |   66|  1.21k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1959|  1.21k|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|  1.21k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1960|  1.21k|      mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|  1.21k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1961|  1.21k|      mhd_assert (0 == mf->f.value_idx);
  ------------------
  |  |   66|  1.21k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1962|  1.21k|      mhd_assert (0 == mf->f.value_len);
  ------------------
  |  |   66|  1.21k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1963|  1.21k|      mhd_assert (0 != i && "the 'value' should follow the 'name'");
  ------------------
  |  |   66|  1.21k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1964|  1.21k|      if (0 == mf->f.name_idx)
  ------------------
  |  Branch (1964:11): [True: 5, False: 1.20k]
  ------------------
 1965|      5|      {
 1966|      5|        mhd_LOG_MSG (c->daemon, \
  ------------------
  |  |   80|     10|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  |  |  ------------------
  |  |  |  Branch (80:59): [True: 5, False: 0]
  |  |  ------------------
  ------------------
 1967|      5|                     p_data->some_data_provided ? \
 1968|      5|                     MHD_SC_REQ_POST_PARSE_PARTIAL_INVALID_POST_FORMAT : \
 1969|      5|                     MHD_SC_REQ_POST_PARSE_FAILED_INVALID_POST_FORMAT, \
 1970|      5|                     "The request 'multipart/form-data' POST field has no " \
 1971|      5|                     "name of the field.");
 1972|      5|        p_data->parse_result =
 1973|      5|          p_data->some_data_provided ?
  ------------------
  |  Branch (1973:11): [True: 5, False: 0]
  ------------------
 1974|      5|          MHD_POST_PARSE_RES_PARTIAL_INVALID_POST_FORMAT :
 1975|      5|          MHD_POST_PARSE_RES_FAILED_INVALID_POST_FORMAT;
 1976|      5|        c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
 1977|      5|        return true; /* Stop parsing the upload */
 1978|      5|      }
 1979|  1.20k|      mhd_assert (0 != mf->f.name_len);
  ------------------
  |  |   66|  1.20k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1980|  1.20k|      mhd_assert (i > mf->f.name_idx);
  ------------------
  |  |   66|  1.20k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1981|  1.20k|      mf->f.value_idx = i;
 1982|  1.20k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  1.20k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1983|       |    /* Intentional fallthrough */
 1984|  1.43k|    case mhd_POST_MPART_ST_BACK_TO_VALUE:
  ------------------
  |  Branch (1984:5): [True: 225, False: 33.5k]
  ------------------
 1985|  1.43k|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|  1.43k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1986|  1.43k|      mf->line_start = mhd_POST_INVALID_POS;
  ------------------
  |  |   58|  1.43k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
 1987|  1.43k|      mf->delim_check_start = mhd_POST_INVALID_POS;
  ------------------
  |  |   58|  1.43k|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
 1988|  1.43k|      mf->st = mhd_POST_MPART_ST_VALUE;
 1989|  1.43k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  1.43k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 1990|       |    /* Intentional fallthrough */
 1991|  1.43k|    case mhd_POST_MPART_ST_VALUE:
  ------------------
  |  Branch (1991:5): [True: 0, False: 33.7k]
  ------------------
 1992|  1.43k|      mhd_assert (mhd_POST_INVALID_POS == mf->delim_check_start);
  ------------------
  |  |   66|  1.43k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1993|  1.43k|      mhd_assert (mhd_POST_INVALID_POS == mf->line_start);
  ------------------
  |  |   66|  1.43k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1994|  1.43k|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|  1.43k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1995|  1.43k|#ifdef HAVE_MEMMEM
 1996|  1.43k|      if (mf->delim.size <= *pdata_size - i)
  ------------------
  |  Branch (1996:11): [True: 1.02k, False: 408]
  ------------------
 1997|  1.02k|      {
 1998|  1.02k|        const char *delim_ptr;
 1999|  1.02k|        if (!bare_lf_as_crlf)
  ------------------
  |  Branch (1999:13): [True: 1.02k, False: 0]
  ------------------
 2000|  1.02k|          delim_ptr = (const char *)memmem (buf + i,
 2001|  1.02k|                                            *pdata_size - i,
 2002|  1.02k|                                            mf->delim.data,
 2003|  1.02k|                                            mf->delim.size);
 2004|      0|        else
 2005|      0|          delim_ptr = (const char *)memmem (buf + i,
 2006|      0|                                            *pdata_size - i,
 2007|      0|                                            mf->delim.data + 1,
 2008|      0|                                            mf->delim.size - 1);
 2009|  1.02k|        if (NULL != delim_ptr)
  ------------------
  |  Branch (2009:13): [True: 909, False: 115]
  ------------------
 2010|    909|        {
 2011|    909|          size_t delim_pos;
 2012|       |
 2013|    909|          mhd_assert (delim_ptr >= buf + i);
  ------------------
  |  |   66|    909|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2014|    909|          mhd_assert (delim_ptr + mf->delim.size - 1 <= buf + *pdata_size);
  ------------------
  |  |   66|    909|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2015|       |
 2016|    909|          delim_pos = (size_t)(delim_ptr - buf);
 2017|       |
 2018|    909|          mhd_assert (i <= delim_pos);
  ------------------
  |  |   66|    909|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2019|       |
 2020|    909|          if (!bare_lf_as_crlf)
  ------------------
  |  Branch (2020:15): [True: 909, False: 0]
  ------------------
 2021|    909|          {
 2022|    909|            mf->line_start = delim_pos + 2;
 2023|    909|            i = delim_pos + mf->delim.size;
 2024|    909|          }
 2025|      0|          else
 2026|      0|          {
 2027|      0|            mf->line_start = delim_pos + 1;
 2028|      0|            i = delim_pos + mf->delim.size - 1;
 2029|      0|            if ((delim_pos > 0)
  ------------------
  |  Branch (2029:17): [True: 0, False: 0]
  ------------------
 2030|      0|                && ('\r' == buf[delim_pos - 1]))
  ------------------
  |  Branch (2030:20): [True: 0, False: 0]
  ------------------
 2031|      0|              --delim_pos;
 2032|      0|          }
 2033|    909|          mf->delim_check_start = delim_pos;
 2034|    909|          mf->st = mhd_POST_MPART_ST_DELIM_FOUND;
 2035|    909|          continue;
 2036|    909|        }
 2037|    115|        i = *pdata_size - mf->delim.size + 1u; /* '+ 1u' to move to then next position */
 2038|    115|        if (!bare_lf_as_crlf)
  ------------------
  |  Branch (2038:13): [True: 115, False: 0]
  ------------------
 2039|    115|          i += 1u;
 2040|    115|      }
 2041|    523|#endif /* HAVE_MEMMEM */
 2042|    523|      do /* Fast local loop */
 2043|    615|      {
 2044|    615|#ifndef MHD_FAVOR_SMALL_CODE
 2045|    615|        const char *lf_ptr;
 2046|    615|        size_t lf_pos;
 2047|       |
 2048|    615|        lf_ptr = (const char *)memchr (buf + i, '\n', *pdata_size - i);
 2049|    615|        if (NULL == lf_ptr)
  ------------------
  |  Branch (2049:13): [True: 145, False: 470]
  ------------------
 2050|    145|        {
 2051|    145|          if ('\r' == buf[*pdata_size - 1])
  ------------------
  |  Branch (2051:15): [True: 39, False: 106]
  ------------------
 2052|     39|            mf->st = mhd_POST_MPART_ST_VALUE_CR_FOUND;
 2053|    145|          i = *pdata_size;
 2054|    145|          break;
 2055|    145|        }
 2056|    470|        lf_pos = (size_t)(lf_ptr - buf);
 2057|    470|        mhd_assert (i <= lf_pos);
  ------------------
  |  |   66|    470|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2058|    470|        mhd_assert (*pdata_size > i);
  ------------------
  |  |   66|    470|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2059|    470|        if ((i < lf_pos)
  ------------------
  |  Branch (2059:13): [True: 411, False: 59]
  ------------------
 2060|    411|            && ('\r' == buf[lf_pos - 1]))
  ------------------
  |  Branch (2060:16): [True: 373, False: 38]
  ------------------
 2061|    373|        {
 2062|    373|          mf->delim_check_start = lf_pos - 1;
 2063|    373|          mf->st = mhd_POST_MPART_ST_VALUE_LINE_START;
 2064|    373|          i = lf_pos + 1;
 2065|    373|          break;
 2066|    373|        }
 2067|     97|        else if (bare_lf_as_crlf)
  ------------------
  |  Branch (2067:18): [True: 0, False: 97]
  ------------------
 2068|      0|        {
 2069|      0|          mf->delim_check_start = lf_pos;
 2070|      0|          mf->st = mhd_POST_MPART_ST_VALUE_LINE_START;
 2071|      0|          i = lf_pos + 1;
 2072|      0|          break;
 2073|      0|        }
 2074|     97|        i = lf_pos;
 2075|       |#else  /* MHD_FAVOR_SMALL_CODE */
 2076|       |        if ('\r' == buf[i])
 2077|       |        {
 2078|       |          mf->delim_check_start = i;
 2079|       |          mf->st = mhd_POST_MPART_ST_VALUE_CR_FOUND;
 2080|       |          ++i;
 2081|       |          break;
 2082|       |        }
 2083|       |        else if (bare_lf_as_crlf && ('\n' == buf[i]))
 2084|       |        {
 2085|       |          mf->delim_check_start = i;
 2086|       |          mf->st = mhd_POST_MPART_ST_VALUE_LINE_START;
 2087|       |          ++i;
 2088|       |          break;
 2089|       |        }
 2090|       |#endif /* MHD_FAVOR_SMALL_CODE */
 2091|     97|      } while (*pdata_size > ++i);
  ------------------
  |  Branch (2091:16): [True: 92, False: 5]
  ------------------
 2092|    523|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|    523|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2093|    523|                  || (mhd_POST_MPART_ST_VALUE_CR_FOUND == mf->st) \
 2094|    523|                  || (mhd_POST_MPART_ST_VALUE_LINE_START == mf->st));
 2095|    523|      continue;
 2096|      0|    case mhd_POST_MPART_ST_VALUE_CR_FOUND:
  ------------------
  |  Branch (2096:5): [True: 0, False: 33.7k]
  ------------------
 2097|      0|      if ('\n' != buf[i])
  ------------------
  |  Branch (2097:11): [True: 0, False: 0]
  ------------------
 2098|      0|      {
 2099|      0|        mf->st = mhd_POST_MPART_ST_BACK_TO_VALUE;
 2100|      0|        continue;
 2101|      0|      }
 2102|      0|      mf->st = mhd_POST_MPART_ST_VALUE_LINE_START;
 2103|      0|      ++i;
 2104|      0|      continue;
 2105|    345|    case mhd_POST_MPART_ST_VALUE_LINE_START:
  ------------------
  |  Branch (2105:5): [True: 345, False: 33.4k]
  ------------------
 2106|    345|      mhd_assert (mhd_POST_INVALID_POS != mf->delim_check_start);
  ------------------
  |  |   66|    345|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2107|    345|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|    345|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2108|    345|      mf->line_start = i;
 2109|    345|#ifndef MHD_FAVOR_SMALL_CODE
 2110|    345|      if (*pdata_size - i >= mf->delim.size - 2)
  ------------------
  |  Branch (2110:11): [True: 6, False: 339]
  ------------------
 2111|      6|      {
 2112|      6|        if (0 == memcmp (buf + i, mf->delim.data + 2, mf->delim.size - 2))
  ------------------
  |  Branch (2112:13): [True: 0, False: 6]
  ------------------
 2113|      0|        {
 2114|      0|          mf->st = mhd_POST_MPART_ST_DELIM_FOUND;
 2115|      0|          i += mf->delim.size - 2;
 2116|      0|        }
 2117|      6|        else
 2118|      6|          mf->st = mhd_POST_MPART_ST_BACK_TO_VALUE;
 2119|      6|        continue;
 2120|      6|      }
 2121|    339|#endif /* ! MHD_FAVOR_SMALL_CODE */
 2122|    339|      mf->st = mhd_POST_MPART_ST_VALUE_CHECKING_FOR_DELIM;
 2123|    339|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|    339|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 2124|       |    /* Intentional fallthrough */
 2125|    414|    case mhd_POST_MPART_ST_VALUE_CHECKING_FOR_DELIM:
  ------------------
  |  Branch (2125:5): [True: 75, False: 33.6k]
  ------------------
 2126|    414|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|    414|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2127|    414|      mhd_assert (i >= mf->line_start);
  ------------------
  |  |   66|    414|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2128|    414|      mhd_assert (*pdata_size >= mf->line_start);
  ------------------
  |  |   66|    414|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2129|    414|      mhd_assert (i < mf->line_start + (mf->delim.size - 2));
  ------------------
  |  |   66|    414|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2130|    414|      if (*pdata_size - mf->line_start >= (mf->delim.size - 2))
  ------------------
  |  Branch (2130:11): [True: 75, False: 339]
  ------------------
 2131|     75|      {
 2132|       |        /* Enough data for the delimiter */
 2133|     75|        if (0 == memcmp (buf + mf->line_start,
  ------------------
  |  Branch (2133:13): [True: 0, False: 75]
  ------------------
 2134|     75|                         mf->delim.data + 2,
 2135|     75|                         mf->delim.size - 2))
 2136|      0|        {
 2137|      0|          mf->st = mhd_POST_MPART_ST_DELIM_FOUND;
 2138|      0|          i = mf->line_start + (mf->delim.size - 2);
 2139|      0|        }
 2140|     75|        else
 2141|     75|          mf->st = mhd_POST_MPART_ST_BACK_TO_VALUE;
 2142|     75|      }
 2143|    339|      else
 2144|    339|      {
 2145|       |        /* Not enough data for the delimiter */
 2146|    339|        if (0 == memcmp (buf + mf->line_start,
  ------------------
  |  Branch (2146:13): [True: 195, False: 144]
  ------------------
 2147|    339|                         mf->delim.data + 2,
 2148|    339|                         *pdata_size - mf->line_start))
 2149|    195|          i = *pdata_size;
 2150|    144|        else
 2151|    144|          mf->st = mhd_POST_MPART_ST_BACK_TO_VALUE;
 2152|    339|      }
 2153|    414|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|    414|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2154|    414|                  || (mhd_POST_MPART_ST_DELIM_FOUND == mf->st) \
 2155|    414|                  || (mhd_POST_MPART_ST_BACK_TO_VALUE == mf->st));
 2156|    414|      continue;
 2157|  2.69k|    case mhd_POST_MPART_ST_DELIM_FOUND:
  ------------------
  |  Branch (2157:5): [True: 2.69k, False: 31.0k]
  ------------------
 2158|  2.69k|      mhd_assert (mhd_POST_INVALID_POS != mf->delim_check_start);
  ------------------
  |  |   66|  2.69k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2159|  2.69k|      mhd_assert (mhd_POST_INVALID_POS != mf->line_start);
  ------------------
  |  |   66|  2.69k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2160|  2.69k|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|  2.69k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2161|  2.69k|      mhd_assert (i >= mf->line_start + mf->delim.size - 2);
  ------------------
  |  |   66|  2.69k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2162|  2.69k|      do /* Fast local loop */
 2163|  48.1k|      {
 2164|  48.1k|        if ('\n' == buf[i])
  ------------------
  |  Branch (2164:13): [True: 2.12k, False: 46.0k]
  ------------------
 2165|  2.12k|        {
 2166|  2.12k|          if (bare_lf_as_crlf
  ------------------
  |  Branch (2166:15): [True: 0, False: 2.12k]
  ------------------
 2167|  2.12k|              || ('\r' == buf[i - 1]))
  ------------------
  |  Branch (2167:18): [True: 2.11k, False: 14]
  ------------------
 2168|  2.11k|            mf->st = mhd_POST_MPART_ST_VALUE_END_FOUND;
 2169|     14|          else
 2170|     14|            mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 2171|       |
 2172|  2.12k|          break;
 2173|  2.12k|        }
 2174|  46.0k|        else if ('\r' == buf[i - 1])
  ------------------
  |  Branch (2174:18): [True: 3, False: 46.0k]
  ------------------
 2175|      3|        {
 2176|      3|          mf->st = mhd_POST_MPART_ST_FORMAT_ERROR;
 2177|      3|          break;
 2178|      3|        }
 2179|  46.0k|        else if ((i == mf->line_start + (mf->delim.size - 2) + 1)
  ------------------
  |  Branch (2179:18): [True: 1.44k, False: 44.5k]
  ------------------
 2180|  1.44k|                 && ('-' == buf[i - 1])
  ------------------
  |  Branch (2180:21): [True: 826, False: 622]
  ------------------
 2181|    826|                 && ('-' == buf[i]))
  ------------------
  |  Branch (2181:21): [True: 554, False: 272]
  ------------------
 2182|    554|        {
 2183|    554|          mf->st = mhd_POST_MPART_ST_VALUE_END_FOUND_FINAL;
 2184|    554|          break;
 2185|    554|        }
 2186|  48.1k|      } while (*pdata_size > ++i);
  ------------------
  |  Branch (2186:16): [True: 45.4k, False: 9]
  ------------------
 2187|  2.69k|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|  2.69k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2188|  2.69k|                  || (mhd_POST_MPART_ST_VALUE_END_FOUND == mf->st) \
 2189|  2.69k|                  || (mhd_POST_MPART_ST_VALUE_END_FOUND_FINAL == mf->st) \
 2190|  2.69k|                  || (mhd_POST_MPART_ST_FORMAT_ERROR == mf->st));
 2191|  2.69k|      continue;
 2192|  2.11k|    case mhd_POST_MPART_ST_VALUE_END_FOUND:
  ------------------
  |  Branch (2192:5): [True: 2.11k, False: 31.6k]
  ------------------
 2193|  2.66k|    case mhd_POST_MPART_ST_VALUE_END_FOUND_FINAL:
  ------------------
  |  Branch (2193:5): [True: 554, False: 33.2k]
  ------------------
 2194|  2.66k|      mhd_assert (mhd_POST_INVALID_POS != mf->delim_check_start);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2195|  2.66k|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2196|  2.66k|      mhd_assert (mf->f.value_idx <= mf->delim_check_start);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2197|  2.66k|      mhd_assert (0 == mf->f.value_len);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2198|  2.66k|      mhd_assert (0 != mf->f.name_len);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2199|  2.66k|      mhd_assert (i > mf->f.name_idx);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2200|  2.66k|      mhd_assert (i > mf->delim_check_start);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2201|  2.66k|      if (0 != mf->f.value_idx)
  ------------------
  |  Branch (2201:11): [True: 887, False: 1.77k]
  ------------------
 2202|    887|      {
 2203|    887|        mf->f.value_len = mf->delim_check_start - mf->f.value_idx;
 2204|    887|        buf[mf->f.value_idx + mf->f.value_len] = 0; /* Zero-terminate the value */
 2205|    887|        ++mf->delim_check_start; /* Shift start of the delimiter to add space for zero-termination */
 2206|    887|      }
 2207|  2.66k|      if (mhd_POST_MPART_ST_VALUE_END_FOUND == mf->st)
  ------------------
  |  Branch (2207:11): [True: 2.11k, False: 554]
  ------------------
 2208|  2.11k|        mf->st = mhd_POST_MPART_ST_FULL_FIELD_FOUND;
 2209|    554|      else
 2210|    554|        mf->st = mhd_POST_MPART_ST_FULL_FIELD_FOUND_FINAL;
 2211|  2.66k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  2.66k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 2212|       |    /* Intentional fallthrough */
 2213|  2.66k|    case mhd_POST_MPART_ST_FULL_FIELD_FOUND:
  ------------------
  |  Branch (2213:5): [True: 0, False: 33.7k]
  ------------------
 2214|  2.66k|    case mhd_POST_MPART_ST_FULL_FIELD_FOUND_FINAL:
  ------------------
  |  Branch (2214:5): [True: 0, False: 33.7k]
  ------------------
 2215|  2.66k|      mhd_assert (mhd_POST_INVALID_POS != mf->delim_check_start);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2216|  2.66k|      mhd_assert (mhd_POST_INVALID_POS != p_data->field_start);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2217|  2.66k|      if (1)
  ------------------
  |  Branch (2217:11): [True: 2.66k, Folded]
  ------------------
 2218|  2.66k|      {
 2219|  2.66k|        size_t new_delim_check_start;
 2220|  2.66k|        bool state_changed;
 2221|       |
 2222|  2.66k|        ++i; /* Consume current character */
 2223|  2.66k|        new_delim_check_start = mf->delim_check_start;
 2224|  2.66k|        state_changed =
 2225|  2.66k|          process_complete_field_all (c,
 2226|  2.66k|                                      buf,
 2227|  2.66k|                                      &new_delim_check_start,
 2228|  2.66k|                                      pdata_size,
 2229|  2.66k|                                      p_data->field_start,
 2230|  2.66k|                                      mf->f.name_idx,
 2231|  2.66k|                                      mf->f.name_len,
 2232|  2.66k|                                      mf->f.filename_idx,
 2233|  2.66k|                                      mf->f.filename_len,
 2234|  2.66k|                                      mf->f.cntn_type_idx,
 2235|  2.66k|                                      mf->f.cntn_type_len,
 2236|  2.66k|                                      mf->f.enc_idx,
 2237|  2.66k|                                      mf->f.enc_len,
 2238|  2.66k|                                      mf->f.value_idx,
 2239|  2.66k|                                      mf->f.value_len);
 2240|  2.66k|        if (c->suspended)
  ------------------
  |  Branch (2240:13): [True: 0, False: 2.66k]
  ------------------
 2241|      0|        {
 2242|      0|          mhd_assert (mf->delim_check_start == new_delim_check_start);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2243|      0|          mhd_assert (state_changed);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2244|      0|          p_data->next_parse_pos = --i; /* Restore position */
 2245|      0|          return true;
 2246|      0|        }
 2247|       |
 2248|  2.66k|        if (mf->delim_check_start != new_delim_check_start)
  ------------------
  |  Branch (2248:13): [True: 132, False: 2.53k]
  ------------------
 2249|    132|        {
 2250|    132|          size_t shift_size;
 2251|    132|          mhd_assert (mf->delim_check_start > new_delim_check_start);
  ------------------
  |  |   66|    132|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2252|       |
 2253|    132|          shift_size = mf->delim_check_start - new_delim_check_start;
 2254|    132|          mf->delim_check_start = new_delim_check_start;
 2255|    132|          i -= shift_size;
 2256|    132|        }
 2257|       |
 2258|  2.66k|        mhd_assert (*pdata_size >= i);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2259|       |
 2260|  2.66k|        reset_parse_field_data_mpart_cont (
 2261|  2.66k|          p_data,
 2262|  2.66k|          mhd_POST_MPART_ST_FULL_FIELD_FOUND_FINAL == mf->st);
 2263|       |
 2264|  2.66k|        if (state_changed)
  ------------------
  |  Branch (2264:13): [True: 134, False: 2.53k]
  ------------------
 2265|    134|        {
 2266|    134|          p_data->next_parse_pos = i;
 2267|    134|          return true;
 2268|    134|        }
 2269|  2.66k|      }
 2270|  2.53k|      continue; /* Process the next char */
 2271|  2.53k|    case mhd_POST_MPART_ST_EPILOGUE:
  ------------------
  |  Branch (2271:5): [True: 708, False: 33.0k]
  ------------------
 2272|       |      /* Discard the rest of the content data */
 2273|    708|      *pdata_size = i;
 2274|    708|      p_data->next_parse_pos = i;
 2275|    708|      return false;
 2276|    152|    case mhd_POST_MPART_ST_FORMAT_ERROR:
  ------------------
  |  Branch (2276:5): [True: 152, False: 33.6k]
  ------------------
 2277|    152|      if (p_data->some_data_provided)
  ------------------
  |  Branch (2277:11): [True: 138, False: 14]
  ------------------
 2278|    138|      {
 2279|    138|        mhd_LOG_MSG (c->daemon, \
  ------------------
  |  |   80|    138|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2280|    138|                     MHD_SC_REQ_POST_PARSE_PARTIAL_INVALID_POST_FORMAT, \
 2281|    138|                     "The request POST has broken encoding or format and " \
 2282|    138|                     "was parsed only partially.");
 2283|    138|        p_data->parse_result =
 2284|    138|          MHD_POST_PARSE_RES_PARTIAL_INVALID_POST_FORMAT;
 2285|    138|      }
 2286|     14|      else
 2287|     14|      {
 2288|     14|        mhd_LOG_MSG (c->daemon, \
  ------------------
  |  |   80|     14|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2289|     14|                     MHD_SC_REQ_POST_PARSE_FAILED_INVALID_POST_FORMAT, \
 2290|     14|                     "The request POST has broken encoding or format and " \
 2291|     14|                     "cannot be parsed.");
 2292|     14|        p_data->parse_result =
 2293|     14|          MHD_POST_PARSE_RES_FAILED_INVALID_POST_FORMAT;
 2294|     14|      }
 2295|    152|      c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
 2296|    152|      return true;
 2297|      0|    default:
  ------------------
  |  Branch (2297:5): [True: 0, False: 33.7k]
  ------------------
 2298|      0|      mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 2299|      0|      break;
 2300|  33.7k|    }
 2301|      0|    mhd_assert (0 && "Should be unreachable");
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2302|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 2303|      0|    break;
 2304|  33.7k|  }
 2305|       |
 2306|    481|  mhd_assert (*pdata_size == i);
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2307|       |
 2308|    481|  mhd_assert (mhd_POST_MPART_ST_NOT_STARTED != mf->st);
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2309|    481|  mhd_assert (mhd_POST_MPART_ST_BACK_TO_PREAMBL != mf->st);
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2310|    481|  mhd_assert (mhd_POST_MPART_ST_PREAMBL_LINE_START != mf->st);
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2311|    481|  mhd_assert (mhd_POST_MPART_ST_HEADER_LINE_END != mf->st);
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2312|    481|  mhd_assert (mhd_POST_MPART_ST_BACK_TO_VALUE != mf->st);
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2313|    481|  mhd_assert (mhd_POST_MPART_ST_VALUE_END_FOUND != mf->st);
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2314|    481|  mhd_assert (mhd_POST_MPART_ST_VALUE_END_FOUND_FINAL != mf->st);
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2315|    481|  mhd_assert ((mhd_POST_MPART_ST_VALUE != mf->st) \
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2316|    481|              || (0 == mf->f.value_len));
 2317|       |
 2318|    481|  mhd_assert (*pdata_size == i);
  ------------------
  |  |   66|    481|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2319|       |
 2320|    481|  if ((0 != mf->f.value_idx)
  ------------------
  |  Branch (2320:7): [True: 395, False: 86]
  ------------------
 2321|    395|      && (((mhd_POST_MPART_ST_VALUE == mf->st)
  ------------------
  |  Branch (2321:12): [True: 111, False: 284]
  ------------------
 2322|    111|           && (i != mf->f.value_idx)
  ------------------
  |  Branch (2322:15): [True: 111, False: 0]
  ------------------
 2323|    111|           && is_value_streaming_needed (c, i - p_data->field_start))
  ------------------
  |  Branch (2323:15): [True: 35, False: 76]
  ------------------
 2324|    360|          || (((mhd_POST_MPART_ST_VALUE_CR_FOUND == mf->st)
  ------------------
  |  Branch (2324:16): [True: 39, False: 321]
  ------------------
 2325|    321|               || (mhd_POST_MPART_ST_VALUE_LINE_START == mf->st)
  ------------------
  |  Branch (2325:19): [True: 34, False: 287]
  ------------------
 2326|    287|               || (mhd_POST_MPART_ST_VALUE_CHECKING_FOR_DELIM == mf->st))
  ------------------
  |  Branch (2326:19): [True: 195, False: 92]
  ------------------
 2327|    268|              && (i != mf->delim_check_start)
  ------------------
  |  Branch (2327:18): [True: 268, False: 0]
  ------------------
 2328|    268|              && is_value_streaming_needed (c, i - mf->delim_check_start))))
  ------------------
  |  Branch (2328:18): [True: 55, False: 213]
  ------------------
 2329|     90|  {
 2330|     90|    bool proc_res;
 2331|       |
 2332|     90|    mhd_assert ((mhd_POST_MPART_ST_VALUE == mf->st) \
  ------------------
  |  |   66|     90|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2333|     90|                || (i >= mf->delim_check_start));
 2334|     90|    mhd_assert ((mhd_POST_MPART_ST_VALUE == mf->st) \
  ------------------
  |  |   66|     90|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2335|     90|                || (mhd_POST_INVALID_POS != mf->delim_check_start));
 2336|     90|    if (mhd_POST_MPART_ST_VALUE != mf->st)
  ------------------
  |  Branch (2336:9): [True: 55, False: 35]
  ------------------
 2337|     55|    {
 2338|     55|      i = mf->delim_check_start; /* Reset position */
 2339|     55|      mf->st = mhd_POST_MPART_ST_BACK_TO_VALUE;
 2340|     55|    }
 2341|       |
 2342|     90|    proc_res =
 2343|     90|      process_partial_value_all (c,
 2344|     90|                                 buf,
 2345|     90|                                 &i,
 2346|     90|                                 pdata_size,
 2347|     90|                                 mf->f.name_idx,
 2348|     90|                                 mf->f.name_len,
 2349|     90|                                 mf->f.filename_idx,
 2350|     90|                                 mf->f.filename_len,
 2351|     90|                                 mf->f.cntn_type_idx,
 2352|     90|                                 mf->f.cntn_type_len,
 2353|     90|                                 mf->f.enc_idx,
 2354|     90|                                 mf->f.enc_len,
 2355|     90|                                 mf->f.value_idx,
 2356|     90|                                 i - mf->f.value_idx);
 2357|       |
 2358|     90|    p_data->next_parse_pos = i;
 2359|       |
 2360|     90|    return proc_res;
 2361|     90|  }
 2362|       |
 2363|    391|  p_data->next_parse_pos = i;
 2364|    391|  return false; /* Continue parsing */
 2365|    481|}
post_parser_funcs.c:_ZL33reset_parse_field_data_mpart_contP18mhd_PostParserDatab:
  386|  2.66k|{
  387|  2.66k|  mhd_assert (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA == pdata->enc);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  388|  2.66k|  memset (&(pdata->e_d.m_form.f), 0, sizeof(pdata->e_d.m_form.f));
  389|  2.66k|  pdata->e_d.m_form.st = final ?
  ------------------
  |  Branch (389:26): [True: 554, False: 2.11k]
  ------------------
  390|    554|                         mhd_POST_MPART_ST_EPILOGUE :
  391|  2.66k|                         mhd_POST_MPART_ST_PART_START;
  392|  2.66k|  pdata->field_start = 0;
  393|  2.66k|}
post_parser_funcs.c:_ZL15parse_post_textP14MHD_ConnectionPmPc:
 2373|    791|{
 2374|    791|  const int discp_lvl = c->daemon->req_cfg.strictness;
 2375|       |  /* Treat bare LF as the end of the line.
 2376|       |     The same logic used here as for parsing HTTP headers.
 2377|       |     Bare LF is processed as the end of the line or rejected as broken
 2378|       |     request. */
 2379|    791|  const bool bare_lf_as_crlf = mhd_ALLOW_BARE_LF_AS_CRLF (discp_lvl);
  ------------------
  |  | 1354|    791|#define mhd_ALLOW_BARE_LF_AS_CRLF(strictness) (0 >= strictness)
  ------------------
 2380|    791|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 2381|    791|  struct mhd_PostParserTextData *const tf = &(p_data->e_d.text); /**< the current "text" field */
 2382|    791|  size_t i;
 2383|    791|  bool enc_broken;
 2384|       |
 2385|    791|  mhd_assert (MHD_HTTP_POST_ENCODING_TEXT_PLAIN == c->rq.u_proc.post.enc);
  ------------------
  |  |   66|    791|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2386|    791|  mhd_assert (MHD_POST_PARSE_RES_OK == p_data->parse_result);
  ------------------
  |  |   66|    791|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2387|    791|  mhd_assert (!c->discard_request);
  ------------------
  |  |   66|    791|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2388|    791|  mhd_assert (p_data->next_parse_pos < *pdata_size);
  ------------------
  |  |   66|    791|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2389|       |
 2390|    791|  enc_broken = false;
 2391|    791|  i = p_data->next_parse_pos;
 2392|  36.5k|  while (*pdata_size > i)
  ------------------
  |  Branch (2392:10): [True: 36.1k, False: 401]
  ------------------
 2393|  36.1k|  {
 2394|  36.1k|    switch (tf->st)
 2395|  36.1k|    {
 2396|  11.6k|    case mhd_POST_TEXT_ST_NOT_STARTED:
  ------------------
  |  Branch (2396:5): [True: 11.6k, False: 24.4k]
  ------------------
 2397|  11.6k|      mhd_assert (0 == p_data->field_start);
  ------------------
  |  |   66|  11.6k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2398|  11.6k|      mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|  11.6k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2399|  11.6k|      p_data->field_start = i;
 2400|  11.6k|      tf->name_idx = i;
 2401|  11.6k|      tf->st = mhd_POST_TEXT_ST_NAME;
 2402|  11.6k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  11.6k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 2403|       |    /* Intentional fallthrough */
 2404|  11.6k|    case mhd_POST_TEXT_ST_NAME:
  ------------------
  |  Branch (2404:5): [True: 0, False: 36.1k]
  ------------------
 2405|  11.6k|      do /* Fast local loop */
 2406|   254k|      {
 2407|   254k|        if ('=' == buf[i])
  ------------------
  |  Branch (2407:13): [True: 3.02k, False: 251k]
  ------------------
 2408|  3.02k|        {
 2409|  3.02k|          tf->st = mhd_POST_TEXT_ST_AT_EQ;
 2410|  3.02k|          break;
 2411|  3.02k|        }
 2412|   251k|        else if ('\r' == buf[i])
  ------------------
  |  Branch (2412:18): [True: 4.92k, False: 246k]
  ------------------
 2413|  4.92k|        {
 2414|  4.92k|          tf->st = mhd_POST_TEXT_ST_AT_CR;
 2415|  4.92k|          break;
 2416|  4.92k|        }
 2417|   246k|        else if ('\n' == buf[i])
  ------------------
  |  Branch (2417:18): [True: 3.64k, False: 242k]
  ------------------
 2418|  3.64k|        {
 2419|  3.64k|          tf->st = mhd_POST_TEXT_ST_AT_LF_BARE;
 2420|  3.64k|          break;
 2421|  3.64k|        }
 2422|   254k|      } while (*pdata_size > ++i);
  ------------------
  |  Branch (2422:16): [True: 242k, False: 93]
  ------------------
 2423|  11.6k|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|  11.6k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2424|  11.6k|                  || (mhd_POST_TEXT_ST_NAME != tf->st));
 2425|  11.6k|      continue;
 2426|  3.02k|    case mhd_POST_TEXT_ST_AT_EQ:
  ------------------
  |  Branch (2426:5): [True: 3.02k, False: 33.1k]
  ------------------
 2427|  3.02k|      mhd_assert (i > tf->name_idx);
  ------------------
  |  |   66|  3.02k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2428|  3.02k|      mhd_assert (0 == tf->name_len);
  ------------------
  |  |   66|  3.02k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2429|  3.02k|      mhd_assert (0 == tf->value_len);
  ------------------
  |  |   66|  3.02k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2430|  3.02k|      buf[i] = 0; /* Zero-terminate the name */
 2431|  3.02k|      tf->name_len = i - tf->name_idx;
 2432|  3.02k|      tf->st = mhd_POST_TEXT_ST_EQ_FOUND;
 2433|  3.02k|      ++i; /* Process the next char */
 2434|  3.02k|      continue;
 2435|  3.02k|    case mhd_POST_TEXT_ST_EQ_FOUND:
  ------------------
  |  Branch (2435:5): [True: 3.02k, False: 33.1k]
  ------------------
 2436|  3.02k|      mhd_assert (0 == p_data->value_off);
  ------------------
  |  |   66|  3.02k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2437|  3.02k|      mhd_assert (0 == tf->value_idx);
  ------------------
  |  |   66|  3.02k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2438|  3.02k|      mhd_assert (0 == tf->value_len);
  ------------------
  |  |   66|  3.02k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2439|  3.02k|      mhd_assert (0 != i && "the 'value' should follow the 'name'");
  ------------------
  |  |   66|  3.02k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2440|  3.02k|      tf->value_idx = i;
 2441|  3.02k|      tf->st = mhd_POST_TEXT_ST_VALUE;
 2442|  3.02k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  3.02k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 2443|       |    /* Intentional fallthrough */
 2444|  3.02k|    case mhd_POST_TEXT_ST_VALUE:
  ------------------
  |  Branch (2444:5): [True: 0, False: 36.1k]
  ------------------
 2445|  3.02k|      do /* Fast local loop */
 2446|   165k|      {
 2447|   165k|        if ('\r' == buf[i])
  ------------------
  |  Branch (2447:13): [True: 1.79k, False: 163k]
  ------------------
 2448|  1.79k|        {
 2449|  1.79k|          tf->st = mhd_POST_TEXT_ST_AT_CR;
 2450|  1.79k|          break;
 2451|  1.79k|        }
 2452|   163k|        else if ('\n' == buf[i])
  ------------------
  |  Branch (2452:18): [True: 1.14k, False: 162k]
  ------------------
 2453|  1.14k|        {
 2454|  1.14k|          tf->st = mhd_POST_TEXT_ST_AT_LF_BARE;
 2455|  1.14k|          break;
 2456|  1.14k|        }
 2457|   165k|      } while (*pdata_size > ++i);
  ------------------
  |  Branch (2457:16): [True: 162k, False: 85]
  ------------------
 2458|  3.02k|      mhd_assert ((*pdata_size == i) \
  ------------------
  |  |   66|  3.02k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2459|  3.02k|                  || (mhd_POST_TEXT_ST_AT_CR == tf->st) \
 2460|  3.02k|                  || (mhd_POST_TEXT_ST_AT_LF_BARE == tf->st));
 2461|  3.02k|      continue;
 2462|  4.79k|    case mhd_POST_TEXT_ST_AT_LF_BARE:
  ------------------
  |  Branch (2462:5): [True: 4.79k, False: 31.3k]
  ------------------
 2463|  4.79k|      if (!bare_lf_as_crlf)
  ------------------
  |  Branch (2463:11): [True: 212, False: 4.58k]
  ------------------
 2464|    212|      {
 2465|    212|        enc_broken = true;
 2466|    212|        break;
 2467|    212|      }
 2468|  4.58k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  4.58k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 2469|       |    /* Intentional fallthrough */
 2470|  11.2k|    case mhd_POST_TEXT_ST_AT_CR:
  ------------------
  |  Branch (2470:5): [True: 6.71k, False: 29.4k]
  ------------------
 2471|  11.2k|      mhd_assert (0 == tf->value_len);
  ------------------
  |  |   66|  11.2k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2472|  11.2k|      buf[i] = 0; /* Zero-terminate the value (or the name) */
 2473|  11.2k|      if (0 != tf->value_idx)
  ------------------
  |  Branch (2473:11): [True: 2.93k, False: 8.36k]
  ------------------
 2474|  2.93k|        tf->value_len = i - tf->value_idx;
 2475|  8.36k|      else
 2476|  8.36k|        tf->name_len = i - tf->name_idx;
 2477|  11.2k|      if ((0 == tf->name_len) && (0 == tf->value_len))
  ------------------
  |  Branch (2477:11): [True: 4.88k, False: 6.40k]
  |  Branch (2477:34): [True: 4.35k, False: 539]
  ------------------
 2478|  4.35k|      { /* Empty line */
 2479|  4.35k|        ++i; /* Advance to the next char to be checked */
 2480|  4.35k|        reset_parse_field_data_text (p_data);
 2481|  4.35k|        tf->st = mhd_POST_TEXT_ST_NOT_STARTED;
 2482|  4.35k|      }
 2483|  6.94k|      else if (mhd_POST_TEXT_ST_AT_LF_BARE == tf->st)
  ------------------
  |  Branch (2483:16): [True: 2.40k, False: 4.54k]
  ------------------
 2484|  2.40k|        tf->st = mhd_POST_TEXT_ST_FULL_LINE_FOUND;
 2485|  4.54k|      else
 2486|  4.54k|      {
 2487|  4.54k|        tf->st = mhd_POST_TEXT_ST_CR_FOUND;
 2488|  4.54k|        ++i; /* Process the next char */
 2489|  4.54k|      }
 2490|  11.2k|      continue;
 2491|  4.53k|    case mhd_POST_TEXT_ST_CR_FOUND:
  ------------------
  |  Branch (2491:5): [True: 4.53k, False: 31.6k]
  ------------------
 2492|  4.53k|      if ('\n' != buf[i])
  ------------------
  |  Branch (2492:11): [True: 88, False: 4.45k]
  ------------------
 2493|     88|      {
 2494|     88|        enc_broken = true;
 2495|     88|        break;
 2496|     88|      }
 2497|  4.45k|      tf->st = mhd_POST_TEXT_ST_FULL_LINE_FOUND;
 2498|  4.45k|      mhd_FALLTHROUGH;
  ------------------
  |  | 1300|  4.45k|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 2499|       |    /* Intentional fallthrough */
 2500|  6.85k|    case mhd_POST_TEXT_ST_FULL_LINE_FOUND:
  ------------------
  |  Branch (2500:5): [True: 2.40k, False: 33.7k]
  ------------------
 2501|  6.85k|      ++i; /* Advance to the next char to be checked */
 2502|  6.85k|      if (process_complete_field (c,
  ------------------
  |  Branch (2502:11): [True: 90, False: 6.76k]
  ------------------
 2503|  6.85k|                                  buf,
 2504|  6.85k|                                  &i,
 2505|  6.85k|                                  pdata_size,
 2506|  6.85k|                                  p_data->field_start,
 2507|  6.85k|                                  tf->name_idx,
 2508|  6.85k|                                  tf->name_len,
 2509|  6.85k|                                  tf->value_idx,
 2510|  6.85k|                                  tf->value_len))
 2511|     90|      {
 2512|     90|        if (c->suspended)
  ------------------
  |  Branch (2512:13): [True: 0, False: 90]
  ------------------
 2513|      0|          --i; /* Go back to the same position */
 2514|     90|        else
 2515|     90|          reset_parse_field_data_text (p_data);
 2516|     90|        p_data->next_parse_pos = i;
 2517|     90|        return true;
 2518|     90|      }
 2519|  6.76k|      mhd_assert (*pdata_size >= i);
  ------------------
  |  |   66|  6.76k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2520|  6.76k|      reset_parse_field_data_text (p_data);
 2521|  6.76k|      continue; /* Process the next char */
 2522|      0|    default:
  ------------------
  |  Branch (2522:5): [True: 0, False: 36.1k]
  ------------------
 2523|      0|      mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 2524|      0|      enc_broken = true;
 2525|      0|      break;
 2526|  36.1k|    }
 2527|    300|    mhd_assert (enc_broken);
  ------------------
  |  |   66|    300|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2528|    300|    break;
 2529|  36.1k|  }
 2530|       |
 2531|    701|  mhd_assert ((*pdata_size == i) || enc_broken);
  ------------------
  |  |   66|    701|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2532|       |
 2533|    701|  if (enc_broken)
  ------------------
  |  Branch (2533:7): [True: 300, False: 401]
  ------------------
 2534|    300|  {
 2535|    300|    if (p_data->some_data_provided)
  ------------------
  |  Branch (2535:9): [True: 96, False: 204]
  ------------------
 2536|     96|    {
 2537|     96|      mhd_LOG_MSG (c->daemon, \
  ------------------
  |  |   80|     96|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2538|     96|                   MHD_SC_REQ_POST_PARSE_PARTIAL_INVALID_POST_FORMAT, \
 2539|     96|                   "The request POST has broken encoding or format and " \
 2540|     96|                   "was parsed only partially.");
 2541|     96|      p_data->parse_result =
 2542|     96|        MHD_POST_PARSE_RES_PARTIAL_INVALID_POST_FORMAT;
 2543|     96|    }
 2544|    204|    else
 2545|    204|    {
 2546|    204|      mhd_LOG_MSG (c->daemon, \
  ------------------
  |  |   80|    204|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2547|    204|                   MHD_SC_REQ_POST_PARSE_FAILED_INVALID_POST_FORMAT, \
 2548|    204|                   "The request POST has broken encoding or format and " \
 2549|    204|                   "cannot be parsed.");
 2550|    204|      p_data->parse_result =
 2551|    204|        MHD_POST_PARSE_RES_FAILED_INVALID_POST_FORMAT;
 2552|    204|    }
 2553|    300|    tf->st = mhd_POST_TEXT_ST_NOT_STARTED;
 2554|    300|    c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
 2555|    300|    return true;
 2556|    300|  }
 2557|       |
 2558|    401|  mhd_assert (mhd_POST_TEXT_ST_AT_EQ != tf->st);
  ------------------
  |  |   66|    401|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2559|    401|  mhd_assert (mhd_POST_TEXT_ST_AT_CR != tf->st);
  ------------------
  |  |   66|    401|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2560|    401|  mhd_assert (mhd_POST_TEXT_ST_AT_LF_BARE != tf->st);
  ------------------
  |  |   66|    401|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2561|    401|  mhd_assert (mhd_POST_TEXT_ST_FULL_LINE_FOUND != tf->st);
  ------------------
  |  |   66|    401|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2562|       |
 2563|    401|  mhd_assert (*pdata_size == i);
  ------------------
  |  |   66|    401|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2564|       |
 2565|    401|  if ((mhd_POST_TEXT_ST_VALUE == tf->st)
  ------------------
  |  Branch (2565:7): [True: 85, False: 316]
  ------------------
 2566|     85|      && (i != tf->value_idx)
  ------------------
  |  Branch (2566:10): [True: 85, False: 0]
  ------------------
 2567|     85|      && is_value_streaming_needed (c, i - p_data->field_start))
  ------------------
  |  Branch (2567:10): [True: 14, False: 71]
  ------------------
 2568|     14|  {
 2569|     14|    if (process_partial_value (c,
  ------------------
  |  Branch (2569:9): [True: 14, False: 0]
  ------------------
 2570|     14|                               buf,
 2571|     14|                               &i,
 2572|     14|                               pdata_size,
 2573|     14|                               tf->name_idx,
 2574|     14|                               tf->name_len,
 2575|     14|                               tf->value_idx,
 2576|     14|                               i - tf->value_idx))
 2577|     14|    {
 2578|     14|      p_data->next_parse_pos = i;
 2579|     14|      return true;
 2580|     14|    }
 2581|     14|  }
 2582|       |
 2583|    387|  p_data->next_parse_pos = i;
 2584|    387|  return false; /* Continue parsing */
 2585|    401|}
post_parser_funcs.c:_ZL19report_low_lbuf_memP14MHD_Connection:
  584|    452|{
  585|    452|  mhd_LOG_MSG (c->daemon, \
  ------------------
  |  |   80|    452|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
  586|    452|               MHD_SC_REQ_POST_PARSE_FAILED_NO_LARGE_BUF_MEM, \
  587|    452|               "Not enough large shared buffer memory to " \
  588|    452|               "parse POST request.");
  589|    452|  c->rq.u_proc.post.parse_result =
  590|    452|    MHD_POST_PARSE_RES_FAILED_NO_LARGE_BUF_MEM;
  591|    452|  if (c->stage < mhd_HTTP_STAGE_FULL_REQ_RECEIVED)
  ------------------
  |  Branch (591:7): [True: 281, False: 171]
  ------------------
  592|    281|  {
  593|    281|    c->discard_request = true;
  594|    281|    c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
  595|       |
  596|    281|    return true;
  597|    281|  }
  598|    171|  return false;
  599|    452|}
post_parser_funcs.c:_ZL20check_post_leftoversP14MHD_Connection:
 3105|  1.15k|{
 3106|  1.15k|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 3107|       |  // TODO: implement processing in the connection buffer
 3108|  1.15k|  if (p_data->lbuf_used == c->rq.cntn.lbuf.size)
  ------------------
  |  Branch (3108:7): [True: 23, False: 1.13k]
  ------------------
 3109|     23|    (void)extend_lbuf_up_to (c,
 3110|     23|                             1,
 3111|     23|                             &(c->rq.cntn.lbuf));
 3112|       |
 3113|  1.15k|  switch (p_data->enc)
 3114|  1.15k|  {
 3115|    168|  case MHD_HTTP_POST_ENCODING_FORM_URLENCODED:
  ------------------
  |  Branch (3115:3): [True: 168, False: 989]
  ------------------
 3116|    168|    return check_post_leftovers_urlenc (c,
 3117|    168|                                        &(p_data->lbuf_used),
 3118|    168|                                        c->rq.cntn.lbuf.data);
 3119|    719|  case MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA:
  ------------------
  |  Branch (3119:3): [True: 719, False: 438]
  ------------------
 3120|    719|    return check_post_leftovers_mpart (c,
 3121|    719|                                       &(p_data->lbuf_used),
 3122|    719|                                       c->rq.cntn.lbuf.data);
 3123|    270|  case MHD_HTTP_POST_ENCODING_TEXT_PLAIN:
  ------------------
  |  Branch (3123:3): [True: 270, False: 887]
  ------------------
 3124|    270|    return check_post_leftovers_text (c,
 3125|    270|                                      &(p_data->lbuf_used),
 3126|    270|                                      c->rq.cntn.lbuf.data);
 3127|      0|  case MHD_HTTP_POST_ENCODING_OTHER:
  ------------------
  |  Branch (3127:3): [True: 0, False: 1.15k]
  ------------------
 3128|      0|  default:
  ------------------
  |  Branch (3128:3): [True: 0, False: 1.15k]
  ------------------
 3129|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 3130|      0|    p_data->parse_result =
 3131|      0|      MHD_POST_PARSE_RES_PARTIAL_INVALID_POST_FORMAT;
 3132|      0|    c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
 3133|      0|    break;
 3134|  1.15k|  }
 3135|      0|  return true;
 3136|  1.15k|}
post_parser_funcs.c:_ZL27check_post_leftovers_urlencP14MHD_ConnectionPmPc:
 2687|    168|{
 2688|    168|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 2689|    168|  struct mhd_PostParserUrlEncData *const uf = &(p_data->e_d.u_enc); /**< the current "text" field */
 2690|    168|  size_t pos;
 2691|    168|  size_t name_start;
 2692|    168|  size_t name_len;
 2693|    168|  size_t value_start;
 2694|    168|  size_t value_len;
 2695|    168|  bool have_extra_space;
 2696|    168|  bool need_value_stream;
 2697|       |
 2698|    168|  pos = p_data->next_parse_pos;  /* Points to the char AFTER the data */
 2699|    168|  mhd_assert (pos <= c->rq.cntn.lbuf.size); // TODO: support processing in connection buffer
  ------------------
  |  |   66|    168|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2700|    168|  mhd_assert (*pdata_size >= pos);
  ------------------
  |  |   66|    168|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2701|    168|  have_extra_space = (pos < c->rq.cntn.lbuf.size);
 2702|    168|  need_value_stream = false; /**< Value cannot be zero-terminated and must be streamed */
 2703|    168|  switch (uf->st)
 2704|    168|  {
 2705|    168|  case mhd_POST_UENC_ST_NOT_STARTED:
  ------------------
  |  Branch (2705:3): [True: 168, False: 0]
  ------------------
 2706|    168|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|    168|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2707|    168|    return false; /* Continue processing */
 2708|      0|  case mhd_POST_UENC_ST_NAME:
  ------------------
  |  Branch (2708:3): [True: 0, False: 168]
  ------------------
 2709|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2710|       |    /* Unfinished name */
 2711|      0|    name_start = uf->name_idx;
 2712|      0|    if (uf->last_pct_idx != mhd_POST_INVALID_POS)
  ------------------
  |  |   58|      0|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
  |  Branch (2712:9): [True: 0, False: 0]
  ------------------
 2713|      0|      name_len = mhd_str_pct_decode_lenient_n (buf + uf->name_idx,
 2714|      0|                                               pos - uf->name_idx,
 2715|      0|                                               buf + uf->name_idx,
 2716|      0|                                               pos - uf->name_idx,
 2717|      0|                                               NULL);
 2718|      0|    else
 2719|      0|      name_len = pos - uf->name_idx;
 2720|      0|    mhd_assert (name_start + name_len <= pos);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2721|      0|    if (!have_extra_space
  ------------------
  |  Branch (2721:9): [True: 0, False: 0]
  ------------------
 2722|      0|        && (name_start + name_len == pos))
  ------------------
  |  Branch (2722:12): [True: 0, False: 0]
  ------------------
 2723|      0|      return report_low_lbuf_mem (c);
 2724|      0|    buf[name_start + name_len] = 0; /* Zero-terminate the result, an extra byte is available */
 2725|      0|    value_start = 0;
 2726|      0|    value_len = 0;
 2727|      0|    break;
 2728|      0|  case mhd_POST_UENC_ST_EQ_FOUND:
  ------------------
  |  Branch (2728:3): [True: 0, False: 168]
  ------------------
 2729|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2730|      0|    name_start = uf->name_idx;
 2731|      0|    name_len = uf->name_len;
 2732|      0|    value_start = pos;
 2733|      0|    value_len = 0;
 2734|      0|    if (!have_extra_space)
  ------------------
  |  Branch (2734:9): [True: 0, False: 0]
  ------------------
 2735|      0|      need_value_stream = true;
 2736|      0|    else
 2737|      0|      buf[value_start] = 0; /* Zero-terminate the result, an extra byte is available */
 2738|      0|    break;
 2739|      0|  case mhd_POST_UENC_ST_VALUE:
  ------------------
  |  Branch (2739:3): [True: 0, False: 168]
  ------------------
 2740|      0|    mhd_assert (0 != uf->value_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2741|      0|    name_start = uf->name_idx;
 2742|      0|    name_len = uf->name_len;
 2743|      0|    mhd_assert (0 == buf[name_start + name_len]);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2744|      0|    if (0 != uf->value_len)
  ------------------
  |  Branch (2744:9): [True: 0, False: 0]
  ------------------
 2745|      0|    {
 2746|       |      /* The value was partially decoded and then application requested stream
 2747|       |       * suspending. */
 2748|      0|      mhd_assert (pos < *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2749|      0|      mhd_assert (2 >= *pdata_size - pos);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2750|      0|      value_start = uf->value_idx;
 2751|      0|      if (uf->value_idx + uf->value_len != pos)
  ------------------
  |  Branch (2751:11): [True: 0, False: 0]
  ------------------
 2752|      0|        memmove (buf + uf->value_idx + uf->value_len,
 2753|      0|                 buf + pos,
 2754|      0|                 *pdata_size - pos);
 2755|      0|      value_len = uf->value_len + *pdata_size - pos;
 2756|      0|    }
 2757|      0|    else
 2758|      0|    {
 2759|       |      /* The value has not been decoded yet */
 2760|      0|      mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2761|      0|      value_start = uf->value_idx;
 2762|      0|      if (uf->last_pct_idx != mhd_POST_INVALID_POS)
  ------------------
  |  |   58|      0|#  define mhd_POST_INVALID_POS SIZE_MAX
  ------------------
  |  Branch (2762:11): [True: 0, False: 0]
  ------------------
 2763|      0|        value_len = mhd_str_pct_decode_lenient_n (buf + uf->value_idx,
 2764|      0|                                                  pos - uf->value_idx,
 2765|      0|                                                  buf + uf->value_idx,
 2766|      0|                                                  pos - uf->value_idx,
 2767|      0|                                                  NULL);
 2768|      0|      else
 2769|      0|        value_len = pos - uf->value_idx;
 2770|      0|    }
 2771|      0|    if (!have_extra_space
  ------------------
  |  Branch (2771:9): [True: 0, False: 0]
  ------------------
 2772|      0|        && (value_start + value_len == pos))
  ------------------
  |  Branch (2772:12): [True: 0, False: 0]
  ------------------
 2773|      0|      need_value_stream = true;
 2774|      0|    else
 2775|      0|      buf[value_start + value_len] = 0; /* Zero-terminate the result, an extra byte is available in the buffer */
 2776|      0|    break;
 2777|      0|  case mhd_POST_UENC_ST_FULL_FIELD_FOUND:
  ------------------
  |  Branch (2777:3): [True: 0, False: 168]
  ------------------
 2778|       |    /* Full value was found, but the stream has been suspended by
 2779|       |     * the application */
 2780|      0|    mhd_assert (pos + 1 == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2781|      0|    mhd_assert (0 != uf->value_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2782|      0|    mhd_assert (pos != uf->value_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2783|      0|    name_start = uf->name_idx;
 2784|      0|    name_len = uf->name_len;
 2785|      0|    value_start = uf->value_idx;
 2786|      0|    value_len = uf->value_len;
 2787|      0|    mhd_assert (0 == buf[name_start + name_len]);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2788|      0|    mhd_assert (0 == buf[value_start + value_len]);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2789|      0|    ++pos;
 2790|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2791|      0|    break;
 2792|      0|  case mhd_POST_UENC_ST_AT_EQ:
  ------------------
  |  Branch (2792:3): [True: 0, False: 168]
  ------------------
 2793|      0|  case mhd_POST_UENC_ST_AT_AMPRSND:
  ------------------
  |  Branch (2793:3): [True: 0, False: 168]
  ------------------
 2794|      0|  default:
  ------------------
  |  Branch (2794:3): [True: 0, False: 168]
  ------------------
 2795|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 2796|      0|    p_data->parse_result = MHD_POST_PARSE_RES_FAILED_INVALID_POST_FORMAT;
 2797|      0|    return false;
 2798|    168|  }
 2799|       |
 2800|       |  /* Have field data */
 2801|       |
 2802|      0|  p_data->next_parse_pos = pos;
 2803|       |
 2804|      0|  if (need_value_stream)
  ------------------
  |  Branch (2804:7): [True: 0, False: 0]
  ------------------
 2805|      0|  {
 2806|      0|    if (NULL != c->rq.app_act.head_act.data.post_parse.stream_reader)
  ------------------
  |  Branch (2806:9): [True: 0, False: 0]
  ------------------
 2807|      0|      p_data->force_streamed = true;
 2808|      0|    else
 2809|      0|      return report_low_lbuf_mem (c);
 2810|      0|  }
 2811|       |
 2812|      0|  if (process_complete_field (c,
  ------------------
  |  Branch (2812:7): [True: 0, False: 0]
  ------------------
 2813|      0|                              buf,
 2814|      0|                              &(p_data->next_parse_pos),
 2815|      0|                              pdata_size,
 2816|      0|                              p_data->field_start,
 2817|      0|                              name_start,
 2818|      0|                              name_len,
 2819|      0|                              value_start,
 2820|      0|                              value_len))
 2821|      0|    return true;
 2822|       |
 2823|      0|  reset_parse_field_data_urlenc (p_data);
 2824|       |
 2825|      0|  return false; /* Continue normal processing */
 2826|      0|}
post_parser_funcs.c:_ZL26check_post_leftovers_mpartP14MHD_ConnectionPmPc:
 2843|    719|{
 2844|    719|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 2845|    719|  struct mhd_PostParserMPartFormData *const mf = &(p_data->e_d.m_form); /**< the current "form-data" parsing details */
 2846|    719|  size_t pos;
 2847|    719|  bool not_terminated;
 2848|    719|  bool add_field;
 2849|    719|  size_t value_pos;
 2850|    719|  size_t value_len;
 2851|       |
 2852|    719|  pos = p_data->next_parse_pos;  /* Points to the char AFTER the data, valid location as buffer is always at least one byte larger */
 2853|    719|  mhd_assert (pos <= c->rq.cntn.lbuf.size); // TODO: support processing in connection buffer
  ------------------
  |  |   66|    719|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2854|    719|  mhd_assert (*pdata_size >= pos);
  ------------------
  |  |   66|    719|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2855|       |
 2856|    719|  not_terminated = false;
 2857|    719|  add_field = false;
 2858|    719|  value_pos = 0;
 2859|    719|  value_len = 0;
 2860|       |
 2861|    719|  switch (mf->st)
 2862|    719|  {
 2863|    719|  case mhd_POST_MPART_ST_NOT_STARTED:
  ------------------
  |  Branch (2863:3): [True: 719, False: 0]
  ------------------
 2864|    719|  case mhd_POST_MPART_ST_PREAMBL:
  ------------------
  |  Branch (2864:3): [True: 0, False: 719]
  ------------------
 2865|    719|  case mhd_POST_MPART_ST_PREAMBL_CR_FOUND:
  ------------------
  |  Branch (2865:3): [True: 0, False: 719]
  ------------------
 2866|    719|  case mhd_POST_MPART_ST_PREAMBL_CHECKING_FOR_DELIM:
  ------------------
  |  Branch (2866:3): [True: 0, False: 719]
  ------------------
 2867|    719|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|    719|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2868|    719|    return false; /* Continue processing */
 2869|      0|  case mhd_POST_MPART_ST_FIRST_DELIM_FOUND:
  ------------------
  |  Branch (2869:3): [True: 0, False: 719]
  ------------------
 2870|      0|  case mhd_POST_MPART_ST_FIRST_PART_START:
  ------------------
  |  Branch (2870:3): [True: 0, False: 719]
  ------------------
 2871|      0|  case mhd_POST_MPART_ST_PART_START:
  ------------------
  |  Branch (2871:3): [True: 0, False: 719]
  ------------------
 2872|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2873|      0|    not_terminated = true;
 2874|      0|    break;
 2875|      0|  case mhd_POST_MPART_ST_HEADER_LINE_START:
  ------------------
  |  Branch (2875:3): [True: 0, False: 719]
  ------------------
 2876|      0|  case mhd_POST_MPART_ST_HEADER_LINE:
  ------------------
  |  Branch (2876:3): [True: 0, False: 719]
  ------------------
 2877|      0|  case mhd_POST_MPART_ST_HEADER_LINE_CR_FOUND:
  ------------------
  |  Branch (2877:3): [True: 0, False: 719]
  ------------------
 2878|      0|  case mhd_POST_MPART_ST_VALUE_START:
  ------------------
  |  Branch (2878:3): [True: 0, False: 719]
  ------------------
 2879|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2880|      0|    not_terminated = true;
 2881|      0|    add_field = (0 != mf->f.name_idx);
 2882|      0|    break;
 2883|      0|  case mhd_POST_MPART_ST_VALUE:
  ------------------
  |  Branch (2883:3): [True: 0, False: 719]
  ------------------
 2884|      0|  case mhd_POST_MPART_ST_VALUE_CR_FOUND:
  ------------------
  |  Branch (2884:3): [True: 0, False: 719]
  ------------------
 2885|      0|  case mhd_POST_MPART_ST_VALUE_LINE_START:
  ------------------
  |  Branch (2885:3): [True: 0, False: 719]
  ------------------
 2886|      0|  case mhd_POST_MPART_ST_VALUE_CHECKING_FOR_DELIM:
  ------------------
  |  Branch (2886:3): [True: 0, False: 719]
  ------------------
 2887|      0|    mhd_assert (0 != mf->f.name_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2888|      0|    mhd_assert (0 != mf->f.value_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2889|      0|    not_terminated = true;
 2890|      0|    add_field = true;
 2891|      0|    value_pos = mf->f.value_idx;
 2892|      0|    mhd_ASSUME (pos >= value_pos);
  ------------------
  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  ------------------
  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  ------------------
  ------------------
 2893|      0|    value_len = pos - value_pos;
 2894|      0|    break;
 2895|      0|  case mhd_POST_MPART_ST_DELIM_FOUND:
  ------------------
  |  Branch (2895:3): [True: 0, False: 719]
  ------------------
 2896|      0|    mhd_assert (0 != mf->f.name_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2897|      0|    mhd_assert (mhd_POST_INVALID_POS != mf->delim_check_start);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2898|      0|    mhd_assert (pos > mf->delim_check_start);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2899|      0|    not_terminated = true;
 2900|      0|    add_field = true;
 2901|      0|    if (0 != mf->f.value_idx)
  ------------------
  |  Branch (2901:9): [True: 0, False: 0]
  ------------------
 2902|      0|    {
 2903|      0|      value_pos = mf->f.value_idx;
 2904|      0|      mhd_ASSUME (mf->delim_check_start >= mf->f.value_idx);
  ------------------
  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  ------------------
  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  ------------------
  ------------------
 2905|      0|      value_len = mf->delim_check_start - mf->f.value_idx;
 2906|      0|    }
 2907|      0|    break;
 2908|      0|  case mhd_POST_MPART_ST_FULL_FIELD_FOUND:
  ------------------
  |  Branch (2908:3): [True: 0, False: 719]
  ------------------
 2909|      0|    not_terminated = true;
 2910|      0|    mhd_FALLTHROUGH;
  ------------------
  |  | 1300|      0|#define mhd_FALLTHROUGH [[fallthrough]]
  ------------------
 2911|       |  /* Intentional fallthrough */
 2912|      0|  case mhd_POST_MPART_ST_FULL_FIELD_FOUND_FINAL:
  ------------------
  |  Branch (2912:3): [True: 0, False: 719]
  ------------------
 2913|      0|    mhd_assert (0 != mf->f.name_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2914|      0|    add_field = true;
 2915|      0|    if (0 != mf->f.value_idx)
  ------------------
  |  Branch (2915:9): [True: 0, False: 0]
  ------------------
 2916|      0|    {
 2917|      0|      value_pos = mf->f.value_idx;
 2918|      0|      value_len = mf->f.value_len;
 2919|      0|    }
 2920|      0|    break;
 2921|      0|  case mhd_POST_MPART_ST_EPILOGUE:
  ------------------
  |  Branch (2921:3): [True: 0, False: 719]
  ------------------
 2922|      0|  case mhd_POST_MPART_ST_FORMAT_ERROR:
  ------------------
  |  Branch (2922:3): [True: 0, False: 719]
  ------------------
 2923|      0|    return false; /* Continue processing */
 2924|      0|  case mhd_POST_MPART_ST_BACK_TO_PREAMBL:
  ------------------
  |  Branch (2924:3): [True: 0, False: 719]
  ------------------
 2925|      0|  case mhd_POST_MPART_ST_PREAMBL_LINE_START:
  ------------------
  |  Branch (2925:3): [True: 0, False: 719]
  ------------------
 2926|      0|  case mhd_POST_MPART_ST_HEADER_LINE_END:
  ------------------
  |  Branch (2926:3): [True: 0, False: 719]
  ------------------
 2927|      0|  case mhd_POST_MPART_ST_BACK_TO_VALUE:
  ------------------
  |  Branch (2927:3): [True: 0, False: 719]
  ------------------
 2928|      0|  case mhd_POST_MPART_ST_VALUE_END_FOUND:
  ------------------
  |  Branch (2928:3): [True: 0, False: 719]
  ------------------
 2929|      0|  case mhd_POST_MPART_ST_VALUE_END_FOUND_FINAL:
  ------------------
  |  Branch (2929:3): [True: 0, False: 719]
  ------------------
 2930|      0|  default:
  ------------------
  |  Branch (2930:3): [True: 0, False: 719]
  ------------------
 2931|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 2932|      0|    p_data->parse_result = MHD_POST_PARSE_RES_FAILED_INVALID_POST_FORMAT;
 2933|      0|    return false;
 2934|    719|  }
 2935|       |
 2936|      0|  if (not_terminated)
  ------------------
  |  Branch (2936:7): [True: 0, False: 0]
  ------------------
 2937|      0|    report_invalid_termination (c); /* The "closing" delimiter is missing */
 2938|       |
 2939|      0|  if (add_field)
  ------------------
  |  Branch (2939:7): [True: 0, False: 0]
  ------------------
 2940|      0|  {
 2941|      0|    if (c->rq.cntn.lbuf.size > (value_pos + value_len))
  ------------------
  |  Branch (2941:9): [True: 0, False: 0]
  ------------------
 2942|      0|      buf[value_pos + value_len] = 0;  /* Zero-terminate the value */
 2943|      0|    else if (NULL != c->rq.app_act.head_act.data.post_parse.stream_reader)
  ------------------
  |  Branch (2943:14): [True: 0, False: 0]
  ------------------
 2944|      0|      p_data->force_streamed = true;
 2945|      0|    else
 2946|      0|      return report_low_lbuf_mem (c);
 2947|       |
 2948|      0|    p_data->next_parse_pos = pos;
 2949|       |
 2950|      0|    if (process_complete_field_all (c,
  ------------------
  |  Branch (2950:9): [True: 0, False: 0]
  ------------------
 2951|      0|                                    buf,
 2952|      0|                                    &p_data->next_parse_pos,
 2953|      0|                                    pdata_size,
 2954|      0|                                    p_data->field_start,
 2955|      0|                                    mf->f.name_idx,
 2956|      0|                                    mf->f.name_len,
 2957|      0|                                    mf->f.filename_idx,
 2958|      0|                                    mf->f.filename_len,
 2959|      0|                                    mf->f.cntn_type_idx,
 2960|      0|                                    mf->f.cntn_type_len,
 2961|      0|                                    mf->f.enc_idx,
 2962|      0|                                    mf->f.enc_len,
 2963|      0|                                    value_pos,
 2964|      0|                                    value_len))
 2965|      0|      return true;
 2966|      0|  }
 2967|       |
 2968|      0|  reset_parse_field_data_mpart_cont (p_data,
 2969|      0|                                     !not_terminated);
 2970|       |
 2971|      0|  return false; /* Continue normal processing */
 2972|      0|}
post_parser_funcs.c:_ZL25check_post_leftovers_textP14MHD_ConnectionPmPc:
 2989|    270|{
 2990|    270|  struct mhd_PostParserData *const p_data = &(c->rq.u_proc.post);
 2991|    270|  struct mhd_PostParserTextData *const tf = &(p_data->e_d.text); /**< the current "text" field */
 2992|    270|  size_t pos;
 2993|    270|  size_t name_start;
 2994|    270|  size_t name_len;
 2995|    270|  size_t value_start;
 2996|    270|  size_t value_len;
 2997|       |
 2998|    270|  pos = p_data->next_parse_pos;  /* Points to the char AFTER the data, valid location as buffer is always at least one byte larger */
 2999|    270|  mhd_assert (pos <= c->rq.cntn.lbuf.size); // TODO: support processing in connection buffer
  ------------------
  |  |   66|    270|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3000|    270|  switch (tf->st)
 3001|    270|  {
 3002|    270|  case mhd_POST_TEXT_ST_NOT_STARTED:
  ------------------
  |  Branch (3002:3): [True: 270, False: 0]
  ------------------
 3003|    270|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|    270|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3004|    270|    return false; /* Continue processing */
 3005|      0|  case mhd_POST_TEXT_ST_NAME:
  ------------------
  |  Branch (3005:3): [True: 0, False: 270]
  ------------------
 3006|       |    /* Unfinished name */
 3007|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3008|      0|    name_start = tf->name_idx;
 3009|      0|    name_len = pos - name_start;
 3010|      0|    if (pos == c->rq.cntn.lbuf.size)
  ------------------
  |  Branch (3010:9): [True: 0, False: 0]
  ------------------
 3011|      0|      return report_low_lbuf_mem (c);
 3012|      0|    buf[pos] = 0; /* Zero-terminate the result, an extra byte is available */
 3013|      0|    value_start = 0;
 3014|      0|    value_len = 0;
 3015|      0|    break;
 3016|      0|  case mhd_POST_TEXT_ST_EQ_FOUND:
  ------------------
  |  Branch (3016:3): [True: 0, False: 270]
  ------------------
 3017|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3018|      0|    name_start = tf->name_idx;
 3019|      0|    name_len = tf->name_len;
 3020|      0|    value_start = pos;
 3021|      0|    value_len = 0;
 3022|      0|    break;
 3023|      0|  case mhd_POST_TEXT_ST_VALUE:
  ------------------
  |  Branch (3023:3): [True: 0, False: 270]
  ------------------
 3024|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3025|      0|    mhd_assert (0 != tf->value_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3026|      0|    mhd_assert (pos != tf->value_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3027|      0|    name_start = tf->name_idx;
 3028|      0|    name_len = tf->name_len;
 3029|      0|    value_start = tf->value_idx;
 3030|      0|    value_len = pos - value_start;
 3031|      0|    break;
 3032|      0|  case mhd_POST_TEXT_ST_CR_FOUND:
  ------------------
  |  Branch (3032:3): [True: 0, False: 270]
  ------------------
 3033|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3034|      0|    mhd_assert (0 != tf->value_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3035|      0|    mhd_assert (pos != tf->value_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3036|      0|    name_start = tf->name_idx;
 3037|      0|    name_len = tf->name_len;
 3038|      0|    value_start = tf->value_idx;
 3039|      0|    value_len = tf->value_len;
 3040|      0|    mhd_assert (value_start + value_len + 1 == pos);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3041|      0|    mhd_assert (0 == buf[value_start + value_len]);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3042|      0|    break;
 3043|      0|  case mhd_POST_TEXT_ST_FULL_LINE_FOUND:
  ------------------
  |  Branch (3043:3): [True: 0, False: 270]
  ------------------
 3044|       |    /* Full value was found, but the stream has been suspended by
 3045|       |     * the application */
 3046|      0|    mhd_assert (pos + 1 == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3047|      0|    mhd_assert (0 != tf->value_idx);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3048|      0|    name_start = tf->name_idx;
 3049|      0|    name_len = tf->name_len;
 3050|      0|    value_start = tf->value_idx;
 3051|      0|    value_len = tf->value_len;
 3052|      0|    mhd_assert ((value_start + value_len + 1 == pos) \
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3053|      0|                || (value_start + value_len + 2 == pos));
 3054|      0|    mhd_assert (0 == buf[value_start + value_len]);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3055|      0|    ++pos;
 3056|      0|    mhd_assert (pos == *pdata_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3057|      0|    break;
 3058|      0|  case mhd_POST_TEXT_ST_AT_EQ:
  ------------------
  |  Branch (3058:3): [True: 0, False: 270]
  ------------------
 3059|      0|  case mhd_POST_TEXT_ST_AT_LF_BARE:
  ------------------
  |  Branch (3059:3): [True: 0, False: 270]
  ------------------
 3060|      0|  case mhd_POST_TEXT_ST_AT_CR:
  ------------------
  |  Branch (3060:3): [True: 0, False: 270]
  ------------------
 3061|      0|  default:
  ------------------
  |  Branch (3061:3): [True: 0, False: 270]
  ------------------
 3062|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 3063|      0|    p_data->parse_result = MHD_POST_PARSE_RES_FAILED_INVALID_POST_FORMAT;
 3064|      0|    return false;
 3065|    270|  }
 3066|       |
 3067|      0|  if (tf->st != mhd_POST_TEXT_ST_FULL_LINE_FOUND)
  ------------------
  |  Branch (3067:7): [True: 0, False: 0]
  ------------------
 3068|      0|    report_invalid_termination (c); /* The line must be terminated by CRLF, but it is not */
 3069|       |
 3070|      0|  if (0 != value_start)
  ------------------
  |  Branch (3070:7): [True: 0, False: 0]
  ------------------
 3071|      0|  {
 3072|      0|    if (c->rq.cntn.lbuf.size > (value_start + value_len))
  ------------------
  |  Branch (3072:9): [True: 0, False: 0]
  ------------------
 3073|      0|      buf[value_start + value_len] = 0;  /* Zero-terminate the value */
 3074|      0|    else if (NULL != c->rq.app_act.head_act.data.post_parse.stream_reader)
  ------------------
  |  Branch (3074:14): [True: 0, False: 0]
  ------------------
 3075|      0|      p_data->force_streamed = true;
 3076|      0|    else
 3077|      0|      return report_low_lbuf_mem (c);
 3078|      0|  }
 3079|       |
 3080|      0|  if (process_complete_field (c,
  ------------------
  |  Branch (3080:7): [True: 0, False: 0]
  ------------------
 3081|      0|                              buf,
 3082|      0|                              &pos,
 3083|      0|                              pdata_size,
 3084|      0|                              p_data->field_start,
 3085|      0|                              name_start,
 3086|      0|                              name_len,
 3087|      0|                              value_start,
 3088|      0|                              value_len))
 3089|      0|    return true;
 3090|       |
 3091|      0|  reset_parse_field_data_text (p_data);
 3092|       |
 3093|      0|  return false; /* Continue normal processing */
 3094|      0|}

_Z29mhd_stream_add_field_nullableP10MHD_Stream13MHD_ValueKindPK10MHD_StringPK18MHD_StringNullable:
   63|  5.31k|{
   64|  5.31k|  struct mhd_RequestField *f;
   65|  5.31k|  struct MHD_Connection *const c =
   66|  5.31k|    mhd_CNTNR_PTR (s, struct MHD_Connection, h1_stream);
  ------------------
  |  |   67|  5.31k|        ((cntnr_type*) (void*)                              \
  |  |   68|  5.31k|         (((char*) (0 ?                                     \
  |  |  ------------------
  |  |  |  Branch (68:21): [Folded, False: 5.31k]
  |  |  ------------------
  |  |   69|  5.31k|                    (&(((cntnr_type*) NULL)->membr_name)) : \
  |  |   70|  5.31k|                    (membr_ptr))) - offsetof (cntnr_type,membr_name)))
  ------------------
   67|       |
   68|  5.31k|  f = (struct mhd_RequestField *)
   69|  5.31k|      mhd_stream_alloc_memory (c, sizeof(struct mhd_RequestField));
   70|  5.31k|  if (NULL == f)
  ------------------
  |  Branch (70:7): [True: 55, False: 5.26k]
  ------------------
   71|     55|    return false;
   72|       |
   73|  5.26k|  f->field.nv.name = *name;
   74|  5.26k|  f->field.nv.value = *value;
   75|  5.26k|  f->field.kind = kind;
   76|  5.26k|  mhd_DLINKEDL_INIT_LINKS (f, fields);
  ------------------
  |  |  313|  5.26k|        do {(p_obj)->links_name.prev = NULL;       \
  |  |  314|  5.26k|            (p_obj)->links_name.next = NULL;} while (0)
  |  |  ------------------
  |  |  |  Branch (314:54): [Folded, False: 5.26k]
  |  |  ------------------
  ------------------
   77|       |
   78|  5.26k|  mhd_DLINKEDL_INS_LAST (&(c->rq), f, fields);
  ------------------
  |  |  340|  5.26k|        mhd_DLINKEDL_INS_LAST_D (&((p_own)->l_name),(p_obj),l_name)
  |  |  ------------------
  |  |  |  |  192|  5.26k|#define mhd_DLINKEDL_INS_LAST_D(p_list, p_obj, links_name) do { \
  |  |  |  |  193|  5.26k|        mhd_ASSUME (NULL == (p_obj)->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  5.26k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  5.26k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  194|  5.26k|        mhd_ASSUME (NULL == (p_obj)->links_name.next); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  5.26k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  5.26k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  195|  5.26k|        mhd_ASSUME ((p_obj) != (p_list)->first);       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  5.26k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  5.26k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  196|  5.26k|        mhd_ASSUME ((p_obj) != (p_list)->last);        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  5.26k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  5.26k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  197|  5.26k|        if (NULL != (p_list)->last)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (197:13): [True: 2.57k, False: 2.68k]
  |  |  |  |  ------------------
  |  |  |  |  198|  5.26k|        { mhd_ASSUME (NULL == (p_list)->last->links_name.next);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  2.57k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  2.57k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  199|  2.57k|          mhd_ASSUME (NULL == (p_list)->first->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  2.57k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  2.57k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  200|  2.57k|          mhd_ASSUME ((p_obj) != (p_list)->last->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  2.57k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  2.57k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  201|  2.57k|          mhd_ASSUME (NULL != (p_list)->first);                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  2.57k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  2.57k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  202|  2.57k|          ((p_obj)->links_name.prev = (p_list)->last)           \
  |  |  |  |  203|  2.57k|          ->links_name.next = (p_obj); } else \
  |  |  |  |  204|  5.26k|        { mhd_ASSUME (NULL == (p_list)->first);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  2.68k|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|  2.68k|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  205|  2.68k|          (p_list)->first = (p_obj); }                      \
  |  |  |  |  206|  5.26k|        (p_list)->last = (p_obj);  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (206:45): [Folded, False: 5.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|       |
   80|  5.26k|  return true;
   81|  5.31k|}
_Z20mhd_stream_add_fieldP10MHD_Stream13MHD_ValueKindPK10MHD_StringS4_:
   89|  5.00k|{
   90|  5.00k|  struct MHD_StringNullable value2;
   91|       |
   92|  5.00k|  value2.len = value->len;
   93|  5.00k|  value2.cstr = value->cstr;
   94|       |
   95|  5.00k|  return mhd_stream_add_field_nullable (s, kind, name, &value2);
   96|  5.00k|}

_Z23mhd_request_get_value_nP11MHD_Request13MHD_ValueKindmPKcP18MHD_StringNullable:
   75|  2.66k|{
   76|  2.66k|  mhd_assert (strlen (key) == key_len);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
   77|  2.66k|  value_out->len = 0u;
   78|  2.66k|  value_out->cstr = NULL;
   79|       |
   80|  2.66k|  mhd_assert (strlen (key) == key_len);
  ------------------
  |  |   66|  2.66k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
   81|       |
   82|  2.66k|#ifdef MHD_SUPPORT_HTTP2
   83|  2.66k|  if (mhd_REQ_IS_HTTP2 (request))
  ------------------
  |  |  556|  2.66k|#define mhd_REQ_IS_HTTP2(req)           mhd_HNDL_IS_HTTP2 (req)
  |  |  ------------------
  |  |  |  |   97|  2.66k|#  define mhd_HNDL_IS_HTTP2(handle)     (mhd_HNDL_TAG_ (handle)->is_http2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  2.66k|        ((const struct mhd_HandleTag *) (const void *) (handle))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (97:41): [True: 0, False: 2.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|      0|    return mhd_h2_request_get_value_n (request,
   85|      0|                                       kind,
   86|      0|                                       key_len,
   87|      0|                                       key,
   88|      0|                                       value_out);
   89|  2.66k|#endif /* MHD_SUPPORT_HTTP2 */
   90|       |
   91|  2.66k|  if (MHD_VK_POSTDATA != kind)
  ------------------
  |  Branch (91:7): [True: 2.66k, False: 0]
  ------------------
   92|  2.66k|  {
   93|  2.66k|    struct mhd_RequestField *f;
   94|       |
   95|  5.42k|    for (f = mhd_DLINKEDL_GET_FIRST (request, fields); NULL != f;
  ------------------
  |  |  362|  2.66k|        mhd_DLINKEDL_GET_FIRST_D (&((p_own)->list_name))
  |  |  ------------------
  |  |  |  |  248|  2.66k|#define mhd_DLINKEDL_GET_FIRST_D(p_list) ((p_list)->first)
  |  |  ------------------
  ------------------
  |  Branch (95:56): [True: 5.01k, False: 413]
  ------------------
   96|  2.76k|         f = mhd_DLINKEDL_GET_NEXT (f, fields))
  ------------------
  |  |  377|  2.76k|#define mhd_DLINKEDL_GET_NEXT(p_obj, links_name) ((p_obj)->links_name.next)
  ------------------
   97|  5.01k|    {
   98|  5.01k|      if ((key_len == f->field.nv.name.len)
  ------------------
  |  Branch (98:11): [True: 2.25k, False: 2.76k]
  ------------------
   99|  2.25k|          && (0 != (kind & f->field.kind))
  ------------------
  |  Branch (99:14): [True: 2.25k, False: 0]
  ------------------
  100|  2.25k|          && mhd_str_equal_caseless_bin_n (key,
  ------------------
  |  Branch (100:14): [True: 2.25k, False: 0]
  ------------------
  101|  2.25k|                                           f->field.nv.name.cstr,
  102|  2.25k|                                           key_len))
  103|  2.25k|      {
  104|  2.25k|        *value_out = f->field.nv.value;
  105|  2.25k|        return true;
  106|  2.25k|      }
  107|  5.01k|    }
  108|  2.66k|  }
  109|       |
  110|    413|#if MHD_SUPPORT_POST_PARSER
  111|    413|  if (0 != (MHD_VK_POSTDATA & kind))
  ------------------
  |  Branch (111:7): [True: 0, False: 413]
  ------------------
  112|      0|  {
  113|      0|    struct mhd_RequestPostField *f;
  114|      0|    char *const buf = request->cntn.lbuf.data; // TODO: support processing in connection buffer
  115|      0|    for (f = mhd_DLINKEDL_GET_FIRST (request, post_fields); NULL != f;
  ------------------
  |  |  362|      0|        mhd_DLINKEDL_GET_FIRST_D (&((p_own)->list_name))
  |  |  ------------------
  |  |  |  |  248|      0|#define mhd_DLINKEDL_GET_FIRST_D(p_list) ((p_list)->first)
  |  |  ------------------
  ------------------
  |  Branch (115:61): [True: 0, False: 0]
  ------------------
  116|      0|         f = mhd_DLINKEDL_GET_NEXT (f, post_fields))
  ------------------
  |  |  377|      0|#define mhd_DLINKEDL_GET_NEXT(p_obj, links_name) ((p_obj)->links_name.next)
  ------------------
  117|      0|    {
  118|      0|      if ((key_len == f->field.name.len)
  ------------------
  |  Branch (118:11): [True: 0, False: 0]
  ------------------
  119|      0|          && mhd_str_equal_caseless_bin_n (key,
  ------------------
  |  Branch (119:14): [True: 0, False: 0]
  ------------------
  120|      0|                                           buf + f->field.name.pos,
  121|      0|                                           key_len))
  122|      0|      {
  123|      0|        value_out->cstr =
  124|      0|          (0 == f->field.value.pos) ?
  ------------------
  |  Branch (124:11): [True: 0, False: 0]
  ------------------
  125|      0|          NULL : (buf + f->field.value.pos);
  126|      0|        value_out->len = f->field.value.len;
  127|       |
  128|      0|        mhd_assert ((NULL != value_out->cstr) \
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  129|      0|                    || (0 == value_out->len));
  130|       |
  131|      0|        return true;
  132|      0|      }
  133|      0|    }
  134|      0|  }
  135|    413|#endif /* MHD_SUPPORT_POST_PARSER */
  136|       |
  137|    413|  return false;
  138|    413|}

_Z22respond_with_error_lenP14MHD_ConnectionjmPKcmPc:
   79|    522|{
   80|    522|  struct MHD_Response *err_res;
   81|       |
   82|    522|  mhd_assert (!c->stop_with_error);  /* Do not send error twice */
  ------------------
  |  |   66|    522|#  define mhd_assert(ignore) ((void) 0)
  ------------------
   83|    522|  mhd_assert (mhd_HTTP_STAGE_REQ_RECV_FINISHED >= c->stage);
  ------------------
  |  |   66|    522|#  define mhd_assert(ignore) ((void) 0)
  ------------------
   84|       |
   85|       |  /* Discard most of the request data */
   86|       |
   87|    522|  if (NULL != c->rq.cntn.lbuf.data)
  ------------------
  |  Branch (87:7): [True: 0, False: 522]
  ------------------
   88|      0|    mhd_daemon_free_lbuf (c->daemon, &(c->rq.cntn.lbuf));
   89|    522|  c->rq.cntn.lbuf.data = NULL;
   90|       |
   91|    522|  c->write_buffer = NULL;
   92|    522|  c->write_buffer_size = 0;
   93|    522|  c->write_buffer_send_offset = 0;
   94|    522|  c->write_buffer_append_offset = 0;
   95|       |
   96|    522|  mhd_DLINKEDL_INIT_LIST (&(c->rq), fields);
  ------------------
  |  |  303|    522|        mhd_DLINKEDL_INIT_LIST_D (&((p_own)->list_name))
  |  |  ------------------
  |  |  |  |  156|    522|        do {(p_list)->first = NULL; (p_list)->last = NULL;} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (156:68): [Folded, False: 522]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   97|    522|  c->rq.version = NULL;
   98|    522|  c->rq.method.len = 0;
   99|    522|  c->rq.method.cstr = NULL;
  100|    522|  c->rq.url = NULL;
  101|    522|  c->continue_message_write_offset = 0;
  102|    522|  if (0 != c->read_buffer_size)
  ------------------
  |  Branch (102:7): [True: 423, False: 99]
  ------------------
  103|    423|  {
  104|    423|    mhd_pool_deallocate (c->pool,
  105|    423|                         c->read_buffer,
  106|    423|                         c->read_buffer_size);
  107|    423|    c->read_buffer = NULL;
  108|    423|    c->read_buffer_size = 0;
  109|    423|    c->read_buffer_offset = 0;
  110|    423|  }
  111|       |
  112|    522|  c->stop_with_error = true;
  113|    522|  c->discard_request = true;
  114|    522|  if ((MHD_HTTP_STATUS_CONTENT_TOO_LARGE == http_code)
  ------------------
  |  Branch (114:7): [True: 275, False: 247]
  ------------------
  115|    247|      || (MHD_HTTP_STATUS_URI_TOO_LONG == http_code)
  ------------------
  |  Branch (115:10): [True: 21, False: 226]
  ------------------
  116|    226|      || (MHD_HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE == http_code))
  ------------------
  |  Branch (116:10): [True: 0, False: 226]
  ------------------
  117|    296|    c->rq.too_large = true;
  118|       |
  119|    522|  mhd_LOG_PRINT (c->daemon,
  ------------------
  |  |   97|    522|#  define mhd_LOG_PRINT mhd_logger
  ------------------
  120|    522|                 MHD_SC_REQ_PROCESSING_ERR_REPLY,
  121|    522|                 mhd_LOG_FMT ("Error processing request. Sending %u " \
  ------------------
  |  |  103|    522|#  define mhd_LOG_FMT(format_string) format_string
  ------------------
  122|    522|                              "error reply: %s"),
  123|    522|                 (unsigned int)http_code,
  124|    522|                 (NULL != msg) ? msg : "[EMPTY BODY]");
  ------------------
  |  Branch (124:18): [True: 522, False: 0]
  ------------------
  125|       |
  126|    522|  if (NULL != c->rp.response)
  ------------------
  |  Branch (126:7): [True: 0, False: 522]
  ------------------
  127|      0|  {
  128|      0|    mhd_response_dec_use_count (c->rp.response);
  129|      0|    c->rp.response = NULL;
  130|      0|  }
  131|    522|  err_res = mhd_response_special_for_error (http_code,
  132|    522|                                            msg_len,
  133|    522|                                            msg,
  134|    522|                                            add_hdr_line_len,
  135|    522|                                            add_hdr_line);
  136|    522|  if (NULL == err_res)
  ------------------
  |  Branch (136:7): [True: 0, False: 522]
  ------------------
  137|      0|  {
  138|      0|    if (NULL != add_hdr_line)
  ------------------
  |  Branch (138:9): [True: 0, False: 0]
  ------------------
  139|      0|      free (add_hdr_line);
  140|      0|    mhd_STREAM_ABORT (c, \
  ------------------
  |  |  354|      0|#  define mhd_STREAM_ABORT(c, r, m) (mhd_conn_start_closing ((c),(r),(m)))
  ------------------
  141|      0|                      mhd_CONN_CLOSE_NO_MEM_FOR_ERR_RESPONSE, \
  142|      0|                      "No memory to create error response.");
  143|      0|    return;
  144|      0|  }
  145|    522|  c->rp.response = err_res;
  146|    522|  c->stage = mhd_HTTP_STAGE_START_REPLY;
  147|    522|}

_Z31mhd_response_remove_all_headersP12MHD_Response:
  230|    522|{
  231|    522|  struct mhd_ResponseHeader *hdr;
  232|       |
  233|    522|  for (hdr = mhd_DLINKEDL_GET_LAST (r, headers); NULL != hdr;
  ------------------
  |  |  370|    522|        mhd_DLINKEDL_GET_LAST_D (&((p_own)->list_name))
  |  |  ------------------
  |  |  |  |  253|    522|#define mhd_DLINKEDL_GET_LAST_D(p_list) ((p_list)->last)
  |  |  ------------------
  ------------------
  |  Branch (233:50): [True: 0, False: 522]
  ------------------
  234|    522|       hdr = mhd_DLINKEDL_GET_LAST (r, headers))
  ------------------
  |  |  370|      0|        mhd_DLINKEDL_GET_LAST_D (&((p_own)->list_name))
  |  |  ------------------
  |  |  |  |  253|      0|#define mhd_DLINKEDL_GET_LAST_D(p_list) ((p_list)->last)
  |  |  ------------------
  ------------------
  235|      0|  {
  236|       |    mhd_DLINKEDL_DEL (r, hdr, headers);
  ------------------
  |  |  352|      0|        mhd_DLINKEDL_DEL_D (&((p_own)->l_name),(p_obj),l_name)
  |  |  ------------------
  |  |  |  |  215|      0|#define mhd_DLINKEDL_DEL_D(p_list, p_obj, links_name) do {  \
  |  |  |  |  216|      0|        mhd_ASSUME (NULL != (p_list)->first);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  217|      0|        mhd_ASSUME (NULL != (p_list)->last);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  218|      0|        mhd_ASSUME (NULL == (p_list)->first->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  219|      0|        mhd_ASSUME (NULL == (p_list)->last->links_name.next);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  220|      0|        mhd_ASSUME ((p_obj) != (p_obj)->links_name.prev);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  221|      0|        mhd_ASSUME ((p_list)->last != (p_obj)->links_name.prev);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  222|      0|        mhd_ASSUME ((p_obj) != (p_obj)->links_name.next);         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  223|      0|        mhd_ASSUME ((p_list)->first != (p_obj)->links_name.next); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  224|      0|        if (NULL != (p_obj)->links_name.next)             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  225|      0|        { mhd_ASSUME ((p_obj) == (p_obj)->links_name.next->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  226|      0|          mhd_ASSUME ((p_obj) != (p_list)->last);       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  227|      0|          mhd_ASSUME ((p_obj)->links_name.next !=       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  228|      0|                      (p_obj)->links_name.prev);        \
  |  |  |  |  229|      0|          (p_obj)->links_name.next->links_name.prev =   \
  |  |  |  |  230|      0|            (p_obj)->links_name.prev; } else            \
  |  |  |  |  231|      0|        { mhd_ASSUME ((p_obj) == (p_list)->last);       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  232|      0|          (p_list)->last = (p_obj)->links_name.prev; }  \
  |  |  |  |  233|      0|        if (NULL != (p_obj)->links_name.prev)           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (233:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  234|      0|        { mhd_ASSUME ((p_obj) == (p_obj)->links_name.prev->links_name.next); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  235|      0|          mhd_ASSUME ((p_obj) != (p_list)->first);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  236|      0|          mhd_ASSUME ((p_obj)->links_name.next !=       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  237|      0|                      (p_obj)->links_name.prev);        \
  |  |  |  |  238|      0|          (p_obj)->links_name.prev->links_name.next =   \
  |  |  |  |  239|      0|            (p_obj)->links_name.next; } else            \
  |  |  |  |  240|      0|        { mhd_ASSUME ((p_obj) == (p_list)->first);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  241|      0|          (p_list)->first = (p_obj)->links_name.next; } \
  |  |  |  |  242|      0|        (p_obj)->links_name.prev = NULL;                \
  |  |  |  |  243|      0|        (p_obj)->links_name.next = NULL;  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (243:52): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|      0|    free (hdr);
  238|      0|  }
  239|    522|}

_Z39mhd_response_remove_auth_digest_headersP12MHD_Response:
   72|    522|{
   73|    522|  struct mhd_RespAuthDigestHeader *hdr_d;
   74|       |
   75|    522|  for (hdr_d = mhd_DLINKEDL_GET_LAST (response, auth_d_hdrs);
  ------------------
  |  |  370|    522|        mhd_DLINKEDL_GET_LAST_D (&((p_own)->list_name))
  |  |  ------------------
  |  |  |  |  253|    522|#define mhd_DLINKEDL_GET_LAST_D(p_list) ((p_list)->last)
  |  |  ------------------
  ------------------
   76|    522|       NULL != hdr_d;
  ------------------
  |  Branch (76:8): [True: 0, False: 522]
  ------------------
   77|    522|       hdr_d = mhd_DLINKEDL_GET_LAST (response, auth_d_hdrs))
  ------------------
  |  |  370|      0|        mhd_DLINKEDL_GET_LAST_D (&((p_own)->list_name))
  |  |  ------------------
  |  |  |  |  253|      0|#define mhd_DLINKEDL_GET_LAST_D(p_list) ((p_list)->last)
  |  |  ------------------
  ------------------
   78|      0|  {
   79|       |    mhd_DLINKEDL_DEL (response, hdr_d, auth_d_hdrs);
  ------------------
  |  |  352|      0|        mhd_DLINKEDL_DEL_D (&((p_own)->l_name),(p_obj),l_name)
  |  |  ------------------
  |  |  |  |  215|      0|#define mhd_DLINKEDL_DEL_D(p_list, p_obj, links_name) do {  \
  |  |  |  |  216|      0|        mhd_ASSUME (NULL != (p_list)->first);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  217|      0|        mhd_ASSUME (NULL != (p_list)->last);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  218|      0|        mhd_ASSUME (NULL == (p_list)->first->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  219|      0|        mhd_ASSUME (NULL == (p_list)->last->links_name.next);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  220|      0|        mhd_ASSUME ((p_obj) != (p_obj)->links_name.prev);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  221|      0|        mhd_ASSUME ((p_list)->last != (p_obj)->links_name.prev);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  222|      0|        mhd_ASSUME ((p_obj) != (p_obj)->links_name.next);         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  223|      0|        mhd_ASSUME ((p_list)->first != (p_obj)->links_name.next); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  224|      0|        if (NULL != (p_obj)->links_name.next)             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  225|      0|        { mhd_ASSUME ((p_obj) == (p_obj)->links_name.next->links_name.prev); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  226|      0|          mhd_ASSUME ((p_obj) != (p_list)->last);       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  227|      0|          mhd_ASSUME ((p_obj)->links_name.next !=       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  228|      0|                      (p_obj)->links_name.prev);        \
  |  |  |  |  229|      0|          (p_obj)->links_name.next->links_name.prev =   \
  |  |  |  |  230|      0|            (p_obj)->links_name.prev; } else            \
  |  |  |  |  231|      0|        { mhd_ASSUME ((p_obj) == (p_list)->last);       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  232|      0|          (p_list)->last = (p_obj)->links_name.prev; }  \
  |  |  |  |  233|      0|        if (NULL != (p_obj)->links_name.prev)           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (233:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  234|      0|        { mhd_ASSUME ((p_obj) == (p_obj)->links_name.prev->links_name.next); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  235|      0|          mhd_ASSUME ((p_obj) != (p_list)->first);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  236|      0|          mhd_ASSUME ((p_obj)->links_name.next !=       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  237|      0|                      (p_obj)->links_name.prev);        \
  |  |  |  |  238|      0|          (p_obj)->links_name.prev->links_name.next =   \
  |  |  |  |  239|      0|            (p_obj)->links_name.next; } else            \
  |  |  |  |  240|      0|        { mhd_ASSUME ((p_obj) == (p_list)->first);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|#      define mhd_ASSUME(statement)     MHD_ASSUME_KEYWORD ((statement))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  902|      0|#define MHD_ASSUME_KEYWORD(statement) __attribute__((assume(statement)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  241|      0|          (p_list)->first = (p_obj)->links_name.next; } \
  |  |  |  |  242|      0|        (p_obj)->links_name.prev = NULL;                \
  |  |  |  |  243|      0|        (p_obj)->links_name.next = NULL;  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (243:52): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|      0|    free (hdr_d);
   81|      0|  }
   82|    522|}

_Z26mhd_response_dec_use_countP12MHD_Response:
   94|    522|{
   95|    522|  mhd_assert (r->frozen);
  ------------------
  |  |   66|    522|#  define mhd_assert(ignore) ((void) 0)
  ------------------
   96|    522|  if (r->was_destroyed)
  ------------------
  |  Branch (96:7): [True: 0, False: 522]
  ------------------
   97|      0|    MHD_PANIC (mhd_RESPONSE_DESTOYED);
  ------------------
  |  |   93|      0|              mhd_panic (__FILE__, MHD_FUNC_, __LINE__, msg)
  |  |  ------------------
  |  |  |  |  388|      0|#  define MHD_FUNC_       __func__
  |  |  ------------------
  ------------------
   98|       |
   99|    522|  if (r->reuse.reusable)
  ------------------
  |  Branch (99:7): [True: 0, False: 522]
  ------------------
  100|      0|  {
  101|      0|    if (1 != mhd_atomic_counter_get_dec (&(r->reuse.counter)))
  ------------------
  |  Branch (101:9): [True: 0, False: 0]
  ------------------
  102|      0|      return; /* The response is still used somewhere */
  103|      0|  }
  104|       |
  105|    522|  response_full_deinit (r);
  106|    522|}
MHD_response_destroy:
  126|    522|{
  127|    522|  if (response->was_destroyed)
  ------------------
  |  Branch (127:7): [True: 0, False: 522]
  ------------------
  128|      0|    MHD_PANIC (mhd_RESPONSE_DESTOYED);
  ------------------
  |  |   93|      0|              mhd_panic (__FILE__, MHD_FUNC_, __LINE__, msg)
  |  |  ------------------
  |  |  |  |  388|      0|#  define MHD_FUNC_       __func__
  |  |  ------------------
  ------------------
  129|       |
  130|    522|  if (!response->frozen)
  ------------------
  |  Branch (130:7): [True: 0, False: 522]
  ------------------
  131|      0|  {
  132|       |    /* This response has been never used for actions */
  133|      0|    mhd_assert (NULL != response->settings);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  134|      0|    free (response->settings);
  135|       |#ifndef NDEBUG
  136|       |    /* Decrement counter to avoid triggering assert in deinit function */
  137|       |    if (response->reuse.reusable)
  138|       |      mhd_assert (1 == mhd_atomic_counter_get_dec (&(response->reuse.counter)));
  139|       |#endif
  140|      0|    response_full_deinit (response);
  141|      0|    return;
  142|      0|  }
  143|       |
  144|    522|  mhd_response_dec_use_count (response);
  145|    522|}
response_destroy.c:_ZL20response_full_deinitP12MHD_Response:
   76|    522|{
   77|    522|#ifdef MHD_SUPPORT_AUTH_DIGEST
   78|    522|  mhd_response_remove_auth_digest_headers (r);
   79|    522|#endif
   80|    522|  mhd_response_remove_all_headers (r);
   81|    522|  if (NULL != r->special_resp.spec_hdr)
  ------------------
  |  Branch (81:7): [True: 0, False: 522]
  ------------------
   82|      0|    free (r->special_resp.spec_hdr);
   83|    522|  if (r->reuse.reusable)
  ------------------
  |  Branch (83:7): [True: 0, False: 522]
  ------------------
   84|      0|    mhd_response_deinit_reusable (r);
   85|    522|  mhd_response_deinit_content_data (r);
   86|       |
   87|    522|  r->was_destroyed = true;
   88|    522|  free (r);
   89|    522|}

_Z32mhd_response_deinit_content_dataP12MHD_Response:
  121|    522|{
  122|    522|  mhd_assert (mhd_RESPONSE_CONTENT_DATA_INVALID != r->cntn_dtype);
  ------------------
  |  |   66|    522|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  123|    522|  if (mhd_RESPONSE_CONTENT_DATA_IOVEC == r->cntn_dtype)
  ------------------
  |  Branch (123:7): [True: 0, False: 522]
  ------------------
  124|      0|    free (r->cntn.iovec.iov);
  125|    522|  else if (mhd_RESPONSE_CONTENT_DATA_FILE == r->cntn_dtype)
  ------------------
  |  Branch (125:12): [True: 0, False: 522]
  ------------------
  126|      0|    close (r->cntn.file.fd);
  127|       |  /* For #mhd_RESPONSE_CONTENT_DATA_BUFFER clean-up performed by callback
  128|       |     for both modes: internal copy and external cleanup */
  129|    522|  if (NULL != r->free.cb)
  ------------------
  |  Branch (129:7): [True: 0, False: 522]
  ------------------
  130|      0|    r->free.cb (r->free.cls);
  131|    522|}
_Z30mhd_response_special_for_errorjmPKcmPc:
  469|    522|{
  470|    522|  struct MHD_Response *restrict res;
  471|       |
  472|    522|  mhd_assert (100 <= sc);
  ------------------
  |  |   66|    522|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  473|    522|  mhd_assert (600 > sc);
  ------------------
  |  |   66|    522|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  474|    522|  mhd_assert ((NULL != cntn) || (0 == cntn_len));
  ------------------
  |  |   66|    522|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  475|    522|  mhd_assert ((NULL != spec_hdr) || (0 == spec_hdr_len));
  ------------------
  |  |   66|    522|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  476|       |
  477|    522|  res = (struct MHD_Response *)
  478|    522|        mhd_calloc (1,
  ------------------
  |  |   64|    522|#  define mhd_calloc calloc
  ------------------
  479|    522|                    sizeof(struct MHD_Response));
  480|    522|  if (NULL == res)
  ------------------
  |  Branch (480:7): [True: 0, False: 522]
  ------------------
  481|      0|    return NULL;
  482|       |
  483|       |#ifndef HAVE_NULL_PTR_ALL_ZEROS
  484|       |  mhd_DLINKEDL_INIT_LIST (res, headers);
  485|       |#  ifdef MHD_SUPPORT_AUTH_DIGEST
  486|       |  mhd_DLINKEDL_INIT_LIST (res, auth_d_hdrs);
  487|       |#  endif /* MHD_SUPPORT_AUTH_DIGEST */
  488|       |  res->free.cb = NULL;
  489|       |  res->free.cls = NULL;
  490|       |  res->special_resp.spec_hdr = NULL;
  491|       |#endif /* ! HAVE_NULL_PTR_ALL_ZEROS */
  492|    522|  res->sc = (enum MHD_HTTP_StatusCode)sc;
  493|    522|  res->cntn_size = cntn_len;
  494|    522|  res->cntn_dtype = mhd_RESPONSE_CONTENT_DATA_BUFFER;
  495|    522|  res->cntn.buf = (const unsigned char *)((0 != cntn_len) ? cntn : "");
  ------------------
  |  Branch (495:43): [True: 522, False: 0]
  ------------------
  496|    522|  res->cfg.close_forced = true;
  497|    522|  res->cfg.int_err_resp = true;
  498|    522|  res->special_resp.spec_hdr_len = spec_hdr_len;
  499|    522|  res->special_resp.spec_hdr = spec_hdr;
  500|    522|  res->frozen = true;
  501|       |
  502|    522|  return res;
  503|    522|}

_Z23mhd_stream_alloc_memoryP14MHD_Connectionm:
  128|  30.7k|{
  129|  30.7k|  struct mhd_MemoryPool *const restrict pool = c->pool;     /* a short alias */
  130|  30.7k|  size_t need_to_be_freed = 0; /**< The required amount of additional free memory */
  131|  30.7k|  void *res;
  132|       |
  133|  30.7k|  res = mhd_pool_try_alloc (pool,
  134|  30.7k|                            size,
  135|  30.7k|                            &need_to_be_freed);
  136|  30.7k|  if (NULL != res)
  ------------------
  |  Branch (136:7): [True: 30.2k, False: 474]
  ------------------
  137|  30.2k|    return res;
  138|       |
  139|    474|  if (mhd_pool_is_resizable_inplace (pool,
  ------------------
  |  Branch (139:7): [True: 163, False: 311]
  ------------------
  140|    474|                                     c->write_buffer,
  141|    474|                                     c->write_buffer_size))
  142|    163|  {
  143|    163|    if (c->write_buffer_size - c->write_buffer_append_offset >=
  ------------------
  |  Branch (143:9): [True: 133, False: 30]
  ------------------
  144|    163|        need_to_be_freed)
  145|    133|    {
  146|    133|      char *buf;
  147|    133|      const size_t new_buf_size = c->write_buffer_size - need_to_be_freed;
  148|    133|      buf = (char *)mhd_pool_reallocate (pool,
  149|    133|                                         c->write_buffer,
  150|    133|                                         c->write_buffer_size,
  151|    133|                                         new_buf_size);
  152|    133|      mhd_assert (c->write_buffer == buf);
  ------------------
  |  |   66|    133|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  153|    133|      mhd_assert (c->write_buffer_append_offset <= new_buf_size);
  ------------------
  |  |   66|    133|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  154|    133|      mhd_assert (c->write_buffer_send_offset <= new_buf_size);
  ------------------
  |  |   66|    133|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  155|    133|      c->write_buffer_size = new_buf_size;
  156|    133|      c->write_buffer = buf;
  157|    133|    }
  158|     30|    else
  159|     30|      return NULL;
  160|    163|  }
  161|    311|  else if (mhd_pool_is_resizable_inplace (pool,
  ------------------
  |  Branch (161:12): [True: 19, False: 292]
  ------------------
  162|    311|                                          c->read_buffer,
  163|    311|                                          c->read_buffer_size))
  164|     19|  {
  165|     19|    if (c->read_buffer_size - c->read_buffer_offset >= need_to_be_freed)
  ------------------
  |  Branch (165:9): [True: 0, False: 19]
  ------------------
  166|      0|    {
  167|      0|      char *buf;
  168|      0|      const size_t new_buf_size = c->read_buffer_size - need_to_be_freed;
  169|      0|      buf = (char *)mhd_pool_reallocate (pool,
  170|      0|                                         c->read_buffer,
  171|      0|                                         c->read_buffer_size,
  172|      0|                                         new_buf_size);
  173|      0|      mhd_assert (c->read_buffer == buf);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  174|      0|      mhd_assert (c->read_buffer_offset <= new_buf_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  175|      0|      c->read_buffer_size = new_buf_size;
  176|      0|      c->read_buffer = buf;
  177|      0|    }
  178|     19|    else
  179|     19|      return NULL;
  180|     19|  }
  181|    292|  else
  182|    292|    return NULL;
  183|    133|  res = mhd_pool_allocate (pool, size, true);
  184|    133|  mhd_assert (NULL != res); /* It has been checked that pool has enough space */
  ------------------
  |  |   66|    133|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  185|    133|  return res;
  186|    474|}
_Z29mhd_stream_shrink_read_bufferP14MHD_Connection:
  195|  3.13k|{
  196|  3.13k|  void *new_buf;
  197|       |
  198|  3.13k|  if ((NULL == c->read_buffer) || (0 == c->read_buffer_size))
  ------------------
  |  Branch (198:7): [True: 1.14k, False: 1.99k]
  |  Branch (198:35): [True: 0, False: 1.99k]
  ------------------
  199|  1.14k|  {
  200|  1.14k|    mhd_assert (0 == c->read_buffer_size);
  ------------------
  |  |   66|  1.14k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  201|  1.14k|    mhd_assert (0 == c->read_buffer_offset);
  ------------------
  |  |   66|  1.14k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  202|  1.14k|    return;
  203|  1.14k|  }
  204|       |
  205|  1.99k|  mhd_assert (c->read_buffer_offset <= c->read_buffer_size);
  ------------------
  |  |   66|  1.99k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  206|  1.99k|  if (0 == c->read_buffer_offset)
  ------------------
  |  Branch (206:7): [True: 637, False: 1.36k]
  ------------------
  207|    637|  {
  208|    637|    mhd_pool_deallocate (c->pool, c->read_buffer, c->read_buffer_size);
  209|    637|    c->read_buffer = NULL;
  210|    637|    c->read_buffer_size = 0;
  211|    637|  }
  212|  1.36k|  else
  213|  1.36k|  {
  214|  1.36k|    mhd_assert (mhd_pool_is_resizable_inplace (c->pool, c->read_buffer, \
  ------------------
  |  |   66|  1.36k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  215|  1.36k|                                               c->read_buffer_size));
  216|  1.36k|    new_buf = mhd_pool_reallocate (c->pool, c->read_buffer, c->read_buffer_size,
  217|  1.36k|                                   c->read_buffer_offset);
  218|  1.36k|    mhd_assert (c->read_buffer == new_buf);
  ------------------
  |  |   66|  1.36k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  219|  1.36k|    c->read_buffer = (char *)new_buf;
  220|  1.36k|    c->read_buffer_size = c->read_buffer_offset;
  221|  1.36k|  }
  222|  1.99k|}
_Z32mhd_stream_maximize_write_bufferP14MHD_Connection:
  227|    283|{
  228|    283|  struct mhd_MemoryPool *const restrict pool = c->pool;
  229|    283|  void *new_buf;
  230|    283|  size_t new_size;
  231|    283|  size_t free_size;
  232|       |
  233|    283|  mhd_assert ((NULL != c->write_buffer) || (0 == c->write_buffer_size));
  ------------------
  |  |   66|    283|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  234|    283|  mhd_assert (c->write_buffer_append_offset >= c->write_buffer_send_offset);
  ------------------
  |  |   66|    283|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  235|    283|  mhd_assert (c->write_buffer_size >= c->write_buffer_append_offset);
  ------------------
  |  |   66|    283|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  236|       |
  237|    283|  free_size = mhd_pool_get_free (pool);
  238|    283|  if (0 != free_size)
  ------------------
  |  Branch (238:7): [True: 238, False: 45]
  ------------------
  239|    238|  {
  240|    238|    new_size = c->write_buffer_size + free_size;
  241|       |    /* This function must not move the buffer position.
  242|       |     * mhd_pool_reallocate () may return the new position only if buffer was
  243|       |     * allocated 'from_end' or is not the last allocation,
  244|       |     * which should not happen. */
  245|    238|    mhd_assert ((NULL == c->write_buffer) \
  ------------------
  |  |   66|    238|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  246|    238|                || mhd_pool_is_resizable_inplace (pool, c->write_buffer, \
  247|    238|                                                  c->write_buffer_size));
  248|    238|    new_buf = mhd_pool_reallocate (pool,
  249|    238|                                   c->write_buffer,
  250|    238|                                   c->write_buffer_size,
  251|    238|                                   new_size);
  252|    238|    mhd_assert ((c->write_buffer == new_buf) || (NULL == c->write_buffer));
  ------------------
  |  |   66|    238|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  253|    238|    c->write_buffer = (char *)new_buf;
  254|    238|    c->write_buffer_size = new_size;
  255|    238|    if (c->write_buffer_send_offset == c->write_buffer_append_offset)
  ------------------
  |  Branch (255:9): [True: 238, False: 0]
  ------------------
  256|    238|    {
  257|       |      /* All data have been sent, reset offsets to zero. */
  258|    238|      c->write_buffer_send_offset = 0;
  259|    238|      c->write_buffer_append_offset = 0;
  260|    238|    }
  261|    238|  }
  262|       |
  263|    283|  return c->write_buffer_size - c->write_buffer_append_offset;
  264|    283|}
_Z31mhd_stream_release_write_bufferP14MHD_Connection:
  269|  2.80k|{
  270|  2.80k|  struct mhd_MemoryPool *const restrict pool = c->pool;
  271|       |
  272|  2.80k|  mhd_assert ((NULL != c->write_buffer) || (0 == c->write_buffer_size));
  ------------------
  |  |   66|  2.80k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  273|  2.80k|  mhd_assert (c->write_buffer_append_offset == c->write_buffer_send_offset);
  ------------------
  |  |   66|  2.80k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  274|  2.80k|  mhd_assert (c->write_buffer_size >= c->write_buffer_append_offset);
  ------------------
  |  |   66|  2.80k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  275|       |
  276|  2.80k|  mhd_pool_deallocate (pool, c->write_buffer, c->write_buffer_size);
  277|  2.80k|  c->write_buffer_send_offset = 0;
  278|  2.80k|  c->write_buffer_append_offset = 0;
  279|  2.80k|  c->write_buffer_size = 0;
  280|  2.80k|  c->write_buffer = NULL;
  281|       |
  282|  2.80k|}
_Z39mhd_stream_get_no_space_err_status_codeP14MHD_Connection21MHD_ProcRecvDataStagemPKc:
  362|     21|{
  363|     21|  size_t method_size;
  364|     21|  size_t uri_size;
  365|     21|  size_t opt_headers_size;
  366|     21|  size_t host_field_line_size;
  367|       |
  368|     21|  mhd_assert ((0 == add_element_size) || (NULL != add_element));
  ------------------
  |  |   66|     21|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  369|       |
  370|     21|  c->rq.too_large = true;
  371|       |
  372|     21|  if (mhd_HTTP_STAGE_REQ_LINE_RECEIVED < c->stage)
  ------------------
  |  Branch (372:7): [True: 0, False: 21]
  ------------------
  373|      0|  {
  374|      0|    if (mhd_HTTP_STAGE_HEADERS_RECEIVED > c->stage)
  ------------------
  |  Branch (374:9): [True: 0, False: 0]
  ------------------
  375|      0|    {
  376|      0|      mhd_assert (NULL != c->rq.field_lines.start);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  377|      0|      opt_headers_size =
  378|      0|        (size_t)((c->read_buffer + c->read_buffer_offset)
  379|      0|                 - c->rq.field_lines.start);
  380|      0|    }
  381|      0|    else
  382|      0|      opt_headers_size = c->rq.field_lines.size;
  383|      0|  }
  384|     21|  else
  385|     21|    opt_headers_size = 0u;
  386|       |
  387|       |  /* The read buffer is fully used by the request line, the field lines
  388|       |     (headers) and internal information.
  389|       |     The return status code works as a suggestion for the client to reduce
  390|       |     one of the request elements. */
  391|       |
  392|     21|  if ((MHD_PROC_RECV_BODY_CHUNKED == stage)
  ------------------
  |  Branch (392:7): [True: 0, False: 21]
  ------------------
  393|      0|      && (MHD_MIN_REASONABLE_REQ_CHUNK_LINE_LENGTH_ < add_element_size))
  ------------------
  |  |  351|      0|#  define MHD_MIN_REASONABLE_REQ_CHUNK_LINE_LENGTH_ 4
  ------------------
  |  Branch (393:10): [True: 0, False: 0]
  ------------------
  394|      0|  {
  395|       |    /* Request could be re-tried easily with smaller chunk sizes */
  396|      0|    return MHD_HTTP_STATUS_CONTENT_TOO_LARGE;
  397|      0|  }
  398|       |
  399|     21|  host_field_line_size = 0;
  400|       |  /* The "Host:" field line is mandatory.
  401|       |     The total size of the field lines (headers) cannot be smaller than
  402|       |     the size of the "Host:" field line. */
  403|     21|  if ((MHD_PROC_RECV_HEADERS == stage)
  ------------------
  |  Branch (403:7): [True: 0, False: 21]
  ------------------
  404|      0|      && (0 != add_element_size))
  ------------------
  |  Branch (404:10): [True: 0, False: 0]
  ------------------
  405|      0|  {
  406|      0|    static const size_t header_host_key_len =
  407|      0|      mhd_SSTR_LEN (MHD_HTTP_HEADER_HOST);
  ------------------
  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  ------------------
  408|      0|    const bool is_host_header =
  409|      0|      (header_host_key_len + 1 <= add_element_size)
  ------------------
  |  Branch (409:7): [True: 0, False: 0]
  ------------------
  410|      0|      && ((0 == add_element[header_host_key_len])
  ------------------
  |  Branch (410:11): [True: 0, False: 0]
  ------------------
  411|      0|          || (':' == add_element[header_host_key_len]))
  ------------------
  |  Branch (411:14): [True: 0, False: 0]
  ------------------
  412|      0|      && mhd_str_equal_caseless_bin_n (MHD_HTTP_HEADER_HOST,
  ------------------
  |  | 2157|      0|#define MHD_HTTP_HEADER_HOST         "Host"
  ------------------
  |  Branch (412:10): [True: 0, False: 0]
  ------------------
  413|      0|                                       add_element,
  414|      0|                                       header_host_key_len);
  415|      0|    if (is_host_header)
  ------------------
  |  Branch (415:9): [True: 0, False: 0]
  ------------------
  416|      0|    {
  417|      0|      const bool is_parsed = !(
  418|      0|        (mhd_HTTP_STAGE_HEADERS_RECEIVED > c->stage)
  ------------------
  |  Branch (418:9): [True: 0, False: 0]
  ------------------
  419|      0|        && (add_element_size == c->read_buffer_offset)
  ------------------
  |  Branch (419:12): [True: 0, False: 0]
  ------------------
  420|      0|        && (c->read_buffer == add_element));
  ------------------
  |  Branch (420:12): [True: 0, False: 0]
  ------------------
  421|      0|      size_t actual_element_size;
  422|       |
  423|      0|      mhd_assert (!is_parsed || (0 == add_element[header_host_key_len]));
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  424|       |      /* The actual size should be larger due to CRLF or LF chars,
  425|       |         however the exact termination sequence is not known here and
  426|       |         as perfect precision is not required, to simplify the code
  427|       |         assume the minimal length. */
  428|      0|      if (is_parsed)
  ------------------
  |  Branch (428:11): [True: 0, False: 0]
  ------------------
  429|      0|        actual_element_size = add_element_size + 1;  /* "1" for LF */
  430|      0|      else
  431|      0|        actual_element_size = add_element_size;
  432|       |
  433|      0|      host_field_line_size = actual_element_size;
  434|      0|      mhd_assert (opt_headers_size >= actual_element_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  435|      0|      opt_headers_size -= actual_element_size;
  436|      0|    }
  437|      0|  }
  438|     21|  if (0 == host_field_line_size)
  ------------------
  |  Branch (438:7): [True: 21, False: 0]
  ------------------
  439|     21|  {
  440|     21|    static const size_t host_field_name_len =
  441|     21|      mhd_SSTR_LEN (MHD_HTTP_HEADER_HOST);
  ------------------
  |  |   54|     21|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  ------------------
  442|     21|    struct MHD_StringNullable host_value;
  443|       |
  444|     21|    if (mhd_request_get_value_n (&(c->rq),
  ------------------
  |  Branch (444:9): [True: 6, False: 15]
  ------------------
  445|     21|                                 MHD_VK_HEADER,
  446|     21|                                 host_field_name_len,
  447|     21|                                 MHD_HTTP_HEADER_HOST,
  ------------------
  |  | 2157|     21|#define MHD_HTTP_HEADER_HOST         "Host"
  ------------------
  448|     21|                                 &host_value))
  449|      6|    {
  450|       |      /* Calculate the minimal size of the field line: no space between
  451|       |         colon and the field value, line terminated by LR */
  452|      6|      host_field_line_size =
  453|      6|        host_field_name_len + host_value.len + 2; /* "2" for ':' and LF */
  454|       |
  455|       |      /* The "Host:" field could be added by application */
  456|      6|      if (opt_headers_size >= host_field_line_size)
  ------------------
  |  Branch (456:11): [True: 0, False: 6]
  ------------------
  457|      0|      {
  458|      0|        opt_headers_size -= host_field_line_size;
  459|       |        /* Take into account typical space after colon and CR at the end of the line */
  460|      0|        if (opt_headers_size >= 2)
  ------------------
  |  Branch (460:13): [True: 0, False: 0]
  ------------------
  461|      0|          opt_headers_size -= 2;
  462|      0|      }
  463|      6|      else
  464|      6|        host_field_line_size = 0; /* No "Host:" field line set by the client */
  465|      6|    }
  466|     21|  }
  467|       |
  468|     21|  uri_size = c->rq.req_target_len;
  469|     21|  if (mhd_HTTP_METHOD_OTHER != c->rq.http_mthd)
  ------------------
  |  Branch (469:7): [True: 21, False: 0]
  ------------------
  470|     21|    method_size = 0; /* Do not recommend shorter request method */
  471|      0|  else
  472|      0|  {
  473|      0|    mhd_assert (NULL != c->rq.method.cstr);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  474|      0|    method_size = c->rq.method.len;
  475|      0|    mhd_assert (method_size == strlen (c->rq.method.cstr));
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  476|      0|  }
  477|       |
  478|     21|  if ((size_t)MHD_MAX_REASONABLE_HEADERS_SIZE_ < opt_headers_size)
  ------------------
  |  |  295|     21|#  define MHD_MAX_REASONABLE_HEADERS_SIZE_ (6 * 1024)
  ------------------
  |  Branch (478:7): [True: 0, False: 21]
  ------------------
  479|      0|  {
  480|       |    /* Typically the easiest way to reduce request header size is
  481|       |       a removal of some optional headers. */
  482|      0|    if (opt_headers_size > (uri_size / 8))
  ------------------
  |  Branch (482:9): [True: 0, False: 0]
  ------------------
  483|      0|    {
  484|      0|      if ((opt_headers_size / 2) > method_size)
  ------------------
  |  Branch (484:11): [True: 0, False: 0]
  ------------------
  485|      0|        return MHD_HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE;
  486|      0|      else
  487|      0|        return MHD_HTTP_STATUS_NOT_IMPLEMENTED; /* The length of the HTTP request method is unreasonably large */
  488|      0|    }
  489|      0|    else
  490|      0|    { /* Request target is MUCH larger than headers */
  491|      0|      if ((uri_size / 16) > method_size)
  ------------------
  |  Branch (491:11): [True: 0, False: 0]
  ------------------
  492|      0|        return MHD_HTTP_STATUS_URI_TOO_LONG;
  493|      0|      else
  494|      0|        return MHD_HTTP_STATUS_NOT_IMPLEMENTED; /* The length of the HTTP request method is unreasonably large */
  495|      0|    }
  496|      0|  }
  497|     21|  if ((size_t)MHD_MAX_REASONABLE_REQ_TARGET_SIZE_ < uri_size)
  ------------------
  |  |  309|     21|#  define MHD_MAX_REASONABLE_REQ_TARGET_SIZE_ 8000
  ------------------
  |  Branch (497:7): [True: 0, False: 21]
  ------------------
  498|      0|  {
  499|       |    /* If request target size if larger than maximum reasonable size
  500|       |       recommend client to reduce the request target size (length). */
  501|      0|    if ((uri_size / 16) > method_size)
  ------------------
  |  Branch (501:9): [True: 0, False: 0]
  ------------------
  502|      0|      return MHD_HTTP_STATUS_URI_TOO_LONG;     /* Request target is MUCH larger than headers */
  503|      0|    else
  504|      0|      return MHD_HTTP_STATUS_NOT_IMPLEMENTED;  /* The length of the HTTP request method is unreasonably large */
  505|      0|  }
  506|       |
  507|       |  /* The read buffer is too small to handle reasonably large requests */
  508|       |
  509|     21|  if ((size_t)MHD_MIN_REASONABLE_HEADERS_SIZE_ < opt_headers_size)
  ------------------
  |  |  320|     21|#  define MHD_MIN_REASONABLE_HEADERS_SIZE_ 26
  ------------------
  |  Branch (509:7): [True: 0, False: 21]
  ------------------
  510|      0|  {
  511|       |    /* Recommend application to retry with minimal headers */
  512|      0|    if ((opt_headers_size * 4) > uri_size)
  ------------------
  |  Branch (512:9): [True: 0, False: 0]
  ------------------
  513|      0|    {
  514|      0|      if (opt_headers_size > method_size)
  ------------------
  |  Branch (514:11): [True: 0, False: 0]
  ------------------
  515|      0|        return MHD_HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE;
  516|      0|      else
  517|      0|        return MHD_HTTP_STATUS_NOT_IMPLEMENTED; /* The length of the HTTP request method is unreasonably large */
  518|      0|    }
  519|      0|    else
  520|      0|    { /* Request target is significantly larger than headers */
  521|      0|      if (uri_size > method_size * 4)
  ------------------
  |  Branch (521:11): [True: 0, False: 0]
  ------------------
  522|      0|        return MHD_HTTP_STATUS_URI_TOO_LONG;
  523|      0|      else
  524|      0|        return MHD_HTTP_STATUS_NOT_IMPLEMENTED; /* The length of the HTTP request method is unreasonably large */
  525|      0|    }
  526|      0|  }
  527|     21|  if ((size_t)MHD_MIN_REASONABLE_REQ_TARGET_SIZE_ < uri_size)
  ------------------
  |  |  331|     21|#  define MHD_MIN_REASONABLE_REQ_TARGET_SIZE_ 40
  ------------------
  |  Branch (527:7): [True: 0, False: 21]
  ------------------
  528|      0|  {
  529|       |    /* Recommend application to retry with a shorter request target */
  530|      0|    if (uri_size > method_size * 4)
  ------------------
  |  Branch (530:9): [True: 0, False: 0]
  ------------------
  531|      0|      return MHD_HTTP_STATUS_URI_TOO_LONG;
  532|      0|    else
  533|      0|      return MHD_HTTP_STATUS_NOT_IMPLEMENTED; /* The length of the HTTP request method is unreasonably large */
  534|      0|  }
  535|       |
  536|     21|  if ((size_t)MHD_MIN_REASONABLE_REQ_METHOD_SIZE_ < method_size)
  ------------------
  |  |  342|     21|#  define MHD_MIN_REASONABLE_REQ_METHOD_SIZE_ 16
  ------------------
  |  Branch (536:7): [True: 0, False: 21]
  ------------------
  537|      0|  {
  538|       |    /* The request target (URI) and headers are (reasonably) very small.
  539|       |       Some non-standard long request method is used. */
  540|       |    /* The last resort response as it means "the method is not supported
  541|       |       by the server for any URI". */
  542|      0|    return MHD_HTTP_STATUS_NOT_IMPLEMENTED;
  543|      0|  }
  544|       |
  545|       |  /* The almost impossible situation: all elements are small, but cannot
  546|       |     fit the buffer. The application set the buffer size to
  547|       |     critically low value? */
  548|       |
  549|     21|  if ((1 < opt_headers_size) || (1 < uri_size))
  ------------------
  |  Branch (549:7): [True: 0, False: 21]
  |  Branch (549:33): [True: 21, False: 0]
  ------------------
  550|     21|  {
  551|     21|    if (opt_headers_size >= uri_size)
  ------------------
  |  Branch (551:9): [True: 0, False: 21]
  ------------------
  552|      0|      return MHD_HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE;
  553|     21|    else
  554|     21|      return MHD_HTTP_STATUS_URI_TOO_LONG;
  555|     21|  }
  556|       |
  557|       |  /* Nothing to reduce in the request.
  558|       |     Reply with some status. */
  559|      0|  if (0 != host_field_line_size)
  ------------------
  |  Branch (559:7): [True: 0, False: 0]
  ------------------
  560|      0|    return MHD_HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE;
  561|       |
  562|      0|  return MHD_HTTP_STATUS_URI_TOO_LONG;
  563|      0|}
_Z35mhd_stream_switch_from_recv_to_sendP14MHD_Connection:
  568|  2.73k|{
  569|       |  /* Read buffer is not needed for this request, shrink it.*/
  570|  2.73k|  mhd_stream_shrink_read_buffer (c);
  571|  2.73k|}
_Z22mhd_conn_start_closingP14MHD_Connection19mhd_ConnCloseReasonPKc:
  735|  4.71k|{
  736|  4.71k|  bool close_hard;
  737|  4.71k|  enum MHD_RequestEndedCode end_code;
  738|  4.71k|  enum MHD_StatusCode sc;
  739|  4.71k|  bool reply_sending_aborted;
  740|       |
  741|       |#ifdef MHD_USE_TRACE_CONN_ADD_CLOSE
  742|       |  fprintf (stderr,
  743|       |           "&&& mhd_conn_start_closing([FD: %2llu], %u, %s%s%s)...\n",
  744|       |           (unsigned long long)c->sk.fd,
  745|       |           (unsigned int)reason,
  746|       |           log_msg ? "\"" : "",
  747|       |           log_msg ? log_msg : "[NULL]",
  748|       |           log_msg ? "\"" : "");
  749|       |#endif /* MHD_USE_TRACE_CONN_ADD_CLOSE */
  750|       |
  751|  4.71k|#ifdef MHD_SUPPORT_HTTP2
  752|  4.71k|  if (mhd_C_IS_HTTP2 (c))
  ------------------
  |  |  913|  4.71k|          (mhd_HTTP_VER_FAM_2 == c->h_layer.fam)
  |  |  ------------------
  |  |  |  Branch (913:11): [True: 0, False: 4.71k]
  |  |  ------------------
  ------------------
  753|      0|  {
  754|      0|    mhd_assert ((mhd_CONN_CLOSE_TIMEDOUT == reason)
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  755|      0|                || (mhd_CONN_CLOSE_DAEMON_SHUTDOWN == reason)
  756|      0|                || (mhd_CONN_CLOSE_H2_CLOSE_SOFT == reason)
  757|      0|                || (mhd_CONN_CLOSE_H2_CLOSE_HARD == reason));
  758|      0|    mhd_assert (NULL == log_msg);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  759|      0|    conn_h2_start_closing (c,
  760|      0|                           reason != mhd_CONN_CLOSE_H2_CLOSE_SOFT);
  761|      0|    return;
  762|      0|  }
  763|  4.71k|#endif /* MHD_SUPPORT_HTTP2 */
  764|       |
  765|  4.71k|  reply_sending_aborted =
  766|  4.71k|    ((mhd_HTTP_STAGE_HEADERS_SENDING <= c->stage)
  ------------------
  |  Branch (766:6): [True: 1.31k, False: 3.39k]
  ------------------
  767|  1.31k|     && (mhd_HTTP_STAGE_FULL_REPLY_SENT > c->stage));
  ------------------
  |  Branch (767:9): [True: 0, False: 1.31k]
  ------------------
  768|  4.71k|  sc = MHD_SC_INTERNAL_ERROR;
  769|  4.71k|  switch (reason)
  770|  4.71k|  {
  771|    639|  case mhd_CONN_CLOSE_CLIENT_HTTP_ERR_ABORT_CONN:
  ------------------
  |  Branch (771:3): [True: 639, False: 4.07k]
  ------------------
  772|    639|    close_hard = true;
  773|    639|    end_code = MHD_REQUEST_ENDED_HTTP_PROTOCOL_ERROR;
  774|    639|    sc = MHD_SC_REQ_MALFORMED;
  775|    639|    mhd_assert (!reply_sending_aborted);
  ------------------
  |  |   66|    639|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  776|    639|    break;
  777|      0|  case mhd_CONN_CLOSE_NO_POOL_MEM_FOR_REQUEST:
  ------------------
  |  Branch (777:3): [True: 0, False: 4.71k]
  ------------------
  778|      0|    close_hard = true;
  779|      0|    end_code = MHD_REQUEST_ENDED_NO_RESOURCES;
  780|      0|    mhd_assert (!reply_sending_aborted);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  781|      0|    break;
  782|      0|  case mhd_CONN_CLOSE_CLIENT_SHUTDOWN_EARLY:
  ------------------
  |  Branch (782:3): [True: 0, False: 4.71k]
  ------------------
  783|      0|    close_hard = true;
  784|      0|    end_code = MHD_REQUEST_ENDED_CLIENT_ABORT;
  785|      0|    sc = MHD_SC_CLIENT_SHUTDOWN_EARLY;
  786|      0|    mhd_assert (!reply_sending_aborted);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  787|      0|    break;
  788|      0|  case mhd_CONN_CLOSE_H2_PREFACE_MISSING:
  ------------------
  |  Branch (788:3): [True: 0, False: 4.71k]
  ------------------
  789|      0|    close_hard = true;
  790|      0|    end_code = MHD_REQUEST_ENDED_HTTP_PROTOCOL_ERROR;
  791|      0|    sc = MHD_SC_ALPN_H2_NO_PREFACE;
  792|      0|    break;
  793|      0|  case mhd_CONN_CLOSE_NO_POOL_MEM_FOR_REPLY:
  ------------------
  |  Branch (793:3): [True: 0, False: 4.71k]
  ------------------
  794|      0|    close_hard = true;
  795|      0|    end_code = (!c->stop_with_error || c->rq.too_large) ?
  ------------------
  |  Branch (795:17): [True: 0, False: 0]
  |  Branch (795:40): [True: 0, False: 0]
  ------------------
  796|      0|               MHD_REQUEST_ENDED_NO_RESOURCES :
  797|      0|               MHD_REQUEST_ENDED_HTTP_PROTOCOL_ERROR;
  798|      0|    sc = MHD_SC_REPLY_POOL_ALLOCATION_FAILURE;
  799|      0|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (799:9): [True: 0, False: 0]
  |  Branch (799:34): [True: 0, False: 0]
  ------------------
  800|      0|      log_msg = mhd_MSG4LOG ("Response aborted due to insufficient memory " \
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  801|      0|                             "in the connection pool");
  802|      0|    break;
  803|      0|  case mhd_CONN_CLOSE_NO_MEM_FOR_ERR_RESPONSE:
  ------------------
  |  Branch (803:3): [True: 0, False: 4.71k]
  ------------------
  804|      0|    close_hard = true;
  805|      0|    end_code = c->rq.too_large ?
  ------------------
  |  Branch (805:16): [True: 0, False: 0]
  ------------------
  806|      0|               MHD_REQUEST_ENDED_NO_RESOURCES :
  807|      0|               MHD_REQUEST_ENDED_HTTP_PROTOCOL_ERROR;
  808|      0|    sc = MHD_SC_REPLY_ALLOCATION_FAILED;
  809|      0|    break;
  810|      0|  case mhd_CONN_CLOSE_APP_ERROR:
  ------------------
  |  Branch (810:3): [True: 0, False: 4.71k]
  ------------------
  811|      0|    close_hard = true;
  812|      0|    end_code = MHD_REQUEST_ENDED_BY_APP_ERROR;
  813|      0|    sc = MHD_SC_APPLICATION_DATA_GENERATION_FAILURE_CLOSED;
  814|      0|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (814:9): [True: 0, False: 0]
  |  Branch (814:34): [True: 0, False: 0]
  ------------------
  815|      0|      log_msg = mhd_MSG4LOG ("Response aborted due to application reply " \
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  816|      0|                             "generation failure");
  817|      0|    break;
  818|  4.07k|  case mhd_CONN_CLOSE_APP_ABORTED:
  ------------------
  |  Branch (818:3): [True: 4.07k, False: 639]
  ------------------
  819|  4.07k|    close_hard = true;
  820|  4.07k|    end_code = MHD_REQUEST_ENDED_BY_APP_ABORT;
  821|  4.07k|    sc = MHD_SC_APPLICATION_CALLBACK_ABORT_ACTION;
  822|  4.07k|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (822:9): [True: 0, False: 4.07k]
  |  Branch (822:34): [True: 0, False: 0]
  ------------------
  823|      0|      log_msg = mhd_MSG4LOG ("Application aborted reply sending");
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  824|  4.07k|    break;
  825|      0|  case mhd_CONN_CLOSE_FILE_OFFSET_TOO_LARGE:
  ------------------
  |  Branch (825:3): [True: 0, False: 4.71k]
  ------------------
  826|      0|    close_hard = true;
  827|      0|    end_code = MHD_REQUEST_ENDED_FILE_ERROR;
  828|      0|    sc = MHD_SC_REPLY_FILE_OFFSET_TOO_LARGE;
  829|      0|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (829:9): [True: 0, False: 0]
  |  Branch (829:34): [True: 0, False: 0]
  ------------------
  830|      0|      log_msg = mhd_MSG4LOG ("Response aborted because OS failed " \
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  831|      0|                             "to read too large response file");
  832|      0|    break;
  833|      0|  case mhd_CONN_CLOSE_FILE_READ_ERROR:
  ------------------
  |  Branch (833:3): [True: 0, False: 4.71k]
  ------------------
  834|      0|    close_hard = true;
  835|      0|    end_code = MHD_REQUEST_ENDED_FILE_ERROR;
  836|      0|    sc = MHD_SC_REPLY_FILE_READ_ERROR;
  837|      0|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (837:9): [True: 0, False: 0]
  |  Branch (837:34): [True: 0, False: 0]
  ------------------
  838|      0|      log_msg = mhd_MSG4LOG ("Response aborted because OS failed " \
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  839|      0|                             "to read response file");
  840|      0|    break;
  841|      0|  case mhd_CONN_CLOSE_FILE_TOO_SHORT:
  ------------------
  |  Branch (841:3): [True: 0, False: 4.71k]
  ------------------
  842|      0|    close_hard = true;
  843|      0|    end_code = MHD_REQUEST_ENDED_BY_APP_ERROR;
  844|      0|    sc = MHD_SC_REPLY_FILE_TOO_SHORT;
  845|      0|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (845:9): [True: 0, False: 0]
  |  Branch (845:34): [True: 0, False: 0]
  ------------------
  846|      0|      log_msg = mhd_MSG4LOG ("Response aborted because response file is "
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  847|      0|                             "shorter that expected");
  848|      0|    break;
  849|      0|#ifdef MHD_SUPPORT_AUTH_DIGEST
  850|      0|  case mhd_CONN_CLOSE_NONCE_ERROR:
  ------------------
  |  Branch (850:3): [True: 0, False: 4.71k]
  ------------------
  851|      0|    close_hard = true;
  852|      0|    end_code = MHD_REQUEST_ENDED_NONCE_ERROR;
  853|      0|    sc = MHD_SC_REPLY_NONCE_ERROR;
  854|      0|    mhd_assert (!reply_sending_aborted);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  855|      0|    break;
  856|      0|#endif /* MHD_SUPPORT_AUTH_DIGEST */
  857|       |
  858|      0|  case mhd_CONN_CLOSE_INT_ERROR:
  ------------------
  |  Branch (858:3): [True: 0, False: 4.71k]
  ------------------
  859|      0|    close_hard = true;
  860|      0|    end_code = MHD_REQUEST_ENDED_NO_RESOURCES;
  861|      0|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (861:9): [True: 0, False: 0]
  |  Branch (861:34): [True: 0, False: 0]
  ------------------
  862|      0|      log_msg = mhd_MSG4LOG ("Response aborted due to MHD internal error");
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  863|      0|    break;
  864|      0|  case mhd_CONN_CLOSE_EXTR_EVENT_REG_FAILED:
  ------------------
  |  Branch (864:3): [True: 0, False: 4.71k]
  ------------------
  865|      0|    close_hard = true;
  866|      0|    end_code = MHD_REQUEST_ENDED_BY_EXT_EVENT_ERROR;
  867|      0|    sc = MHD_SC_EXTR_EVENT_REG_FAILED;
  868|      0|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (868:9): [True: 0, False: 0]
  |  Branch (868:34): [True: 0, False: 0]
  ------------------
  869|      0|      log_msg = mhd_MSG4LOG ("Response aborted due to external event " \
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  870|      0|                             "registration failure");
  871|      0|    break;
  872|      0|  case mhd_CONN_CLOSE_NO_SYS_RESOURCES:
  ------------------
  |  Branch (872:3): [True: 0, False: 4.71k]
  ------------------
  873|      0|    close_hard = true;
  874|      0|    end_code = MHD_REQUEST_ENDED_NO_RESOURCES;
  875|      0|    sc = MHD_SC_NO_SYS_RESOURCES;
  876|      0|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (876:9): [True: 0, False: 0]
  |  Branch (876:34): [True: 0, False: 0]
  ------------------
  877|      0|      log_msg = mhd_MSG4LOG ("Response aborted due to lack of " \
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  878|      0|                             "system resources");
  879|      0|    break;
  880|      0|  case mhd_CONN_CLOSE_SOCKET_ERR:
  ------------------
  |  Branch (880:3): [True: 0, False: 4.71k]
  ------------------
  881|      0|    close_hard = true;
  882|      0|    switch (c->sk.state.discnt_err)
  883|      0|    {
  884|      0|    case mhd_SOCKET_ERR_NOMEM:
  ------------------
  |  Branch (884:5): [True: 0, False: 0]
  ------------------
  885|      0|      end_code = MHD_REQUEST_ENDED_NO_RESOURCES;
  886|      0|      sc = MHD_SC_NO_SYS_RESOURCES;
  887|      0|      if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (887:11): [True: 0, False: 0]
  |  Branch (887:36): [True: 0, False: 0]
  ------------------
  888|      0|        log_msg = mhd_MSG4LOG ("Response aborted because system closed " \
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  889|      0|                               "socket due to lack of system resources");
  890|      0|      break;
  891|      0|    case mhd_SOCKET_ERR_REMT_DISCONN:
  ------------------
  |  Branch (891:5): [True: 0, False: 0]
  ------------------
  892|      0|      close_hard = false;
  893|      0|      end_code = (mhd_HTTP_STAGE_INIT == c->stage) ?
  ------------------
  |  Branch (893:18): [True: 0, False: 0]
  ------------------
  894|      0|                 MHD_REQUEST_ENDED_COMPLETED_OK /* Not used */
  895|      0|                 : MHD_REQUEST_ENDED_CLIENT_ABORT;
  896|      0|      if (reply_sending_aborted)
  ------------------
  |  Branch (896:11): [True: 0, False: 0]
  ------------------
  897|      0|      {
  898|      0|        sc = MHD_SC_CLIENT_CLOSED_CONN_EARLY;
  899|      0|        if (NULL == log_msg)
  ------------------
  |  Branch (899:13): [True: 0, False: 0]
  ------------------
  900|      0|          log_msg = mhd_MSG4LOG ("Response aborted because remote client " \
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  901|      0|                                 "closed connection early");
  902|      0|      }
  903|      0|      break;
  904|      0|    case mhd_SOCKET_ERR_CONNRESET:
  ------------------
  |  Branch (904:5): [True: 0, False: 0]
  ------------------
  905|      0|      end_code = MHD_REQUEST_ENDED_CLIENT_ABORT;
  906|      0|      sc = MHD_SC_CONNECTION_RESET;
  907|      0|      if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (907:11): [True: 0, False: 0]
  |  Branch (907:36): [True: 0, False: 0]
  ------------------
  908|      0|        log_msg = mhd_MSG4LOG ("Response aborted due to aborted connection");
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  909|      0|      break;
  910|      0|    case mhd_SOCKET_ERR_CONN_BROKEN:
  ------------------
  |  Branch (910:5): [True: 0, False: 0]
  ------------------
  911|      0|    case mhd_SOCKET_ERR_NOTCONN:
  ------------------
  |  Branch (911:5): [True: 0, False: 0]
  ------------------
  912|      0|#ifdef MHD_SUPPORT_HTTPS
  913|      0|    case mhd_SOCKET_ERR_TLS:
  ------------------
  |  Branch (913:5): [True: 0, False: 0]
  ------------------
  914|      0|#endif /* MHD_SUPPORT_HTTPS */
  915|      0|    case mhd_SOCKET_ERR_PIPE:
  ------------------
  |  Branch (915:5): [True: 0, False: 0]
  ------------------
  916|      0|    case mhd_SOCKET_ERR_NOT_CHECKED:
  ------------------
  |  Branch (916:5): [True: 0, False: 0]
  ------------------
  917|      0|    case mhd_SOCKET_ERR_BADF:
  ------------------
  |  Branch (917:5): [True: 0, False: 0]
  ------------------
  918|      0|    case mhd_SOCKET_ERR_INVAL:
  ------------------
  |  Branch (918:5): [True: 0, False: 0]
  ------------------
  919|      0|    case mhd_SOCKET_ERR_OPNOTSUPP:
  ------------------
  |  Branch (919:5): [True: 0, False: 0]
  ------------------
  920|      0|    case mhd_SOCKET_ERR_NOTSOCK:
  ------------------
  |  Branch (920:5): [True: 0, False: 0]
  ------------------
  921|      0|    case mhd_SOCKET_ERR_OTHER:
  ------------------
  |  Branch (921:5): [True: 0, False: 0]
  ------------------
  922|      0|    case mhd_SOCKET_ERR_INTERNAL:
  ------------------
  |  Branch (922:5): [True: 0, False: 0]
  ------------------
  923|      0|    case mhd_SOCKET_ERR_NO_ERROR:
  ------------------
  |  Branch (923:5): [True: 0, False: 0]
  ------------------
  924|      0|      end_code = MHD_REQUEST_ENDED_CONNECTION_ERROR;
  925|      0|      sc = MHD_SC_CONNECTION_BROKEN;
  926|      0|      if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (926:11): [True: 0, False: 0]
  |  Branch (926:36): [True: 0, False: 0]
  ------------------
  927|      0|        log_msg = mhd_MSG4LOG ("Response aborted due to broken connection");
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  928|      0|      break;
  929|      0|    case mhd_SOCKET_ERR_AGAIN:
  ------------------
  |  Branch (929:5): [True: 0, False: 0]
  ------------------
  930|      0|    case mhd_SOCKET_ERR_INTR:
  ------------------
  |  Branch (930:5): [True: 0, False: 0]
  ------------------
  931|      0|    default:
  ------------------
  |  Branch (931:5): [True: 0, False: 0]
  ------------------
  932|      0|      mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
  933|      0|      break;
  934|      0|    }
  935|      0|    break;
  936|      0|  case mhd_CONN_CLOSE_DAEMON_SHUTDOWN:
  ------------------
  |  Branch (936:3): [True: 0, False: 4.71k]
  ------------------
  937|      0|    close_hard = true;
  938|      0|    end_code = MHD_REQUEST_ENDED_DAEMON_SHUTDOWN;
  939|      0|    break;
  940|       |
  941|      0|  case mhd_CONN_CLOSE_TIMEDOUT:
  ------------------
  |  Branch (941:3): [True: 0, False: 4.71k]
  ------------------
  942|      0|    if (mhd_HTTP_STAGE_INIT == c->stage)
  ------------------
  |  Branch (942:9): [True: 0, False: 0]
  ------------------
  943|      0|    {
  944|      0|      close_hard = false;
  945|      0|      end_code = MHD_REQUEST_ENDED_COMPLETED_OK; /* Not used */
  946|      0|      break;
  947|      0|    }
  948|      0|    close_hard = true;
  949|      0|    end_code = MHD_REQUEST_ENDED_TIMEOUT_REACHED;
  950|      0|    sc = MHD_SC_CONNECTION_TIMEOUT;
  951|      0|    if (reply_sending_aborted && (NULL == log_msg))
  ------------------
  |  Branch (951:9): [True: 0, False: 0]
  |  Branch (951:34): [True: 0, False: 0]
  ------------------
  952|      0|      log_msg = mhd_MSG4LOG ("Response aborted due to sending timeout");
  ------------------
  |  |   88|      0|#  define mhd_MSG4LOG(msg) msg
  ------------------
  953|      0|    break;
  954|       |
  955|      0|  case mhd_CONN_CLOSE_ERR_REPLY_SENT:
  ------------------
  |  Branch (955:3): [True: 0, False: 4.71k]
  ------------------
  956|      0|    close_hard = false;
  957|      0|    end_code = c->rq.too_large ?
  ------------------
  |  Branch (957:16): [True: 0, False: 0]
  ------------------
  958|      0|               MHD_REQUEST_ENDED_NO_RESOURCES :
  959|      0|               MHD_REQUEST_ENDED_HTTP_PROTOCOL_ERROR;
  960|      0|    break;
  961|      0|#ifdef MHD_SUPPORT_UPGRADE
  962|      0|  case mhd_CONN_CLOSE_UPGRADE:
  ------------------
  |  Branch (962:3): [True: 0, False: 4.71k]
  ------------------
  963|      0|    close_hard = false;
  964|      0|    end_code = MHD_REQUEST_ENDED_COMPLETED_OK_UPGRADE;
  965|      0|    break;
  966|      0|#endif /* MHD_SUPPORT_UPGRADE */
  967|      0|  case mhd_CONN_CLOSE_HTTP_COMPLETED:
  ------------------
  |  Branch (967:3): [True: 0, False: 4.71k]
  ------------------
  968|      0|    close_hard = false;
  969|      0|    end_code = MHD_REQUEST_ENDED_COMPLETED_OK;
  970|      0|    break;
  971|      0|#ifdef mhd_HAVE_TLS_ACME
  972|      0|  case mhd_CONN_CLOSE_ACME_ALPN_CHALLENGE_COMPLETED:
  ------------------
  |  Branch (972:3): [True: 0, False: 4.71k]
  ------------------
  973|      0|    close_hard = false;
  974|      0|    end_code = MHD_REQUEST_ENDED_COMPLETED_OK;
  975|      0|    break;
  976|      0|#endif /* mhd_HAVE_TLS_ACME */
  977|       |
  978|       |
  979|      0|#ifdef MHD_SUPPORT_HTTP2
  980|      0|  case mhd_CONN_CLOSE_H2_CLOSE_SOFT:
  ------------------
  |  Branch (980:3): [True: 0, False: 4.71k]
  ------------------
  981|      0|  case mhd_CONN_CLOSE_H2_CLOSE_HARD:
  ------------------
  |  Branch (981:3): [True: 0, False: 4.71k]
  ------------------
  982|      0|#endif /* MHD_SUPPORT_HTTP2 */
  983|      0|  default:
  ------------------
  |  Branch (983:3): [True: 0, False: 4.71k]
  ------------------
  984|      0|    mhd_assert (0 && "Unreachable code");
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  985|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
  986|      0|    end_code = MHD_REQUEST_ENDED_COMPLETED_OK;
  987|      0|    close_hard = false;
  988|      0|    break;
  989|  4.71k|  }
  990|       |
  991|  4.71k|  mhd_assert ((NULL == log_msg) || (MHD_SC_INTERNAL_ERROR != sc));
  ------------------
  |  |   66|  4.71k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  992|       |
  993|  4.71k|#ifdef MHD_SUPPORT_UPGRADE
  994|  4.71k|  if (mhd_CONN_CLOSE_UPGRADE == reason)
  ------------------
  |  Branch (994:7): [True: 0, False: 4.71k]
  ------------------
  995|      0|  {
  996|      0|    mhd_assert (mhd_HTTP_STAGE_UPGRADING == c->stage);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  997|      0|    c->event_loop_info = MHD_EVENT_LOOP_INFO_UPGRADED;
  998|      0|  }
  999|  4.71k|  else
 1000|  4.71k|#endif /* MHD_SUPPORT_UPGRADE */
 1001|  4.71k|  if (1)
  ------------------
  |  Branch (1001:7): [True: 4.71k, Folded]
  ------------------
 1002|  4.71k|  {
 1003|  4.71k|    if (conn_start_socket_closing (c,
  ------------------
  |  Branch (1003:9): [True: 0, False: 4.71k]
  ------------------
 1004|  4.71k|                                   close_hard))
 1005|      0|    {
 1006|      0|      (void)0;  // TODO: start local lingering phase
 1007|      0|      c->stage = mhd_HTTP_STAGE_PRE_CLOSING; // TODO: start local lingering phase
 1008|      0|      c->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP; // TODO: start local lingering phase
 1009|      0|    }
 1010|  4.71k|    else
 1011|  4.71k|    {  /* No need / not possible to linger */
 1012|  4.71k|      c->stage = mhd_HTTP_STAGE_PRE_CLOSING;
 1013|  4.71k|      c->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
 1014|  4.71k|    }
 1015|  4.71k|  }
 1016|       |
 1017|  4.71k|#ifdef MHD_SUPPORT_LOG_FUNCTIONALITY
 1018|  4.71k|  if (NULL != log_msg)
  ------------------
  |  Branch (1018:7): [True: 639, False: 4.07k]
  ------------------
 1019|    639|  {
 1020|    639|    mhd_LOG_MSG (c->daemon, sc, log_msg);
  ------------------
  |  |   80|    639|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 1021|    639|  }
 1022|       |#else  /* ! MHD_SUPPORT_LOG_FUNCTIONALITY */
 1023|       |  (void)log_msg;  /* Mute compiler warning */
 1024|       |  (void)sc;       /* Mute compiler warning */
 1025|       |#endif /* ! MHD_SUPPORT_LOG_FUNCTIONALITY */
 1026|       |
 1027|       |#if 0 // TODO: notification callback
 1028|       |  mhd_assert ((mhd_HTTP_STAGE_INIT != c->stage) || (!c->rq.app_aware));
 1029|       |  if ((NULL != d->notify_completed)
 1030|       |      && (c->rq.app_aware))
 1031|       |    d->notify_completed (d->notify_completed_cls,
 1032|       |                         c,
 1033|       |                         &c->rq.app_context,
 1034|       |                         MHD_REQUEST_ENDED_COMPLETED_OK);
 1035|       |#else
 1036|  4.71k|  (void)end_code;
 1037|  4.71k|#endif
 1038|  4.71k|  c->rq.app_aware = false;
 1039|       |
 1040|  4.71k|  if (!c->suspended)
  ------------------
  |  Branch (1040:7): [True: 4.71k, False: 0]
  ------------------
 1041|  4.71k|  {
 1042|  4.71k|    mhd_assert (!c->resuming);
  ------------------
  |  |   66|  4.71k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1043|  4.71k|    mhd_conn_deinit_activity_timeout (c);
 1044|  4.71k|  }
 1045|       |
 1046|       |#ifndef NDEBUG
 1047|       |  c->dbg.closing_started = true;
 1048|       |#endif
 1049|  4.71k|}
stream_funcs.c:_ZL25conn_start_socket_closingP14MHD_Connectionb:
  663|  4.71k|{
  664|  4.71k|  bool need_lingering;
  665|       |  /* Make changes on the socket early to let the kernel and the remote
  666|       |   * to process the changes in parallel. */
  667|  4.71k|  if (close_hard)
  ------------------
  |  Branch (667:7): [True: 4.71k, False: 0]
  ------------------
  668|  4.71k|  {
  669|       |    /* Use abortive closing, send RST to remote to indicate a problem */
  670|  4.71k|    (void)mhd_socket_set_hard_close (c->sk.fd);
  671|  4.71k|    c->stage = mhd_HTTP_STAGE_PRE_CLOSING;
  672|  4.71k|    c->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
  673|       |
  674|  4.71k|    return false;
  675|  4.71k|  }
  676|       |
  677|      0|  mhd_assert (c->sk.state.rmt_shut_wr \
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  678|      0|              || !mhd_SOCKET_ERR_IS_HARD (c->sk.state.discnt_err));
  679|       |
  680|      0|  need_lingering = !c->sk.state.rmt_shut_wr;
  681|      0|  if (need_lingering)
  ------------------
  |  Branch (681:7): [True: 0, False: 0]
  ------------------
  682|      0|  {
  683|      0|#ifdef MHD_SUPPORT_HTTPS
  684|      0|    if (mhd_C_HAS_TLS (c))
  ------------------
  |  |  887|      0|#  define mhd_C_HAS_TLS(c) (((c)->tls) ? (! 0) : (0))
  |  |  ------------------
  |  |  |  Branch (887:28): [True: 0, False: 0]
  |  |  |  Branch (887:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  685|      0|    {
  686|      0|      if ((0 != (((unsigned int)c->sk.ready)
  ------------------
  |  Branch (686:11): [True: 0, False: 0]
  ------------------
  687|      0|                 & mhd_SOCKET_NET_STATE_SEND_READY))
  688|      0|          || c->sk.props.is_nonblck)
  ------------------
  |  Branch (688:14): [True: 0, False: 0]
  ------------------
  689|      0|        need_lingering =
  690|      0|          (mhd_TLS_PROCED_FAILED != mhd_tls_conn_shutdown (c->tls));
  ------------------
  |  |  225|      0|        mhd_TLS_FUNC (_conn_shutdown)((c_tls))
  |  |  ------------------
  |  |  |  |  251|      0|        mhd_MACRO_CONCAT3 (mhd_tls_,mhd_TLS_FUNC_NAME_ID,name_suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|      0|#define mhd_MACRO_CONCAT3(a, b, c)      mhd_MACRO_CONCAT3_ (a,b,c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   64|      0|#define mhd_MACRO_CONCAT3_(a, b, c)     a ## b ## c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  691|      0|    }
  692|      0|    else
  693|      0|#endif /* MHD_SUPPORT_HTTPS */
  694|      0|    if (1)
  ------------------
  |  Branch (694:9): [True: 0, Folded]
  ------------------
  695|      0|    {
  696|      0|      need_lingering = mhd_socket_shut_wr (c->sk.fd);
  697|      0|      if (need_lingering)
  ------------------
  |  Branch (697:11): [True: 0, False: 0]
  ------------------
  698|      0|        need_lingering = (!c->sk.state.rmt_shut_wr);  /* Skip as already closed */
  699|      0|    }
  700|      0|  }
  701|       |
  702|      0|  return need_lingering;
  703|  4.71k|}

_Z18mhd_parse_uri_argsmPcPFbPvPK10MHD_StringPK18MHD_StringNullableES0_:
 1221|    317|{
 1222|    317|  size_t i;
 1223|       |
 1224|    317|  mhd_assert (args_len < (size_t)(args_len + 1));  /* Does not work when args_len == SIZE_MAX */
  ------------------
  |  |   66|    317|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1225|       |
 1226|    613|  for (i = 0; i < args_len; ++i) /* Looking for names of the parameters */
  ------------------
  |  Branch (1226:15): [True: 317, False: 296]
  ------------------
 1227|    317|  {
 1228|    317|    size_t name_start;
 1229|    317|    size_t name_len;
 1230|    317|    size_t value_start;
 1231|    317|    size_t value_len;
 1232|    317|    struct MHD_String name;
 1233|    317|    struct MHD_StringNullable value;
 1234|       |
 1235|       |    /* Found start of the name */
 1236|       |
 1237|    317|    value_start = 0;
 1238|    634|    for (name_start = i; i < args_len; ++i) /* Processing parameter */
  ------------------
  |  Branch (1238:26): [True: 634, False: 0]
  ------------------
 1239|    634|    {
 1240|    634|      if ('+' == args[i])
  ------------------
  |  Branch (1240:11): [True: 0, False: 634]
  ------------------
 1241|      0|        args[i] = ' ';
 1242|    634|      else if ('=' == args[i])
  ------------------
  |  Branch (1242:16): [True: 317, False: 317]
  ------------------
 1243|    317|      {
 1244|       |        /* Found start of the value */
 1245|    634|        for (value_start = ++i; i < args_len; ++i) /* Processing parameter value */
  ------------------
  |  Branch (1245:33): [True: 317, False: 317]
  ------------------
 1246|    317|        {
 1247|    317|          if ('+' == args[i])
  ------------------
  |  Branch (1247:15): [True: 0, False: 317]
  ------------------
 1248|      0|            args[i] = ' ';
 1249|    317|          else if ('&' == args[i]) /* delimiter for the next parameter */
  ------------------
  |  Branch (1249:20): [True: 0, False: 317]
  ------------------
 1250|      0|            break; /* Next parameter */
 1251|    317|        }
 1252|    317|        break; /* End of the current parameter */
 1253|    317|      }
 1254|    317|      else if ('&' == args[i])
  ------------------
  |  Branch (1254:16): [True: 0, False: 317]
  ------------------
 1255|      0|        break; /* End of the name of the parameter without a value */
 1256|    634|    }
 1257|       |
 1258|       |    /* PCT-decode, zero-terminate and store the found parameter */
 1259|       |
 1260|    317|    if (0 != value_start) /* Value cannot start at zero position */
  ------------------
  |  Branch (1260:9): [True: 317, False: 0]
  ------------------
 1261|    317|    { /* Name with value */
 1262|    317|      mhd_assert (name_start + 1 <= value_start);
  ------------------
  |  |   66|    317|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1263|    317|      name_len = value_start - name_start - 1;
 1264|       |
 1265|    317|      value_len =
 1266|    317|        mhd_str_pct_decode_lenient_n (args + value_start, i - value_start,
 1267|    317|                                      args + value_start, i - value_start,
 1268|    317|                                      NULL); // TODO: add support for broken encoding detection
 1269|    317|      if (value_start + value_len < args_len)
  ------------------
  |  Branch (1269:11): [True: 0, False: 317]
  ------------------
 1270|      0|        args[value_start + value_len] = 0;
 1271|    317|      value.cstr = args + value_start;
 1272|    317|      value.len = value_len;
 1273|    317|    }
 1274|      0|    else
 1275|      0|    { /* Name without value */
 1276|      0|      name_len = i - name_start;
 1277|       |
 1278|      0|      value.cstr = NULL;
 1279|      0|      value.len = 0;
 1280|      0|    }
 1281|    317|    name_len = mhd_str_pct_decode_lenient_n (args + name_start, name_len,
 1282|    317|                                             args + name_start, name_len,
 1283|    317|                                             NULL); // TODO: add support for broken encoding detection
 1284|    317|    if (name_start + name_len < args_len)
  ------------------
  |  Branch (1284:9): [True: 317, False: 0]
  ------------------
 1285|    317|      args[name_start + name_len] = 0;
 1286|    317|    name.cstr = args + name_start;
 1287|    317|    name.len = name_len;
 1288|    317|    if (!cb (cls, &name, &value))
  ------------------
  |  Branch (1288:9): [True: 21, False: 296]
  ------------------
 1289|     21|      return false;
 1290|    317|  }
 1291|    296|  return true;
 1292|    317|}
_Z27mhd_stream_get_request_lineP14MHD_Connection:
 1479|  2.72k|{
 1480|  2.72k|  const int discp_lvl = c->daemon->req_cfg.strictness;
 1481|       |  /* Parse whitespace in URI, special parsing of the request line */
 1482|  2.72k|  const bool wsp_in_uri = (0 >= discp_lvl);
 1483|       |  /* Keep whitespace in URI, give app URI with whitespace instead of
 1484|       |     automatic redirect to fixed URI */
 1485|  2.72k|  const bool wsp_in_uri_keep = (-2 >= discp_lvl);
 1486|       |
 1487|  2.72k|  if (!get_request_line_inner (c))
  ------------------
  |  Branch (1487:7): [True: 1.05k, False: 1.67k]
  ------------------
 1488|  1.05k|  {
 1489|       |    /* End of the request line has not been found yet */
 1490|  1.05k|    mhd_assert ((!wsp_in_uri) || NULL == c->rq.version);
  ------------------
  |  |   66|  1.05k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1491|  1.05k|    if ((NULL != c->rq.version)
  ------------------
  |  Branch (1491:9): [True: 0, False: 1.05k]
  ------------------
 1492|      0|        && (HTTP_VER_LEN <
  ------------------
  |  |  480|      0|#define HTTP_VER_LEN (mhd_SSTR_LEN (MHD_HTTP_VERSION_1_1_STR))
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1492:12): [True: 0, False: 0]
  ------------------
 1493|      0|            (c->rq.hdrs.rq_line.proc_pos
 1494|      0|             - (size_t)(c->rq.version - c->read_buffer))))
 1495|      0|    {
 1496|      0|      c->rq.http_ver = MHD_HTTP_VERSION_INVALID;
 1497|      0|      mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 1498|      0|                                     MHD_HTTP_STATUS_BAD_REQUEST,
 1499|      0|                                     ERR_RSP_REQUEST_MALFORMED);
 1500|      0|      return true; /* Error in the request */
 1501|      0|    }
 1502|  1.05k|    return false;
 1503|  1.05k|  }
 1504|  1.67k|  if (mhd_HTTP_STAGE_REQ_LINE_RECEIVING < c->stage)
  ------------------
  |  Branch (1504:7): [True: 860, False: 819]
  ------------------
 1505|    860|    return true; /* Error in the request */
 1506|       |
 1507|    819|  mhd_assert (mhd_HTTP_STAGE_REQ_LINE_RECEIVING == c->stage);
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1508|    819|  mhd_assert (NULL == c->rq.url);
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1509|    819|  mhd_assert (0 == c->rq.url_len);
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1510|    819|  mhd_assert (NULL != c->rq.hdrs.rq_line.rq_tgt);
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1511|    819|  if (0 != c->rq.hdrs.rq_line.num_ws_in_uri)
  ------------------
  |  Branch (1511:7): [True: 0, False: 819]
  ------------------
 1512|      0|  {
 1513|      0|    if (!wsp_in_uri)
  ------------------
  |  Branch (1513:9): [True: 0, False: 0]
  ------------------
 1514|      0|    {
 1515|      0|      mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 1516|      0|                                     MHD_HTTP_STATUS_BAD_REQUEST,
 1517|      0|                                     ERR_RSP_RQ_TARGET_INVALID_CHAR);
 1518|      0|      return true; /* Error in the request */
 1519|      0|    }
 1520|      0|    if (!wsp_in_uri_keep)
  ------------------
  |  Branch (1520:9): [True: 0, False: 0]
  ------------------
 1521|      0|    {
 1522|      0|      send_redirect_fixed_rq_target (c);
 1523|      0|      return true; /* Error in the request */
 1524|      0|    }
 1525|      0|  }
 1526|    819|  if (!process_request_target (c))
  ------------------
  |  Branch (1526:7): [True: 21, False: 798]
  ------------------
 1527|     21|    return true; /* Error in processing */
 1528|       |
 1529|    798|  c->stage = mhd_HTTP_STAGE_REQ_LINE_RECEIVED;
 1530|    798|  return true;
 1531|    819|}
_Z36mhd_stream_switch_to_rq_headers_procP14MHD_Connection:
 1536|  1.18k|{
 1537|  1.18k|  c->rq.field_lines.start = c->read_buffer;
 1538|  1.18k|  mhd_stream_reset_rq_hdr_proc_state (c);
 1539|  1.18k|  c->stage = mhd_HTTP_STAGE_REQ_HEADERS_RECEIVING;
 1540|  1.18k|}
_Z34mhd_stream_reset_rq_hdr_proc_stateP14MHD_Connection:
 2095|  1.42k|{
 2096|  1.42k|  memset (&c->rq.hdrs.hdr, 0, sizeof(c->rq.hdrs.hdr));
 2097|  1.42k|}
_Z32mhd_stream_parse_request_headersP14MHD_Connection:
 2653|  2.48k|{
 2654|  2.48k|  bool has_host;
 2655|  2.48k|  bool has_trenc;
 2656|  2.48k|  bool has_cntnlen;
 2657|  2.48k|  bool has_keepalive;
 2658|  2.48k|  struct mhd_RequestField *f;
 2659|       |
 2660|       |  /* The presence of the request body is indicated by "Content-Length:" or
 2661|       |     "Transfer-Encoding:" request headers.
 2662|       |     Unless one of these two headers is used, the request has no request body.
 2663|       |     See RFC9112, Section 6, paragraph 4. */
 2664|  2.48k|  c->rq.have_chunked_upload = false;
 2665|  2.48k|  c->rq.cntn.cntn_size = 0;
 2666|       |
 2667|  2.48k|  has_host = false;
 2668|  2.48k|  has_trenc = false;
 2669|  2.48k|  has_cntnlen = false;
 2670|  2.48k|  has_keepalive = true;
 2671|       |
 2672|  2.48k|  for (f = mhd_DLINKEDL_GET_FIRST (&(c->rq), fields);
  ------------------
  |  |  362|  2.48k|        mhd_DLINKEDL_GET_FIRST_D (&((p_own)->list_name))
  |  |  ------------------
  |  |  |  |  248|  2.48k|#define mhd_DLINKEDL_GET_FIRST_D(p_list) ((p_list)->first)
  |  |  ------------------
  ------------------
 2673|  6.98k|       NULL != f;
  ------------------
  |  Branch (2673:8): [True: 4.76k, False: 2.21k]
  ------------------
 2674|  4.49k|       f = mhd_DLINKEDL_GET_NEXT (f, fields))
  ------------------
  |  |  377|  4.49k|#define mhd_DLINKEDL_GET_NEXT(p_obj, links_name) ((p_obj)->links_name.next)
  ------------------
 2675|  4.76k|  {
 2676|  4.76k|    if (MHD_VK_HEADER != f->field.kind)
  ------------------
  |  Branch (2676:9): [True: 255, False: 4.51k]
  ------------------
 2677|    255|      continue;
 2678|       |
 2679|       |    /* "Host:" */
 2680|  4.51k|    if (mhd_str_equal_caseless_n_st (MHD_HTTP_HEADER_HOST,
  ------------------
  |  |  142|  4.51k|        ((mhd_SSTR_LEN (arr) == (l)) \
  |  |  ------------------
  |  |  |  |   54|  4.51k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |  |  Branch (142:10): [True: 2.46k, False: 2.04k]
  |  |  ------------------
  |  |  143|  4.51k|         && mhd_str_equal_caseless_bin_n (arr,str,l))
  |  |  ------------------
  |  |  |  Branch (143:13): [True: 2.46k, False: 0]
  |  |  ------------------
  ------------------
 2681|  4.51k|                                     f->field.nv.name.cstr,
 2682|  4.51k|                                     f->field.nv.name.len))
 2683|  2.46k|    {
 2684|  2.46k|      if ((has_host)
  ------------------
  |  Branch (2684:11): [True: 0, False: 2.46k]
  ------------------
 2685|      0|          && (-3 < c->daemon->req_cfg.strictness))
  ------------------
  |  Branch (2685:14): [True: 0, False: 0]
  ------------------
 2686|      0|      {
 2687|      0|        mhd_LOG_MSG (c->daemon, MHD_SC_HOST_HEADER_SEVERAL, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2688|      0|                     "Received request with more than one 'Host' header.");
 2689|      0|        mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 2690|      0|                                       MHD_HTTP_STATUS_BAD_REQUEST,
 2691|      0|                                       ERR_RSP_REQUEST_HAS_SEVERAL_HOSTS);
 2692|      0|        return;
 2693|      0|      }
 2694|  2.46k|      if ((0u == f->field.nv.value.len)
  ------------------
  |  Branch (2694:11): [True: 0, False: 2.46k]
  ------------------
 2695|      0|          && (-3 < c->daemon->req_cfg.strictness))
  ------------------
  |  Branch (2695:14): [True: 0, False: 0]
  ------------------
 2696|      0|      {
 2697|      0|        mhd_LOG_MSG (c->daemon, MHD_SC_HOST_HEADER_MALFORMED, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2698|      0|                     "Received request with empty 'Host' header.");
 2699|      0|        mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 2700|      0|                                       MHD_HTTP_STATUS_BAD_REQUEST,
 2701|      0|                                       ERR_RSP_REQUEST_HAS_MALFORMED_HOST);
 2702|      0|        return;
 2703|      0|      }
 2704|  2.46k|      has_host = true;
 2705|  2.46k|      continue;
 2706|  2.46k|    }
 2707|       |
 2708|       |    /* "Content-Length:" */
 2709|  2.04k|    if (mhd_str_equal_caseless_n_st (MHD_HTTP_HEADER_CONTENT_LENGTH,
  ------------------
  |  |  142|  2.04k|        ((mhd_SSTR_LEN (arr) == (l)) \
  |  |  ------------------
  |  |  |  |   54|  2.04k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |  |  Branch (142:10): [True: 275, False: 1.77k]
  |  |  ------------------
  |  |  143|  2.04k|         && mhd_str_equal_caseless_bin_n (arr,str,l))
  |  |  ------------------
  |  |  |  Branch (143:13): [True: 275, False: 0]
  |  |  ------------------
  ------------------
 2710|  2.04k|                                     f->field.nv.name.cstr,
 2711|  2.04k|                                     f->field.nv.name.len))
 2712|    275|    {
 2713|    275|      size_t num_digits;
 2714|    275|      uint_fast64_t cntn_size;
 2715|       |
 2716|    275|      num_digits = mhd_str_to_uint64_n (f->field.nv.value.cstr,
 2717|    275|                                        f->field.nv.value.len,
 2718|    275|                                        &cntn_size);
 2719|    275|      if (((0 == num_digits)
  ------------------
  |  Branch (2719:12): [True: 0, False: 275]
  ------------------
 2720|      0|           && (0 != f->field.nv.value.len)
  ------------------
  |  Branch (2720:15): [True: 0, False: 0]
  ------------------
 2721|      0|           && ('9' >= f->field.nv.value.cstr[0])
  ------------------
  |  Branch (2721:15): [True: 0, False: 0]
  ------------------
 2722|      0|           && ('0' <= f->field.nv.value.cstr[0]))
  ------------------
  |  Branch (2722:15): [True: 0, False: 0]
  ------------------
 2723|    275|          || (MHD_SIZE_UNKNOWN == c->rq.cntn.cntn_size))
  ------------------
  |  |  302|    275|#  define MHD_SIZE_UNKNOWN UINT64_MAX
  ------------------
  |  Branch (2723:14): [True: 275, False: 0]
  ------------------
 2724|    275|      {
 2725|    275|        mhd_LOG_MSG (c->daemon, MHD_SC_CONTENT_LENGTH_TOO_LARGE, \
  ------------------
  |  |   80|    275|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2726|    275|                     "Too large value of 'Content-Length' header. " \
 2727|    275|                     "Closing connection.");
 2728|    275|        mhd_RESPOND_WITH_ERROR_STATIC (c, \
  ------------------
  |  |   85|    275|          respond_with_error_len ((c), (code), \
  |  |   86|    275|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|    275|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|    275|                                  0, NULL)
  ------------------
 2729|    275|                                       MHD_HTTP_STATUS_CONTENT_TOO_LARGE, \
 2730|    275|                                       ERR_RSP_REQUEST_CONTENTLENGTH_TOOLARGE);
 2731|    275|        return;
 2732|    275|      }
 2733|      0|      else if ((f->field.nv.value.len != num_digits)
  ------------------
  |  Branch (2733:16): [True: 0, False: 0]
  ------------------
 2734|      0|               || (0 == num_digits))
  ------------------
  |  Branch (2734:19): [True: 0, False: 0]
  ------------------
 2735|      0|      {
 2736|      0|        mhd_LOG_MSG (c->daemon, MHD_SC_CONTENT_LENGTH_MALFORMED, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2737|      0|                     "Failed to parse 'Content-Length' header. " \
 2738|      0|                     "Closing connection.");
 2739|      0|        mhd_RESPOND_WITH_ERROR_STATIC (c, \
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 2740|      0|                                       MHD_HTTP_STATUS_BAD_REQUEST, \
 2741|      0|                                       ERR_RSP_REQUEST_CONTENTLENGTH_MALFORMED);
 2742|      0|        return;
 2743|      0|      }
 2744|       |
 2745|      0|      if (has_cntnlen)
  ------------------
  |  Branch (2745:11): [True: 0, False: 0]
  ------------------
 2746|      0|      {
 2747|      0|        bool send_err;
 2748|      0|        send_err = false;
 2749|      0|        if (c->rq.cntn.cntn_size == cntn_size)
  ------------------
  |  Branch (2749:13): [True: 0, False: 0]
  ------------------
 2750|      0|        {
 2751|      0|          if (0 < c->daemon->req_cfg.strictness)
  ------------------
  |  Branch (2751:15): [True: 0, False: 0]
  ------------------
 2752|      0|          {
 2753|      0|            mhd_LOG_MSG (c->daemon, MHD_SC_CONTENT_LENGTH_SEVERAL_SAME, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2754|      0|                         "Received request with more than one " \
 2755|      0|                         "'Content-Length' header with the same value.");
 2756|      0|            send_err = true;
 2757|      0|          }
 2758|      0|        }
 2759|      0|        else
 2760|      0|        {
 2761|      0|          mhd_LOG_MSG (c->daemon, MHD_SC_CONTENT_LENGTH_SEVERAL_DIFFERENT, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2762|      0|                       "Received request with more than one " \
 2763|      0|                       "'Content-Length' header with conflicting values.");
 2764|      0|          send_err = true;
 2765|      0|        }
 2766|       |
 2767|      0|        if (send_err)
  ------------------
  |  Branch (2767:13): [True: 0, False: 0]
  ------------------
 2768|      0|        {
 2769|      0|          mhd_RESPOND_WITH_ERROR_STATIC ( \
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 2770|      0|            c, \
 2771|      0|            MHD_HTTP_STATUS_BAD_REQUEST, \
 2772|      0|            ERR_RSP_REQUEST_CONTENTLENGTH_SEVERAL);
 2773|      0|          return;
 2774|      0|        }
 2775|      0|      }
 2776|      0|      mhd_assert ((0 == c->rq.cntn.cntn_size) \
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2777|      0|                  || (c->rq.cntn.cntn_size == cntn_size));
 2778|      0|      c->rq.cntn.cntn_size = cntn_size;
 2779|      0|      has_cntnlen = true;
 2780|      0|      continue;
 2781|      0|    }
 2782|       |
 2783|       |    /* "Connection:" */
 2784|  1.77k|    if (mhd_str_equal_caseless_n_st (MHD_HTTP_HEADER_CONNECTION,
  ------------------
  |  |  142|  1.77k|        ((mhd_SSTR_LEN (arr) == (l)) \
  |  |  ------------------
  |  |  |  |   54|  1.77k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |  |  Branch (142:10): [True: 0, False: 1.77k]
  |  |  ------------------
  |  |  143|  1.77k|         && mhd_str_equal_caseless_bin_n (arr,str,l))
  |  |  ------------------
  |  |  |  Branch (143:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2785|  1.77k|                                     f->field.nv.name.cstr,
 2786|  1.77k|                                     f->field.nv.name.len))
 2787|      0|    {
 2788|      0|      if (mhd_str_has_token_caseless (f->field.nv.value.cstr, // TODO: compare as size string
  ------------------
  |  Branch (2788:11): [True: 0, False: 0]
  ------------------
 2789|      0|                                      "close",
 2790|      0|                                      mhd_SSTR_LEN ("close")))
  ------------------
  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  ------------------
 2791|      0|      {
 2792|      0|        mhd_assert (mhd_CONN_MUST_UPGRADE != c->conn_reuse);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2793|      0|        c->conn_reuse = mhd_CONN_MUST_CLOSE;
 2794|      0|      }
 2795|      0|      else if ((MHD_HTTP_VERSION_1_0 == c->rq.http_ver)
  ------------------
  |  Branch (2795:16): [True: 0, False: 0]
  ------------------
 2796|      0|               && (mhd_CONN_MUST_CLOSE != c->conn_reuse))
  ------------------
  |  Branch (2796:19): [True: 0, False: 0]
  ------------------
 2797|      0|      {
 2798|      0|        if (mhd_str_has_token_caseless (f->field.nv.value.cstr,  // TODO: compare as size string
  ------------------
  |  Branch (2798:13): [True: 0, False: 0]
  ------------------
 2799|      0|                                        "keep-alive",
 2800|      0|                                        mhd_SSTR_LEN ("keep-alive")))
  ------------------
  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  ------------------
 2801|      0|          has_keepalive = true;
 2802|      0|      }
 2803|       |
 2804|      0|      continue;
 2805|      0|    }
 2806|       |
 2807|       |    /* "Transfer-Encoding:" */
 2808|  1.77k|    if (mhd_str_equal_caseless_n_st (MHD_HTTP_HEADER_TRANSFER_ENCODING,
  ------------------
  |  |  142|  1.77k|        ((mhd_SSTR_LEN (arr) == (l)) \
  |  |  ------------------
  |  |  |  |   54|  1.77k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |  |  Branch (142:10): [True: 641, False: 1.13k]
  |  |  ------------------
  |  |  143|  1.77k|         && mhd_str_equal_caseless_bin_n (arr,str,l))
  |  |  ------------------
  |  |  |  Branch (143:13): [True: 641, False: 0]
  |  |  ------------------
  ------------------
 2809|  1.77k|                                     f->field.nv.name.cstr,
 2810|  1.77k|                                     f->field.nv.name.len))
 2811|    641|    {
 2812|    641|      if (mhd_str_equal_caseless_n_st ("chunked",
  ------------------
  |  |  142|    641|        ((mhd_SSTR_LEN (arr) == (l)) \
  |  |  ------------------
  |  |  |  |   54|    641|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |  |  Branch (142:10): [True: 641, False: 0]
  |  |  ------------------
  |  |  143|    641|         && mhd_str_equal_caseless_bin_n (arr,str,l))
  |  |  ------------------
  |  |  |  Branch (143:13): [True: 641, False: 0]
  |  |  ------------------
  ------------------
 2813|    641|                                       f->field.nv.value.cstr,
 2814|    641|                                       f->field.nv.value.len))
 2815|    641|      {
 2816|    641|        c->rq.have_chunked_upload = true;
 2817|    641|        c->rq.cntn.cntn_size = MHD_SIZE_UNKNOWN;
  ------------------
  |  |  302|    641|#  define MHD_SIZE_UNKNOWN UINT64_MAX
  ------------------
 2818|    641|      }
 2819|      0|      else
 2820|      0|      {
 2821|      0|        mhd_LOG_MSG (c->daemon, MHD_SC_TRANSFER_ENCODING_UNSUPPORTED, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2822|      0|                     "The 'Transfer-Encoding' used in request is " \
 2823|      0|                     "unsupported or invalid.");
 2824|      0|        mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 2825|      0|                                       MHD_HTTP_STATUS_BAD_REQUEST,
 2826|      0|                                       ERR_RSP_UNSUPPORTED_TR_ENCODING);
 2827|      0|        return;
 2828|      0|      }
 2829|    641|      has_trenc = true;
 2830|    641|      continue;
 2831|    641|    }
 2832|       |
 2833|  1.13k|#ifdef MHD_SUPPORT_COOKIES
 2834|       |    /* "Cookie:" */
 2835|  1.13k|    if ((!c->daemon->req_cfg.disable_cookies)
  ------------------
  |  Branch (2835:9): [True: 1.13k, False: 0]
  ------------------
 2836|  1.13k|        && mhd_str_equal_caseless_n_st (MHD_HTTP_HEADER_COOKIE,
  ------------------
  |  |  142|  1.13k|        ((mhd_SSTR_LEN (arr) == (l)) \
  |  |  ------------------
  |  |  |  |   54|  1.13k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |  |  Branch (142:10): [True: 0, False: 1.13k]
  |  |  ------------------
  |  |  143|  1.13k|         && mhd_str_equal_caseless_bin_n (arr,str,l))
  |  |  ------------------
  |  |  |  Branch (143:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2837|  1.13k|                                        f->field.nv.name.cstr,
 2838|  1.13k|                                        f->field.nv.name.len))
 2839|      0|    {
 2840|      0|      if (MHD_PARSE_COOKIE_NO_MEMORY ==
  ------------------
  |  Branch (2840:11): [True: 0, False: 0]
  ------------------
 2841|      0|          parse_cookie_header (c,
 2842|      0|                               &(f->field.nv.value)))
 2843|      0|      {
 2844|      0|        handle_req_cookie_no_space (c);
 2845|      0|        return;
 2846|      0|      }
 2847|      0|      continue;
 2848|      0|    }
 2849|  1.13k|#endif /* MHD_SUPPORT_COOKIES */
 2850|       |
 2851|       |    /* "Expect: 100-continue" */
 2852|  1.13k|    if (mhd_str_equal_caseless_n_st (MHD_HTTP_HEADER_EXPECT,
  ------------------
  |  |  142|  1.13k|        ((mhd_SSTR_LEN (arr) == (l)) \
  |  |  ------------------
  |  |  |  |   54|  1.13k|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |  |  Branch (142:10): [True: 0, False: 1.13k]
  |  |  ------------------
  |  |  143|  1.13k|         && mhd_str_equal_caseless_bin_n (arr,str,l))
  |  |  ------------------
  |  |  |  Branch (143:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2853|  1.13k|                                     f->field.nv.name.cstr,
 2854|  1.13k|                                     f->field.nv.name.len))
 2855|      0|    {
 2856|      0|      if (mhd_str_equal_caseless_n_st ("100-continue",
  ------------------
  |  |  142|      0|        ((mhd_SSTR_LEN (arr) == (l)) \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |  |  Branch (142:10): [True: 0, False: 0]
  |  |  ------------------
  |  |  143|      0|         && mhd_str_equal_caseless_bin_n (arr,str,l))
  |  |  ------------------
  |  |  |  Branch (143:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2857|      0|                                       f->field.nv.value.cstr,
 2858|      0|                                       f->field.nv.value.len))
 2859|      0|        c->rq.have_expect_100 = true;
 2860|      0|      else
 2861|      0|      {
 2862|      0|        if (0 < c->daemon->req_cfg.strictness)
  ------------------
  |  Branch (2862:13): [True: 0, False: 0]
  ------------------
 2863|      0|        {
 2864|      0|          mhd_LOG_MSG (c->daemon, MHD_SC_EXPECT_HEADER_VALUE_UNSUPPORTED, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2865|      0|                       "The 'Expect' header value used in request is " \
 2866|      0|                       "unsupported or invalid.");
 2867|      0|          mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 2868|      0|                                         MHD_HTTP_STATUS_EXPECTATION_FAILED,
 2869|      0|                                         ERR_RSP_UNSUPPORTED_EXPECT_HDR_VALUE);
 2870|      0|          return;
 2871|      0|        }
 2872|      0|      }
 2873|      0|      continue;
 2874|      0|    }
 2875|  1.13k|  }
 2876|       |
 2877|  2.21k|  c->rq.cntn.cntn_present = (has_trenc || has_cntnlen);
  ------------------
  |  Branch (2877:30): [True: 366, False: 1.84k]
  |  Branch (2877:43): [True: 0, False: 1.84k]
  ------------------
 2878|  2.21k|  if (has_trenc && has_cntnlen)
  ------------------
  |  Branch (2878:7): [True: 366, False: 1.84k]
  |  Branch (2878:20): [True: 0, False: 366]
  ------------------
 2879|      0|  {
 2880|      0|    if (0 < c->daemon->req_cfg.strictness)
  ------------------
  |  Branch (2880:9): [True: 0, False: 0]
  ------------------
 2881|      0|    {
 2882|      0|      mhd_RESPOND_WITH_ERROR_STATIC ( \
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 2883|      0|        c, \
 2884|      0|        MHD_HTTP_STATUS_BAD_REQUEST, \
 2885|      0|        ERR_RSP_REQUEST_CNTNLENGTH_WITH_TR_ENCODING);
 2886|      0|      return;
 2887|      0|    }
 2888|       |    /* Must close connection after reply to prevent potential attack */
 2889|      0|    c->conn_reuse = mhd_CONN_MUST_CLOSE;
 2890|      0|    c->rq.cntn.cntn_size = MHD_SIZE_UNKNOWN;
  ------------------
  |  |  302|      0|#  define MHD_SIZE_UNKNOWN UINT64_MAX
  ------------------
 2891|      0|    mhd_assert (c->rq.have_chunked_upload);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 2892|      0|    mhd_LOG_MSG (c->daemon, MHD_SC_CONTENT_LENGTH_AND_TR_ENC, \
  ------------------
  |  |   80|      0|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2893|      0|                 "The 'Content-Length' request header is ignored " \
 2894|      0|                 "as chunked 'Transfer-Encoding' is used " \
 2895|      0|                 "for this request.");
 2896|      0|  }
 2897|       |
 2898|  2.21k|  if (MHD_HTTP_VERSION_IS_LIKE_11 (c->rq.http_ver))
  ------------------
  |  |   88|  2.21k|        ((MHD_HTTP_VERSION_1_1 <= (v)) && (MHD_HTTP_VERSION_1_2P >= (v)))
  |  |  ------------------
  |  |  |  Branch (88:10): [True: 572, False: 1.64k]
  |  |  |  Branch (88:43): [True: 572, False: 0]
  |  |  ------------------
  ------------------
 2899|    572|  {
 2900|    572|    if ((!has_host)
  ------------------
  |  Branch (2900:9): [True: 5, False: 567]
  ------------------
 2901|      5|        && (-3 < c->daemon->req_cfg.strictness))
  ------------------
  |  Branch (2901:12): [True: 5, False: 0]
  ------------------
 2902|      5|    {
 2903|      5|      mhd_LOG_MSG (c->daemon, MHD_SC_HOST_HEADER_MISSING, \
  ------------------
  |  |   80|      5|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 2904|      5|                   "Received HTTP/1.1 request without 'Host' header.");
 2905|      5|      mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|      5|          respond_with_error_len ((c), (code), \
  |  |   86|      5|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      5|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      5|                                  0, NULL)
  ------------------
 2906|      5|                                     MHD_HTTP_STATUS_BAD_REQUEST,
 2907|      5|                                     ERR_RSP_REQUEST_LACKS_HOST);
 2908|      5|      return;
 2909|      5|    }
 2910|    572|  }
 2911|  1.64k|  else
 2912|  1.64k|  {
 2913|  1.64k|    if (!has_keepalive)
  ------------------
  |  Branch (2913:9): [True: 0, False: 1.64k]
  ------------------
 2914|      0|      c->conn_reuse = mhd_CONN_MUST_CLOSE; /* Do not re-use HTTP/1.0 connection by default */
 2915|  1.64k|    if (has_trenc)
  ------------------
  |  Branch (2915:9): [True: 277, False: 1.36k]
  ------------------
 2916|    277|      c->conn_reuse = mhd_CONN_MUST_CLOSE; /* Framing could be incorrect */
 2917|  1.64k|  }
 2918|       |
 2919|  2.20k|  c->stage = mhd_HTTP_STAGE_HEADERS_PROCESSED;
 2920|  2.20k|  return;
 2921|  2.21k|}
_Z32mhd_stream_process_upload_actionP14MHD_ConnectionPK16MHD_UploadActionb:
 3157|  4.07k|{
 3158|  4.07k|  if (NULL != act)
  ------------------
  |  Branch (3158:7): [True: 4.07k, False: 0]
  ------------------
 3159|  4.07k|  {
 3160|  4.07k|    if ((&(c->rq.app_act.upl_act) != act)
  ------------------
  |  Branch (3160:9): [True: 4.07k, False: 0]
  ------------------
 3161|      0|        || !mhd_UPLOAD_ACTION_IS_VALID (c->rq.app_act.upl_act.act)
  ------------------
  |  |  355|  4.07k|        ((mhd_UPLOAD_ACTION_CONTINUE <= (act)) && \
  |  |  ------------------
  |  |  |  Branch (355:10): [True: 0, False: 0]
  |  |  ------------------
  |  |  356|  4.07k|         (mhd_UPLOAD_ACTION_ABORT >= (act)))
  |  |  ------------------
  |  |  |  Branch (356:10): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3162|      0|        || (final
  ------------------
  |  Branch (3162:13): [True: 0, False: 0]
  ------------------
 3163|      0|            && (mhd_UPLOAD_ACTION_CONTINUE == c->rq.app_act.upl_act.act)))
  ------------------
  |  Branch (3163:16): [True: 0, False: 0]
  ------------------
 3164|  4.07k|    {
 3165|       |      /* Perform cleanup of the created but now unused action */
 3166|  4.07k|      switch (c->rq.app_act.upl_act.act)
 3167|  4.07k|      {
 3168|      0|      case mhd_UPLOAD_ACTION_RESPONSE:
  ------------------
  |  Branch (3168:7): [True: 0, False: 4.07k]
  ------------------
 3169|      0|        mhd_assert (NULL != c->rq.app_act.upl_act.data.response);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3170|      0|        mhd_response_dec_use_count (c->rq.app_act.upl_act.data.response);
 3171|      0|        break;
 3172|      0|      case mhd_UPLOAD_ACTION_CONTINUE:
  ------------------
  |  Branch (3172:7): [True: 0, False: 4.07k]
  ------------------
 3173|      0|      case mhd_UPLOAD_ACTION_SUSPEND:
  ------------------
  |  Branch (3173:7): [True: 0, False: 4.07k]
  ------------------
 3174|       |        /* No cleanup needed */
 3175|      0|        break;
 3176|      0|#ifdef MHD_SUPPORT_UPGRADE
 3177|      0|      case mhd_UPLOAD_ACTION_UPGRADE:
  ------------------
  |  Branch (3177:7): [True: 0, False: 4.07k]
  ------------------
 3178|       |        /* No cleanup needed */
 3179|      0|        break;
 3180|      0|#endif /* MHD_SUPPORT_UPGRADE */
 3181|      0|      case mhd_UPLOAD_ACTION_ABORT:
  ------------------
  |  Branch (3181:7): [True: 0, False: 4.07k]
  ------------------
 3182|      0|        mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 3183|      0|        break;
 3184|  2.45k|      case mhd_UPLOAD_ACTION_NO_ACTION:
  ------------------
  |  Branch (3184:7): [True: 2.45k, False: 1.61k]
  ------------------
 3185|  4.07k|      default:
  ------------------
  |  Branch (3185:7): [True: 1.61k, False: 2.45k]
  ------------------
 3186|  4.07k|        break;
 3187|  4.07k|      }
 3188|  4.07k|      mhd_LOG_MSG (c->daemon, MHD_SC_UPLOAD_ACTION_INVALID, \
  ------------------
  |  |   80|  4.07k|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 3189|  4.07k|                   "Provided action is not a correct action generated " \
 3190|  4.07k|                   "for the current request.");
 3191|  4.07k|      act = NULL;
 3192|  4.07k|    }
 3193|  4.07k|  }
 3194|  4.07k|  if (NULL == act)
  ------------------
  |  Branch (3194:7): [True: 4.07k, False: 0]
  ------------------
 3195|  4.07k|    c->rq.app_act.upl_act.act = mhd_UPLOAD_ACTION_ABORT;
 3196|       |
 3197|  4.07k|  switch (c->rq.app_act.upl_act.act)
 3198|  4.07k|  {
 3199|      0|  case mhd_UPLOAD_ACTION_RESPONSE:
  ------------------
  |  Branch (3199:3): [True: 0, False: 4.07k]
  ------------------
 3200|      0|    c->rp.response = c->rq.app_act.upl_act.data.response;
 3201|      0|    c->stage = mhd_HTTP_STAGE_REQ_RECV_FINISHED;
 3202|      0|    return true;
 3203|      0|  case mhd_UPLOAD_ACTION_CONTINUE:
  ------------------
  |  Branch (3203:3): [True: 0, False: 4.07k]
  ------------------
 3204|      0|    memset (&(c->rq.app_act.upl_act), 0, sizeof(c->rq.app_act.upl_act));
 3205|      0|    return false;
 3206|      0|  case mhd_UPLOAD_ACTION_SUSPEND:
  ------------------
  |  Branch (3206:3): [True: 0, False: 4.07k]
  ------------------
 3207|      0|    c->suspended = true;
 3208|       |#ifdef MHD_USE_TRACE_SUSPEND_RESUME
 3209|       |    fprintf (stderr,
 3210|       |             "%%%%%% Suspending connection, FD: %2llu\n",
 3211|       |             (unsigned long long)c->sk.fd);
 3212|       |#endif /* MHD_USE_TRACE_SUSPEND_RESUME */
 3213|      0|    memset (&(c->rq.app_act.upl_act), 0, sizeof(c->rq.app_act.upl_act));
 3214|      0|    return false;
 3215|      0|#ifdef MHD_SUPPORT_UPGRADE
 3216|      0|  case mhd_UPLOAD_ACTION_UPGRADE:
  ------------------
  |  Branch (3216:3): [True: 0, False: 4.07k]
  ------------------
 3217|      0|    mhd_assert (c->rq.cntn.recv_size == c->rq.cntn.cntn_size);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3218|      0|    mhd_assert (!c->rq.have_chunked_upload \
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3219|      0|                || mhd_HTTP_STAGE_FULL_REQ_RECEIVED == c->stage);
 3220|      0|    c->stage = mhd_HTTP_STAGE_UPGRADE_HEADERS_SENDING;
 3221|      0|    return false;
 3222|      0|#endif /* MHD_SUPPORT_UPGRADE */
 3223|  4.07k|  case mhd_UPLOAD_ACTION_ABORT:
  ------------------
  |  Branch (3223:3): [True: 4.07k, False: 0]
  ------------------
 3224|  4.07k|    mhd_conn_start_closing_app_abort (c);
  ------------------
  |  |  365|  4.07k|        mhd_conn_start_closing ((c), mhd_CONN_CLOSE_APP_ABORTED, NULL)
  ------------------
 3225|  4.07k|    return true;
 3226|      0|  case mhd_UPLOAD_ACTION_NO_ACTION:
  ------------------
  |  Branch (3226:3): [True: 0, False: 4.07k]
  ------------------
 3227|      0|  default:
  ------------------
  |  Branch (3227:3): [True: 0, False: 4.07k]
  ------------------
 3228|      0|    mhd_assert (0 && "Impossible value");
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3229|      0|    break;
 3230|  4.07k|  }
 3231|      0|  mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
 3232|      0|  return false;
 3233|  4.07k|}
_Z31mhd_stream_process_request_bodyP14MHD_Connection:
 3676|    897|{
 3677|    897|  if (c->rq.have_chunked_upload)
  ------------------
  |  Branch (3677:7): [True: 0, False: 897]
  ------------------
 3678|      0|    return process_request_chunked_body (c);
 3679|       |
 3680|    897|  return process_request_nonchunked_body (c);
 3681|    897|}
_Z36mhd_stream_process_req_recv_finishedP14MHD_Connection:
 3734|  2.69k|{
 3735|  2.69k|  if (NULL != c->rq.cntn.lbuf.data)
  ------------------
  |  Branch (3735:7): [True: 192, False: 2.50k]
  ------------------
 3736|    192|    mhd_daemon_free_lbuf (c->daemon, &(c->rq.cntn.lbuf));
 3737|  2.69k|  c->rq.cntn.lbuf.data = NULL;
 3738|  2.69k|  if (c->rq.cntn.cntn_size != c->rq.cntn.proc_size)
  ------------------
  |  Branch (3738:7): [True: 473, False: 2.22k]
  ------------------
 3739|    473|    c->discard_request = true;
 3740|  2.69k|  mhd_assert (NULL != c->rp.response);
  ------------------
  |  |   66|  2.69k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3741|  2.69k|  c->stage = mhd_HTTP_STAGE_START_REPLY;
 3742|  2.69k|  return true;
 3743|  2.69k|}
stream_process_request.c:_ZL22get_request_line_innerP14MHD_Connection:
  649|  2.72k|{
  650|  2.72k|  size_t p; /**< The current processing position */
  651|  2.72k|  const int discp_lvl = c->daemon->req_cfg.strictness;
  652|       |  /* Allow to skip one or more empty lines before the request line.
  653|       |     RFC 9112, section 2.2 */
  654|  2.72k|  const bool skip_empty_lines = (1 >= discp_lvl);
  655|       |  /* Allow to skip more then one empty line before the request line.
  656|       |     RFC 9112, section 2.2 */
  657|  2.72k|  const bool skip_several_empty_lines = (skip_empty_lines && (0 >= discp_lvl));
  ------------------
  |  Branch (657:42): [True: 2.12k, False: 606]
  |  Branch (657:62): [True: 1.50k, False: 615]
  ------------------
  658|       |  /* Allow to skip unlimited number of empty lines before the request line.
  659|       |     RFC 9112, section 2.2 */
  660|  2.72k|  const bool skip_unlimited_empty_lines =
  661|  2.72k|    (skip_empty_lines && (-3 >= discp_lvl));
  ------------------
  |  Branch (661:6): [True: 2.12k, False: 606]
  |  Branch (661:26): [True: 0, False: 2.12k]
  ------------------
  662|       |  /* Treat bare LF as the end of the line.
  663|       |     RFC 9112, section 2.2 */
  664|  2.72k|  const bool bare_lf_as_crlf = mhd_ALLOW_BARE_LF_AS_CRLF (discp_lvl);
  ------------------
  |  | 1354|  2.72k|#define mhd_ALLOW_BARE_LF_AS_CRLF(strictness) (0 >= strictness)
  ------------------
  665|       |  /* Treat tab as whitespace delimiter.
  666|       |     RFC 9112, section 3 */
  667|  2.72k|  const bool tab_as_wsp = (0 >= discp_lvl);
  668|       |  /* Treat VT (vertical tab) and FF (form feed) as whitespace delimiters.
  669|       |     RFC 9112, section 3 */
  670|  2.72k|  const bool other_wsp_as_wsp = (-1 >= discp_lvl);
  671|       |  /* Treat continuous whitespace block as a single space.
  672|       |     RFC 9112, section 3 */
  673|  2.72k|  const bool wsp_blocks = (-1 >= discp_lvl);
  674|       |  /* Parse whitespace in URI, special parsing of the request line.
  675|       |     RFC 9112, section 3.2 */
  676|  2.72k|  const bool wsp_in_uri = (0 >= discp_lvl);
  677|       |  /* Keep whitespace in URI, give app URI with whitespace instead of
  678|       |     automatic redirect to fixed URI.
  679|       |     Violates RFC 9112, section 3.2 */
  680|  2.72k|  const bool wsp_in_uri_keep = (-2 >= discp_lvl);
  681|       |  /* Keep bare CR character as is.
  682|       |     Violates RFC 9112, section 2.2 */
  683|  2.72k|  const bool bare_cr_keep = (wsp_in_uri_keep && (-3 >= discp_lvl));
  ------------------
  |  Branch (683:30): [True: 0, False: 2.72k]
  |  Branch (683:49): [True: 0, False: 0]
  ------------------
  684|       |  /* Treat bare CR as space; replace it with space before processing.
  685|       |     RFC 9112, section 2.2 */
  686|  2.72k|  const bool bare_cr_as_sp = ((!bare_cr_keep) && (-1 >= discp_lvl));
  ------------------
  |  Branch (686:31): [True: 2.72k, False: 0]
  |  Branch (686:50): [True: 0, False: 2.72k]
  ------------------
  687|       |
  688|  2.72k|  mhd_assert (mhd_HTTP_STAGE_INIT == c->stage \
  ------------------
  |  |   66|  2.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  689|  2.72k|              || mhd_HTTP_STAGE_REQ_LINE_RECEIVING == c->stage);
  690|  2.72k|  mhd_assert (NULL == c->rq.method.cstr \
  ------------------
  |  |   66|  2.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  691|  2.72k|              || mhd_HTTP_STAGE_REQ_LINE_RECEIVING == c->stage);
  692|  2.72k|  mhd_assert (mhd_HTTP_METHOD_NO_METHOD == c->rq.http_mthd \
  ------------------
  |  |   66|  2.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  693|  2.72k|              || mhd_HTTP_STAGE_REQ_LINE_RECEIVING == c->stage);
  694|  2.72k|  mhd_assert (mhd_HTTP_METHOD_NO_METHOD == c->rq.http_mthd \
  ------------------
  |  |   66|  2.72k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  695|  2.72k|              || 0 != c->rq.hdrs.rq_line.proc_pos);
  696|       |
  697|  2.72k|  if (0 == c->read_buffer_offset)
  ------------------
  |  Branch (697:7): [True: 1.05k, False: 1.67k]
  ------------------
  698|  1.05k|  {
  699|  1.05k|    mhd_assert (mhd_HTTP_STAGE_INIT == c->stage);
  ------------------
  |  |   66|  1.05k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  700|  1.05k|    return false; /* No data to process */
  701|  1.05k|  }
  702|  1.67k|  p = c->rq.hdrs.rq_line.proc_pos;
  703|  1.67k|  mhd_assert (p <= c->read_buffer_offset);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  704|       |
  705|       |  /* Skip empty lines, if any (and if allowed) */
  706|       |  /* See RFC 9112, section 2.2 */
  707|  1.67k|  if ((0 == p)
  ------------------
  |  Branch (707:7): [True: 1.67k, False: 0]
  ------------------
  708|  1.67k|      && (skip_empty_lines))
  ------------------
  |  Branch (708:10): [True: 1.27k, False: 406]
  ------------------
  709|  1.27k|  {
  710|       |    /* Skip empty lines before the request line.
  711|       |       See RFC 9112, section 2.2 */
  712|  1.27k|    bool is_empty_line;
  713|  1.27k|    mhd_assert (mhd_HTTP_STAGE_INIT == c->stage);
  ------------------
  |  |   66|  1.27k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  714|  1.27k|    mhd_assert (0 == c->rq.method.len);
  ------------------
  |  |   66|  1.27k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  715|  1.27k|    mhd_assert (NULL == c->rq.method.cstr);
  ------------------
  |  |   66|  1.27k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  716|  1.27k|    mhd_assert (NULL == c->rq.url);
  ------------------
  |  |   66|  1.27k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  717|  1.27k|    mhd_assert (0 == c->rq.url_len);
  ------------------
  |  |   66|  1.27k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  718|  1.27k|    mhd_assert (NULL == c->rq.hdrs.rq_line.rq_tgt);
  ------------------
  |  |   66|  1.27k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  719|  1.27k|    mhd_assert (0 == c->rq.req_target_len);
  ------------------
  |  |   66|  1.27k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  720|  1.27k|    mhd_assert (NULL == c->rq.version);
  ------------------
  |  |   66|  1.27k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  721|  1.27k|    do
  722|  1.27k|    {
  723|  1.27k|      is_empty_line = false;
  724|  1.27k|      if ('\r' == c->read_buffer[0])
  ------------------
  |  Branch (724:11): [True: 0, False: 1.27k]
  ------------------
  725|      0|      {
  726|      0|        if (1 == c->read_buffer_offset)
  ------------------
  |  Branch (726:13): [True: 0, False: 0]
  ------------------
  727|      0|          return false; /* Not enough data yet */
  728|      0|        if ('\n' == c->read_buffer[1])
  ------------------
  |  Branch (728:13): [True: 0, False: 0]
  ------------------
  729|      0|        {
  730|      0|          is_empty_line = true;
  731|      0|          c->read_buffer += 2;
  732|      0|          c->read_buffer_size -= 2;
  733|      0|          c->read_buffer_offset -= 2;
  734|      0|          c->rq.hdrs.rq_line.skipped_empty_lines++;
  735|      0|        }
  736|      0|      }
  737|  1.27k|      else if (('\n' == c->read_buffer[0])
  ------------------
  |  Branch (737:16): [True: 0, False: 1.27k]
  ------------------
  738|      0|               && (bare_lf_as_crlf))
  ------------------
  |  Branch (738:19): [True: 0, False: 0]
  ------------------
  739|      0|      {
  740|      0|        is_empty_line = true;
  741|      0|        c->read_buffer += 1;
  742|      0|        c->read_buffer_size -= 1;
  743|      0|        c->read_buffer_offset -= 1;
  744|      0|        c->rq.hdrs.rq_line.skipped_empty_lines++;
  745|      0|      }
  746|  1.27k|      if (is_empty_line)
  ------------------
  |  Branch (746:11): [True: 0, False: 1.27k]
  ------------------
  747|      0|      {
  748|      0|        if ((!skip_unlimited_empty_lines)
  ------------------
  |  Branch (748:13): [True: 0, False: 0]
  ------------------
  749|      0|            && (((unsigned int)((skip_several_empty_lines) ?
  ------------------
  |  Branch (749:16): [True: 0, False: 0]
  |  Branch (749:33): [True: 0, False: 0]
  ------------------
  750|      0|                                MHD_MAX_EMPTY_LINES_SKIP : 1)) <
  ------------------
  |  |  636|      0|#  define MHD_MAX_EMPTY_LINES_SKIP 1024
  ------------------
  751|      0|                c->rq.hdrs.rq_line.skipped_empty_lines))
  752|      0|        {
  753|      0|          mhd_STREAM_ABORT (c, mhd_CONN_CLOSE_CLIENT_HTTP_ERR_ABORT_CONN,
  ------------------
  |  |  354|      0|#  define mhd_STREAM_ABORT(c, r, m) (mhd_conn_start_closing ((c),(r),(m)))
  ------------------
  754|      0|                            "Too many meaningless extra empty lines " \
  755|      0|                            "received before the request.");
  756|      0|          return true; /* Process connection closure */
  757|      0|        }
  758|      0|        if (0 == c->read_buffer_offset)
  ------------------
  |  Branch (758:13): [True: 0, False: 0]
  ------------------
  759|      0|          return false;  /* No more data to process */
  760|      0|      }
  761|  1.27k|    } while (is_empty_line);
  ------------------
  |  Branch (761:14): [True: 0, False: 1.27k]
  ------------------
  762|  1.27k|  }
  763|       |  /* All empty lines are skipped */
  764|       |
  765|  1.67k|  c->stage = mhd_HTTP_STAGE_REQ_LINE_RECEIVING;
  766|       |  /* Read and parse the request line */
  767|  1.67k|  mhd_assert (1 <= c->read_buffer_offset);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  768|       |
  769|  27.0k|  while (p < c->read_buffer_offset)
  ------------------
  |  Branch (769:10): [True: 27.0k, False: 0]
  ------------------
  770|  27.0k|  {
  771|  27.0k|    char *const restrict read_buffer = c->read_buffer;
  772|  27.0k|    const char chr = read_buffer[p];
  773|  27.0k|    bool end_of_line;
  774|       |    /*
  775|       |       The processing logic is different depending on the configured strictness:
  776|       |
  777|       |       When whitespace BLOCKS are NOT ALLOWED, the end of the whitespace is
  778|       |       processed BEFORE processing of the current character.
  779|       |       When whitespace BLOCKS are ALLOWED, the end of the whitespace is
  780|       |       processed AFTER processing of the current character.
  781|       |
  782|       |       When space char in the URI is ALLOWED, the delimiter between the URI and
  783|       |       the HTTP version string is processed only at the END of the line.
  784|       |       When space in the URI is NOT ALLOWED, the delimiter between the URI and
  785|       |       the HTTP version string is processed as soon as the FIRST whitespace is
  786|       |       found after URI start.
  787|       |     */
  788|       |
  789|  27.0k|    end_of_line = false;
  790|       |
  791|  27.0k|    mhd_assert ((0 == c->rq.hdrs.rq_line.last_ws_end) \
  ------------------
  |  |   66|  27.0k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  792|  27.0k|                || (c->rq.hdrs.rq_line.last_ws_end > \
  793|  27.0k|                    c->rq.hdrs.rq_line.last_ws_start));
  794|  27.0k|    mhd_assert ((0 == c->rq.hdrs.rq_line.last_ws_start) \
  ------------------
  |  |   66|  27.0k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  795|  27.0k|                || (0 != c->rq.hdrs.rq_line.last_ws_end));
  796|       |
  797|       |    /* Check for the end of the line */
  798|  27.0k|    if ('\r' == chr)
  ------------------
  |  Branch (798:9): [True: 464, False: 26.6k]
  ------------------
  799|    464|    {
  800|    464|      if (p + 1 == c->read_buffer_offset)
  ------------------
  |  Branch (800:11): [True: 0, False: 464]
  ------------------
  801|      0|      {
  802|      0|        c->rq.hdrs.rq_line.proc_pos = p;
  803|      0|        return false; /* Not enough data yet */
  804|      0|      }
  805|    464|      else if ('\n' == read_buffer[p + 1])
  ------------------
  |  Branch (805:16): [True: 382, False: 82]
  ------------------
  806|    382|        end_of_line = true;
  807|     82|      else
  808|     82|      {
  809|       |        /* Bare CR alone */
  810|       |        /* Must be rejected or replaced with space char.
  811|       |           See RFC 9112, section 2.2 */
  812|     82|        if (bare_cr_as_sp)
  ------------------
  |  Branch (812:13): [True: 0, False: 82]
  ------------------
  813|      0|        {
  814|      0|          read_buffer[p] = ' ';
  815|      0|          c->rq.num_cr_sp_replaced++;
  816|      0|          continue; /* Re-start processing of the current character */
  817|      0|        }
  818|     82|        else if (!bare_cr_keep)
  ------------------
  |  Branch (818:18): [True: 82, False: 0]
  ------------------
  819|     82|        {
  820|       |          /* A quick simple check whether this line looks like an HTTP request */
  821|     82|          if ((mhd_HTTP_METHOD_GET <= c->rq.http_mthd)
  ------------------
  |  Branch (821:15): [True: 82, False: 0]
  ------------------
  822|     82|              && (mhd_HTTP_METHOD_DELETE >= c->rq.http_mthd))
  ------------------
  |  Branch (822:18): [True: 21, False: 61]
  ------------------
  823|     21|          {
  824|     21|            mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|     21|          respond_with_error_len ((c), (code), \
  |  |   86|     21|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|     21|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|     21|                                  0, NULL)
  ------------------
  825|     21|                                           MHD_HTTP_STATUS_BAD_REQUEST,
  826|     21|                                           ERR_RSP_BARE_CR_IN_HEADER);
  827|     21|          }
  828|     61|          else
  829|     61|            mhd_STREAM_ABORT (c, mhd_CONN_CLOSE_CLIENT_HTTP_ERR_ABORT_CONN,
  ------------------
  |  |  354|     61|#  define mhd_STREAM_ABORT(c, r, m) (mhd_conn_start_closing ((c),(r),(m)))
  ------------------
  830|     82|                              "Bare CR characters are not allowed " \
  831|     82|                              "in the request line.");
  832|       |
  833|     82|          return true; /* Error in the request */
  834|     82|        }
  835|     82|      }
  836|    464|    }
  837|  26.6k|    else if ('\n' == chr)
  ------------------
  |  Branch (837:14): [True: 1.21k, False: 25.3k]
  ------------------
  838|  1.21k|    {
  839|       |      /* Bare LF may be recognised as a line delimiter.
  840|       |         See RFC 9112, section 2.2 */
  841|  1.21k|      if (bare_lf_as_crlf)
  ------------------
  |  Branch (841:11): [True: 610, False: 605]
  ------------------
  842|    610|        end_of_line = true;
  843|    605|      else
  844|    605|      {
  845|       |        /* While RFC does not enforce error for bare LF character,
  846|       |           if this char is not treated as a line delimiter, it should be
  847|       |           rejected to avoid any security weakness due to request smuggling. */
  848|       |        /* A quick simple check whether this line looks like an HTTP request */
  849|    605|        if ((mhd_HTTP_METHOD_GET <= c->rq.http_mthd)
  ------------------
  |  Branch (849:13): [True: 605, False: 0]
  ------------------
  850|    605|            && (mhd_HTTP_METHOD_DELETE >= c->rq.http_mthd))
  ------------------
  |  Branch (850:16): [True: 27, False: 578]
  ------------------
  851|     27|        {
  852|     27|          mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|     27|          respond_with_error_len ((c), (code), \
  |  |   86|     27|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|     27|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|     27|                                  0, NULL)
  ------------------
  853|     27|                                         MHD_HTTP_STATUS_BAD_REQUEST,
  854|     27|                                         ERR_RSP_BARE_LF_IN_HEADER);
  855|     27|        }
  856|    578|        else
  857|    578|          mhd_STREAM_ABORT (c, mhd_CONN_CLOSE_CLIENT_HTTP_ERR_ABORT_CONN,
  ------------------
  |  |  354|    578|#  define mhd_STREAM_ABORT(c, r, m) (mhd_conn_start_closing ((c),(r),(m)))
  ------------------
  858|    605|                            "Bare LF characters are not allowed " \
  859|    605|                            "in the request line.");
  860|    605|        return true; /* Error in the request */
  861|    605|      }
  862|  1.21k|    }
  863|       |
  864|  26.3k|    if (end_of_line)
  ------------------
  |  Branch (864:9): [True: 992, False: 25.3k]
  ------------------
  865|    992|    {
  866|       |      /* Handle the end of the request line */
  867|       |
  868|    992|      if (NULL != c->rq.method.cstr)
  ------------------
  |  Branch (868:11): [True: 992, False: 0]
  ------------------
  869|    992|      {
  870|    992|        if (wsp_in_uri)
  ------------------
  |  Branch (870:13): [True: 810, False: 182]
  ------------------
  871|    810|        {
  872|       |          /* The end of the URI and the start of the HTTP version string
  873|       |             should be determined now. */
  874|    810|          mhd_assert (NULL == c->rq.version);
  ------------------
  |  |   66|    810|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  875|    810|          mhd_assert (0 == c->rq.req_target_len);
  ------------------
  |  |   66|    810|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  876|    810|          if (0 != c->rq.hdrs.rq_line.last_ws_end)
  ------------------
  |  Branch (876:15): [True: 810, False: 0]
  ------------------
  877|    810|          {
  878|       |            /* Determine the end and the length of the URI */
  879|    810|            if (NULL != c->rq.hdrs.rq_line.rq_tgt)
  ------------------
  |  Branch (879:17): [True: 810, False: 0]
  ------------------
  880|    810|            {
  881|    810|              read_buffer[c->rq.hdrs.rq_line.last_ws_start] = 0;  /* Zero terminate the URI */
  882|    810|              c->rq.req_target_len =
  883|    810|                c->rq.hdrs.rq_line.last_ws_start
  884|    810|                - (size_t)(c->rq.hdrs.rq_line.rq_tgt - read_buffer);
  885|    810|            }
  886|      0|            else if ((c->rq.hdrs.rq_line.last_ws_start + 1 <
  ------------------
  |  Branch (886:22): [True: 0, False: 0]
  ------------------
  887|      0|                      c->rq.hdrs.rq_line.last_ws_end)
  888|      0|                     && (HTTP_VER_LEN == (p - c->rq.hdrs.rq_line.last_ws_end)))
  ------------------
  |  |  480|      0|#define HTTP_VER_LEN (mhd_SSTR_LEN (MHD_HTTP_VERSION_1_1_STR))
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
  |  Branch (888:25): [True: 0, False: 0]
  ------------------
  889|      0|            {
  890|       |              /* Found only HTTP method and HTTP version and more than one
  891|       |                 whitespace between them. Assume zero-length URI. */
  892|      0|              mhd_assert (wsp_blocks);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  893|      0|              c->rq.hdrs.rq_line.last_ws_start++;
  894|      0|              read_buffer[c->rq.hdrs.rq_line.last_ws_start] = 0; /* Zero terminate the URI */
  895|      0|              c->rq.hdrs.rq_line.rq_tgt =
  896|      0|                read_buffer + c->rq.hdrs.rq_line.last_ws_start;
  897|      0|              c->rq.req_target_len = 0;
  898|      0|              c->rq.hdrs.rq_line.num_ws_in_uri = 0;
  899|      0|              c->rq.hdrs.rq_line.rq_tgt_qmark = NULL;
  900|      0|            }
  901|       |            /* Determine the start of the HTTP version string */
  902|    810|            if (NULL != c->rq.hdrs.rq_line.rq_tgt)
  ------------------
  |  Branch (902:17): [True: 810, False: 0]
  ------------------
  903|    810|            {
  904|    810|              c->rq.version = read_buffer + c->rq.hdrs.rq_line.last_ws_end;
  905|    810|            }
  906|    810|          }
  907|    810|        }
  908|    182|        else
  909|    182|        {
  910|       |          /* The end of the URI and the start of the HTTP version string
  911|       |             should be already known. */
  912|    182|          if ((NULL == c->rq.version)
  ------------------
  |  Branch (912:15): [True: 0, False: 182]
  ------------------
  913|      0|              && (NULL != c->rq.hdrs.rq_line.rq_tgt)
  ------------------
  |  Branch (913:18): [True: 0, False: 0]
  ------------------
  914|      0|              && (HTTP_VER_LEN == p - (size_t)(c->rq.hdrs.rq_line.rq_tgt
  ------------------
  |  |  480|      0|#define HTTP_VER_LEN (mhd_SSTR_LEN (MHD_HTTP_VERSION_1_1_STR))
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
  |  Branch (914:18): [True: 0, False: 0]
  ------------------
  915|      0|                                               - read_buffer))
  916|      0|              && (0 != read_buffer[(size_t)
  ------------------
  |  Branch (916:18): [True: 0, False: 0]
  ------------------
  917|      0|                                   (c->rq.hdrs.rq_line.rq_tgt
  918|      0|                                    - read_buffer) - 1]))
  919|      0|          {
  920|       |            /* Found only HTTP method and HTTP version and more than one
  921|       |               whitespace between them. Assume zero-length URI. */
  922|      0|            size_t uri_pos;
  923|      0|            mhd_assert (wsp_blocks);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  924|      0|            mhd_assert (0 == c->rq.req_target_len);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  925|      0|            uri_pos = (size_t)(c->rq.hdrs.rq_line.rq_tgt - read_buffer) - 1;
  926|      0|            mhd_assert (uri_pos < p);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  927|      0|            c->rq.version = c->rq.hdrs.rq_line.rq_tgt;
  928|      0|            read_buffer[uri_pos] = 0;  /* Zero terminate the URI */
  929|      0|            c->rq.hdrs.rq_line.rq_tgt = read_buffer + uri_pos;
  930|      0|            c->rq.req_target_len = 0;
  931|      0|            c->rq.hdrs.rq_line.num_ws_in_uri = 0;
  932|      0|            c->rq.hdrs.rq_line.rq_tgt_qmark = NULL;
  933|      0|          }
  934|    182|        }
  935|       |
  936|    992|        if (NULL != c->rq.version)
  ------------------
  |  Branch (936:13): [True: 992, False: 0]
  ------------------
  937|    992|        {
  938|    992|          mhd_assert (NULL != c->rq.hdrs.rq_line.rq_tgt);
  ------------------
  |  |   66|    992|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  939|    992|          if (!process_http_version (c,
  ------------------
  |  Branch (939:15): [True: 173, False: 819]
  ------------------
  940|    992|                                     p - (size_t)(c->rq.version
  941|    992|                                                  - read_buffer),
  942|    992|                                     c->rq.version))
  943|    173|          {
  944|    173|            mhd_assert (mhd_HTTP_STAGE_REQ_LINE_RECEIVING < c->stage);
  ------------------
  |  |   66|    173|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  945|    173|            return true; /* Unsupported / broken HTTP version */
  946|    173|          }
  947|    819|          read_buffer[p] = 0; /* Zero terminate the HTTP version strings */
  948|    819|          if ('\r' == chr)
  ------------------
  |  Branch (948:15): [True: 328, False: 491]
  ------------------
  949|    328|          {
  950|    328|            p++; /* Consume CR */
  951|    328|            mhd_assert (p < c->read_buffer_offset); /* The next character has been already checked */
  ------------------
  |  |   66|    328|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  952|    328|          }
  953|    819|          p++; /* Consume LF */
  954|    819|          c->read_buffer += p;
  955|    819|          c->read_buffer_size -= p;
  956|    819|          c->read_buffer_offset -= p;
  957|    819|          mhd_assert (c->rq.hdrs.rq_line.num_ws_in_uri <= \
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  958|    819|                      c->rq.req_target_len);
  959|    819|          mhd_assert ((NULL == c->rq.hdrs.rq_line.rq_tgt_qmark) \
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  960|    819|                      || (0 != c->rq.req_target_len));
  961|    819|          mhd_assert ((NULL == c->rq.hdrs.rq_line.rq_tgt_qmark) \
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  962|    819|                      || ((size_t)(c->rq.hdrs.rq_line.rq_tgt_qmark \
  963|    819|                                   - c->rq.hdrs.rq_line.rq_tgt) < \
  964|    819|                          c->rq.req_target_len));
  965|    819|          mhd_assert ((NULL == c->rq.hdrs.rq_line.rq_tgt_qmark) \
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  966|    819|                      || (c->rq.hdrs.rq_line.rq_tgt_qmark >= \
  967|    819|                          c->rq.hdrs.rq_line.rq_tgt));
  968|    819|          return true; /* The request line is successfully parsed */
  969|    992|        }
  970|    992|      }
  971|       |      /* Error in the request line */
  972|       |
  973|       |      /* A quick simple check whether this line looks like an HTTP request */
  974|      0|      if ((mhd_HTTP_METHOD_GET <= c->rq.http_mthd)
  ------------------
  |  Branch (974:11): [True: 0, False: 0]
  ------------------
  975|      0|          && (mhd_HTTP_METHOD_DELETE >= c->rq.http_mthd))
  ------------------
  |  Branch (975:14): [True: 0, False: 0]
  ------------------
  976|      0|      {
  977|      0|        mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
  978|      0|                                       MHD_HTTP_STATUS_BAD_REQUEST,
  979|      0|                                       ERR_RSP_REQUEST_MALFORMED);
  980|      0|      }
  981|      0|      else
  982|      0|        mhd_STREAM_ABORT (c, mhd_CONN_CLOSE_CLIENT_HTTP_ERR_ABORT_CONN,
  ------------------
  |  |  354|      0|#  define mhd_STREAM_ABORT(c, r, m) (mhd_conn_start_closing ((c),(r),(m)))
  ------------------
  983|      0|                          "The request line is malformed.");
  984|       |
  985|      0|      return true;
  986|    992|    }
  987|       |
  988|       |    /* Process possible end of the previously found whitespace delimiter */
  989|  25.3k|    if ((!wsp_blocks)
  ------------------
  |  Branch (989:9): [True: 25.3k, False: 0]
  ------------------
  990|  25.3k|        && (p == c->rq.hdrs.rq_line.last_ws_end)
  ------------------
  |  Branch (990:12): [True: 5.03k, False: 20.3k]
  ------------------
  991|  5.03k|        && (0 != c->rq.hdrs.rq_line.last_ws_end))
  ------------------
  |  Branch (991:12): [True: 3.35k, False: 1.67k]
  ------------------
  992|  3.35k|    {
  993|       |      /* Previous character was a whitespace char and whitespace blocks
  994|       |         are not allowed. */
  995|       |      /* The current position is the next character after
  996|       |         a whitespace delimiter */
  997|  3.35k|      if (NULL == c->rq.hdrs.rq_line.rq_tgt)
  ------------------
  |  Branch (997:11): [True: 1.67k, False: 1.67k]
  ------------------
  998|  1.67k|      {
  999|       |        /* The current position is the start of the URI */
 1000|  1.67k|        mhd_assert (0 == c->rq.req_target_len);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1001|  1.67k|        mhd_assert (NULL == c->rq.version);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1002|  1.67k|        c->rq.hdrs.rq_line.rq_tgt = read_buffer + p;
 1003|       |        /* Reset the whitespace marker */
 1004|  1.67k|        c->rq.hdrs.rq_line.last_ws_start = 0;
 1005|  1.67k|        c->rq.hdrs.rq_line.last_ws_end = 0;
 1006|  1.67k|      }
 1007|  1.67k|      else
 1008|  1.67k|      {
 1009|       |        /* It was a whitespace after the start of the URI */
 1010|  1.67k|        if (!wsp_in_uri)
  ------------------
  |  Branch (1010:13): [True: 832, False: 847]
  ------------------
 1011|    832|        {
 1012|    832|          mhd_assert ((0 != c->rq.req_target_len) \
  ------------------
  |  |   66|    832|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1013|    832|                      || (c->rq.hdrs.rq_line.rq_tgt + 1 == read_buffer + p));
 1014|    832|          mhd_assert (NULL == c->rq.version); /* Too many whitespaces? This error is handled at whitespace start */
  ------------------
  |  |   66|    832|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1015|    832|          c->rq.version = read_buffer + p;
 1016|       |          /* Reset the whitespace marker */
 1017|    832|          c->rq.hdrs.rq_line.last_ws_start = 0;
 1018|    832|          c->rq.hdrs.rq_line.last_ws_end = 0;
 1019|    832|        }
 1020|  1.67k|      }
 1021|  3.35k|    }
 1022|       |
 1023|       |    /* Process the current character.
 1024|       |       Is it not the end of the line.  */
 1025|  25.3k|    if ((' ' == chr)
  ------------------
  |  Branch (1025:9): [True: 3.35k, False: 22.0k]
  ------------------
 1026|  22.0k|        || (('\t' == chr) && (tab_as_wsp))
  ------------------
  |  Branch (1026:13): [True: 0, False: 22.0k]
  |  Branch (1026:30): [True: 0, False: 0]
  ------------------
 1027|  22.0k|        || ((other_wsp_as_wsp) && ((0xb == chr) || (0xc == chr))))
  ------------------
  |  Branch (1027:13): [True: 0, False: 22.0k]
  |  Branch (1027:36): [True: 0, False: 0]
  |  Branch (1027:52): [True: 0, False: 0]
  ------------------
 1028|  3.35k|    {
 1029|       |      /* A whitespace character */
 1030|  3.35k|      if ((0 == c->rq.hdrs.rq_line.last_ws_end)
  ------------------
  |  Branch (1030:11): [True: 3.35k, False: 0]
  ------------------
 1031|      0|          || (p != c->rq.hdrs.rq_line.last_ws_end)
  ------------------
  |  Branch (1031:14): [True: 0, False: 0]
  ------------------
 1032|      0|          || (!wsp_blocks))
  ------------------
  |  Branch (1032:14): [True: 0, False: 0]
  ------------------
 1033|  3.35k|      {
 1034|       |        /* Found first whitespace char of the new whitespace block */
 1035|  3.35k|        if (NULL == c->rq.method.cstr)
  ------------------
  |  Branch (1035:13): [True: 1.67k, False: 1.67k]
  ------------------
 1036|  1.67k|        {
 1037|       |          /* Found the end of the HTTP method string */
 1038|  1.67k|          mhd_assert (0 == c->rq.hdrs.rq_line.last_ws_start);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1039|  1.67k|          mhd_assert (0 == c->rq.hdrs.rq_line.last_ws_end);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1040|  1.67k|          mhd_assert (NULL == c->rq.hdrs.rq_line.rq_tgt);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1041|  1.67k|          mhd_assert (0 == c->rq.req_target_len);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1042|  1.67k|          mhd_assert (NULL == c->rq.version);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1043|  1.67k|          if (0 == p)
  ------------------
  |  Branch (1043:15): [True: 0, False: 1.67k]
  ------------------
 1044|      0|          {
 1045|      0|            mhd_STREAM_ABORT (c, mhd_CONN_CLOSE_CLIENT_HTTP_ERR_ABORT_CONN,
  ------------------
  |  |  354|      0|#  define mhd_STREAM_ABORT(c, r, m) (mhd_conn_start_closing ((c),(r),(m)))
  ------------------
 1046|      0|                              "The request line starts with a whitespace.");
 1047|      0|            return true; /* Error in the request */
 1048|      0|          }
 1049|  1.67k|          read_buffer[p] = 0; /* Zero-terminate the request method string */
 1050|  1.67k|          c->rq.method.cstr = read_buffer;
 1051|  1.67k|          c->rq.method.len = p;
 1052|  1.67k|          parse_http_std_method (c);
 1053|  1.67k|        }
 1054|  1.67k|        else
 1055|  1.67k|        {
 1056|       |          /* A whitespace after the start of the URI */
 1057|  1.67k|          if (!wsp_in_uri)
  ------------------
  |  Branch (1057:15): [True: 832, False: 847]
  ------------------
 1058|    832|          {
 1059|       |            /* Whitespace in URI is not allowed to be parsed */
 1060|    832|            if (NULL == c->rq.version)
  ------------------
  |  Branch (1060:17): [True: 832, False: 0]
  ------------------
 1061|    832|            {
 1062|    832|              mhd_assert (NULL != c->rq.hdrs.rq_line.rq_tgt);
  ------------------
  |  |   66|    832|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1063|       |              /* This is a delimiter between URI and HTTP version string */
 1064|    832|              read_buffer[p] = 0; /* Zero-terminate request URI string */
 1065|    832|              mhd_assert (((size_t)(c->rq.hdrs.rq_line.rq_tgt   \
  ------------------
  |  |   66|    832|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1066|    832|                                    - read_buffer)) <= p);
 1067|    832|              c->rq.req_target_len =
 1068|    832|                p - (size_t)(c->rq.hdrs.rq_line.rq_tgt - read_buffer);
 1069|    832|            }
 1070|      0|            else
 1071|      0|            {
 1072|       |              /* This is a delimiter AFTER version string */
 1073|       |
 1074|       |              /* A quick simple check whether this line looks like an HTTP request */
 1075|      0|              if ((mhd_HTTP_METHOD_GET <= c->rq.http_mthd)
  ------------------
  |  Branch (1075:19): [True: 0, False: 0]
  ------------------
 1076|      0|                  && (mhd_HTTP_METHOD_DELETE >= c->rq.http_mthd))
  ------------------
  |  Branch (1076:22): [True: 0, False: 0]
  ------------------
 1077|      0|              {
 1078|      0|                mhd_RESPOND_WITH_ERROR_STATIC (c,
  ------------------
  |  |   85|      0|          respond_with_error_len ((c), (code), \
  |  |   86|      0|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|      0|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|      0|                                  0, NULL)
  ------------------
 1079|      0|                                               MHD_HTTP_STATUS_BAD_REQUEST,
 1080|      0|                                               ERR_RSP_RQ_LINE_TOO_MANY_WSP);
 1081|      0|              }
 1082|      0|              else
 1083|      0|                mhd_STREAM_ABORT (c, mhd_CONN_CLOSE_CLIENT_HTTP_ERR_ABORT_CONN,
  ------------------
  |  |  354|      0|#  define mhd_STREAM_ABORT(c, r, m) (mhd_conn_start_closing ((c),(r),(m)))
  ------------------
 1084|      0|                                  "The request line has more than "
 1085|      0|                                  "two whitespaces.");
 1086|      0|              return true; /* Error in the request */
 1087|      0|            }
 1088|    832|          }
 1089|    847|          else
 1090|    847|          {
 1091|       |            /* Whitespace in URI is allowed to be parsed */
 1092|    847|            if (0 != c->rq.hdrs.rq_line.last_ws_end)
  ------------------
  |  Branch (1092:17): [True: 0, False: 847]
  ------------------
 1093|      0|            {
 1094|       |              /* The whitespace after the start of the URI has been found already */
 1095|      0|              c->rq.hdrs.rq_line.num_ws_in_uri +=
 1096|      0|                c->rq.hdrs.rq_line.last_ws_end
 1097|      0|                - c->rq.hdrs.rq_line.last_ws_start;
 1098|      0|            }
 1099|    847|          }
 1100|  1.67k|        }
 1101|  3.35k|        c->rq.hdrs.rq_line.last_ws_start = p;
 1102|  3.35k|        c->rq.hdrs.rq_line.last_ws_end = p + 1; /* Will be updated on the next char parsing */
 1103|  3.35k|      }
 1104|      0|      else
 1105|      0|      {
 1106|       |        /* Continuation of the whitespace block */
 1107|      0|        mhd_assert (0 != c->rq.hdrs.rq_line.last_ws_end);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1108|      0|        mhd_assert (0 != p);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1109|      0|        c->rq.hdrs.rq_line.last_ws_end = p + 1;
 1110|      0|      }
 1111|  3.35k|    }
 1112|  22.0k|    else
 1113|  22.0k|    {
 1114|       |      /* Non-whitespace char, not the end of the line */
 1115|  22.0k|      mhd_assert ((0 == c->rq.hdrs.rq_line.last_ws_end) \
  ------------------
  |  |   66|  22.0k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1116|  22.0k|                  || (c->rq.hdrs.rq_line.last_ws_end == p) \
 1117|  22.0k|                  || wsp_in_uri);
 1118|       |
 1119|  22.0k|      if ((p == c->rq.hdrs.rq_line.last_ws_end)
  ------------------
  |  Branch (1119:11): [True: 2.52k, False: 19.5k]
  ------------------
 1120|  2.52k|          && (0 != c->rq.hdrs.rq_line.last_ws_end)
  ------------------
  |  Branch (1120:14): [True: 847, False: 1.67k]
  ------------------
 1121|    847|          && (wsp_blocks))
  ------------------
  |  Branch (1121:14): [True: 0, False: 847]
  ------------------
 1122|      0|      {
 1123|       |        /* The end of the whitespace block */
 1124|      0|        if (NULL == c->rq.hdrs.rq_line.rq_tgt)
  ------------------
  |  Branch (1124:13): [True: 0, False: 0]
  ------------------
 1125|      0|        {
 1126|       |          /* This is the first character of the URI */
 1127|      0|          mhd_assert (0 == c->rq.req_target_len);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1128|      0|          mhd_assert (NULL == c->rq.version);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1129|      0|          c->rq.hdrs.rq_line.rq_tgt = read_buffer + p;
 1130|       |          /* Reset the whitespace marker */
 1131|      0|          c->rq.hdrs.rq_line.last_ws_start = 0;
 1132|      0|          c->rq.hdrs.rq_line.last_ws_end = 0;
 1133|      0|        }
 1134|      0|        else
 1135|      0|        {
 1136|      0|          if (!wsp_in_uri)
  ------------------
  |  Branch (1136:15): [True: 0, False: 0]
  ------------------
 1137|      0|          {
 1138|       |            /* This is the first character of the HTTP version */
 1139|      0|            mhd_assert (NULL != c->rq.hdrs.rq_line.rq_tgt);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1140|      0|            mhd_assert ((0 != c->rq.req_target_len) \
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1141|      0|                        || (c->rq.hdrs.rq_line.rq_tgt + 1 == read_buffer + p));
 1142|      0|            mhd_assert (NULL == c->rq.version); /* Handled at whitespace start */
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1143|      0|            c->rq.version = read_buffer + p;
 1144|       |            /* Reset the whitespace marker */
 1145|      0|            c->rq.hdrs.rq_line.last_ws_start = 0;
 1146|      0|            c->rq.hdrs.rq_line.last_ws_end = 0;
 1147|      0|          }
 1148|      0|        }
 1149|      0|      }
 1150|       |
 1151|       |      /* Handle other special characters */
 1152|  22.0k|      if ('?' == chr)
  ------------------
  |  Branch (1152:11): [True: 399, False: 21.6k]
  ------------------
 1153|    399|      {
 1154|    399|        if ((NULL == c->rq.hdrs.rq_line.rq_tgt_qmark)
  ------------------
  |  Branch (1154:13): [True: 399, False: 0]
  ------------------
 1155|    399|            && (NULL != c->rq.hdrs.rq_line.rq_tgt))
  ------------------
  |  Branch (1155:16): [True: 399, False: 0]
  ------------------
 1156|    399|        {
 1157|    399|          c->rq.hdrs.rq_line.rq_tgt_qmark = read_buffer + p;
 1158|    399|        }
 1159|    399|      }
 1160|  21.6k|      else if ((0xb == chr) || (0xc == chr))
  ------------------
  |  Branch (1160:16): [True: 0, False: 21.6k]
  |  Branch (1160:32): [True: 0, False: 21.6k]
  ------------------
 1161|      0|      {
 1162|       |        /* VT or LF characters */
 1163|      0|        mhd_assert (!other_wsp_as_wsp);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1164|      0|        if ((NULL != c->rq.hdrs.rq_line.rq_tgt)
  ------------------
  |  Branch (1164:13): [True: 0, False: 0]
  ------------------
 1165|      0|            && (NULL == c->rq.version)
  ------------------
  |  Branch (1165:16): [True: 0, False: 0]
  ------------------
 1166|      0|            && (wsp_in_uri))
  ------------------
  |  Branch (1166:16): [True: 0, False: 0]
  ------------------
 1167|      0|        {
 1168|      0|          c->rq.hdrs.rq_line.num_ws_in_uri++;
 1169|      0|        }
 1170|      0|        else
 1171|      0|        {
 1172|      0|          mhd_STREAM_ABORT (c, mhd_CONN_CLOSE_CLIENT_HTTP_ERR_ABORT_CONN,
  ------------------
  |  |  354|      0|#  define mhd_STREAM_ABORT(c, r, m) (mhd_conn_start_closing ((c),(r),(m)))
  ------------------
 1173|      0|                            "Invalid character is in the request line.");
 1174|      0|          return true; /* Error in the request */
 1175|      0|        }
 1176|      0|      }
 1177|  21.6k|      else if (0 == chr)
  ------------------
  |  Branch (1177:16): [True: 0, False: 21.6k]
  ------------------
 1178|      0|      {
 1179|       |        /* NUL character */
 1180|      0|        mhd_STREAM_ABORT (c, mhd_CONN_CLOSE_CLIENT_HTTP_ERR_ABORT_CONN,
  ------------------
  |  |  354|      0|#  define mhd_STREAM_ABORT(c, r, m) (mhd_conn_start_closing ((c),(r),(m)))
  ------------------
 1181|      0|                          "The NUL character is in the request line.");
 1182|      0|        return true; /* Error in the request */
 1183|      0|      }
 1184|  22.0k|    }
 1185|       |
 1186|  25.3k|    p++;
 1187|  25.3k|  }
 1188|       |
 1189|      0|  c->rq.hdrs.rq_line.proc_pos = p;
 1190|      0|  return false; /* Not enough data yet */
 1191|  1.67k|}
stream_process_request.c:_ZL20process_http_versionP14MHD_ConnectionmPKc:
  585|    992|{
  586|    992|  enum mhd_HTTP_ProtVerParse h_ver;
  587|       |
  588|    992|  h_ver = parse_http_version (len,
  589|    992|                              http_string);
  590|    992|  if (mhd_HTTP_VER_0X == h_ver)
  ------------------
  |  Branch (590:7): [True: 58, False: 934]
  ------------------
  591|     58|  {
  592|     58|    connection->rq.http_ver = MHD_HTTP_VERSION_INVALID;
  593|     58|    mhd_RESPOND_WITH_ERROR_STATIC (connection,
  ------------------
  |  |   85|     58|          respond_with_error_len ((c), (code), \
  |  |   86|     58|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|     58|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|     58|                                  0, NULL)
  ------------------
  594|     58|                                   MHD_HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED,
  595|     58|                                   ERR_RSP_REQ_HTTP_VER_IS_TOO_OLD);
  596|     58|    return false;
  597|     58|  }
  598|       |
  599|    934|  connection->rq.http_ver = (enum MHD_HTTP_ProtocolVersion)h_ver;
  600|       |
  601|    934|  switch (connection->rq.http_ver)
  602|    934|  {
  603|     80|  case MHD_HTTP_VERSION_INVALID:
  ------------------
  |  Branch (603:3): [True: 80, False: 854]
  ------------------
  604|     80|    break;
  605|    655|  case MHD_HTTP_VERSION_1_1:
  ------------------
  |  Branch (605:3): [True: 655, False: 279]
  ------------------
  606|    813|  case MHD_HTTP_VERSION_1_0:
  ------------------
  |  Branch (606:3): [True: 158, False: 776]
  ------------------
  607|    813|    return true;
  608|     10|  case MHD_HTTP_VERSION_1_2P:
  ------------------
  |  Branch (608:3): [True: 10, False: 924]
  ------------------
  609|     10|    if (MHD_PSL_VERY_STRICT > connection->daemon->req_cfg.strictness)
  ------------------
  |  Branch (609:9): [True: 6, False: 4]
  ------------------
  610|      6|      return true;
  611|      4|    break;
  612|     31|  case MHD_HTTP_VERSION_2:
  ------------------
  |  Branch (612:3): [True: 31, False: 903]
  ------------------
  613|     31|    mhd_RESPOND_WITH_ERROR_STATIC (connection,
  ------------------
  |  |   85|     31|          respond_with_error_len ((c), (code), \
  |  |   86|     31|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|     31|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|     31|                                  0, NULL)
  ------------------
  614|     31|                                   MHD_HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED,
  615|     31|                                   ERR_RSP_REQ_HTTP_VER_IS_NOT_SUPPORTED);
  616|     31|    return false;
  617|      0|  case MHD_HTTP_VERSION_3:
  ------------------
  |  Branch (617:3): [True: 0, False: 934]
  ------------------
  618|      0|  case MHD_HTTP_VERSION_FUTURE:
  ------------------
  |  Branch (618:3): [True: 0, False: 934]
  ------------------
  619|      0|  default:
  ------------------
  |  Branch (619:3): [True: 0, False: 934]
  ------------------
  620|      0|    mhd_UNREACHABLE ();
  ------------------
  |  |   64|      0|#    define mhd_UNREACHABLE()           MHD_UNREACHABLE_KEYWORD
  |  |  ------------------
  |  |  |  | 1110|      0|#define MHD_UNREACHABLE_KEYWORD __builtin_unreachable()
  |  |  ------------------
  ------------------
  621|      0|    break;
  622|    934|  }
  623|       |
  624|     84|  mhd_RESPOND_WITH_ERROR_STATIC (connection,
  ------------------
  |  |   85|     84|          respond_with_error_len ((c), (code), \
  |  |   86|     84|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|     84|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|     84|                                  0, NULL)
  ------------------
  625|     84|                                 MHD_HTTP_STATUS_BAD_REQUEST,
  626|     84|                                 ERR_RSP_REQUEST_MALFORMED);
  627|     84|  return false;
  628|    934|}
stream_process_request.c:_ZL18parse_http_versionmPKc:
  535|    992|{
  536|    992|  const char *const h = http_string; /**< short alias */
  537|    992|  mhd_assert (NULL != http_string);
  ------------------
  |  |   66|    992|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  538|       |
  539|       |  /* String must start with 'HTTP/d.d', case-sensitive match.
  540|       |   * See https://www.rfc-editor.org/rfc/rfc9112#name-http-version */
  541|    992|  if ((HTTP_VER_LEN == len)
  ------------------
  |  |  480|    992|#define HTTP_VER_LEN (mhd_SSTR_LEN (MHD_HTTP_VERSION_1_1_STR))
  |  |  ------------------
  |  |  |  |   54|    992|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  ------------------
  |  Branch (541:7): [True: 992, False: 0]
  ------------------
  542|    992|      && (0 == memcmp ("HTTP/", h, 5u))
  ------------------
  |  Branch (542:10): [True: 934, False: 58]
  ------------------
  543|    934|      && ('.' == h[6]))
  ------------------
  |  Branch (543:10): [True: 934, False: 0]
  ------------------
  544|    934|  {
  545|    934|    const unsigned char mj = (unsigned char)(h[5] - '0');  /**< Major number */
  546|    934|    const unsigned char mn = (unsigned char)(h[7] - '0');  /**< Minor number */
  547|       |
  548|    934|    if (1u == mj)
  ------------------
  |  Branch (548:9): [True: 823, False: 111]
  ------------------
  549|    823|    {
  550|       |      /* HTTP/1.x */
  551|    823|      if (1u == mn)
  ------------------
  |  Branch (551:11): [True: 655, False: 168]
  ------------------
  552|    655|        return mhd_HTTP_VER_1_1;
  553|    168|      if (0u == mn)
  ------------------
  |  Branch (553:11): [True: 158, False: 10]
  ------------------
  554|    158|        return mhd_HTTP_VER_1_0;
  555|     10|      if (9u >= mn)
  ------------------
  |  Branch (555:11): [True: 10, False: 0]
  ------------------
  556|     10|        return mhd_HTTP_VER_1_2P;
  557|       |
  558|      0|      return mhd_HTTP_VER_INVALID;
  559|     10|    }
  560|       |
  561|    111|    if ((0u == mj) && (9u >= mn))
  ------------------
  |  Branch (561:9): [True: 58, False: 53]
  |  Branch (561:23): [True: 58, False: 0]
  ------------------
  562|     58|      return mhd_HTTP_VER_0X; /* Too old major version */
  563|       |
  564|     53|    if ((2u == mj) && (0u == mn))
  ------------------
  |  Branch (564:9): [True: 34, False: 19]
  |  Branch (564:23): [True: 31, False: 3]
  ------------------
  565|     31|      return mhd_HTTP_VER_2;
  566|     53|  }
  567|       |
  568|     80|  return mhd_HTTP_VER_INVALID;
  569|    992|}
stream_process_request.c:_ZL21parse_http_std_methodP14MHD_Connection:
  490|  1.67k|{
  491|  1.67k|  const char *const restrict m = connection->rq.method.cstr; /**< short alias */
  492|  1.67k|  const size_t len =  connection->rq.method.len; /**< short alias */
  493|  1.67k|  mhd_assert (NULL != m);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  494|  1.67k|  mhd_assert (0 != len);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  495|  1.67k|  mhd_assert (0 == m[len]);
  ------------------
  |  |   66|  1.67k|#  define mhd_assert(ignore) ((void) 0)
  ------------------
  496|       |
  497|  1.67k|  connection->rq.http_mthd = mhd_parse_http_method (len,
  498|  1.67k|                                                    m);
  499|  1.67k|}
stream_process_request.c:_ZL22process_request_targetP14MHD_Connection:
 1303|    819|{
 1304|    819|  size_t params_len;
 1305|       |
 1306|    819|  mhd_assert (mhd_HTTP_STAGE_REQ_LINE_RECEIVING == c->stage);
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1307|    819|  mhd_assert (NULL == c->rq.url);
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1308|    819|  mhd_assert (0 == c->rq.url_len);
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1309|    819|  mhd_assert (NULL != c->rq.hdrs.rq_line.rq_tgt);
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1310|    819|  mhd_assert ((NULL == c->rq.hdrs.rq_line.rq_tgt_qmark) \
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1311|    819|              || (c->rq.hdrs.rq_line.rq_tgt <=
 1312|    819|                  c->rq.hdrs.rq_line.rq_tgt_qmark));
 1313|    819|  mhd_assert ((NULL == c->rq.hdrs.rq_line.rq_tgt_qmark) \
  ------------------
  |  |   66|    819|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1314|    819|              || (c->rq.req_target_len > \
 1315|    819|                  (size_t)(c->rq.hdrs.rq_line.rq_tgt_qmark \
 1316|    819|                           - c->rq.hdrs.rq_line.rq_tgt)));
 1317|       |
 1318|       |  /* Log callback before the request-target is modified/decoded */
 1319|    819|  if (NULL != c->daemon->req_cfg.uri_cb.cb)
  ------------------
  |  Branch (1319:7): [True: 0, False: 819]
  ------------------
 1320|      0|  {
 1321|      0|    struct MHD_EarlyUriCbData req_data;
 1322|      0|    req_data.request = &(c->rq);
 1323|      0|    req_data.full_uri.cstr = c->rq.hdrs.rq_line.rq_tgt;
 1324|      0|    req_data.full_uri.len = c->rq.req_target_len;
 1325|      0|    c->rq.app_aware = true;
 1326|      0|    c->daemon->req_cfg.uri_cb.cb (c->daemon->req_cfg.uri_cb.cls,
 1327|      0|                                  &req_data,
 1328|      0|                                  &(c->rq.app_context));
 1329|      0|  }
 1330|       |
 1331|    819|  if (NULL != c->rq.hdrs.rq_line.rq_tgt_qmark)
  ------------------
  |  Branch (1331:7): [True: 317, False: 502]
  ------------------
 1332|    317|  {
 1333|    317|    params_len =
 1334|    317|      c->rq.req_target_len
 1335|    317|      - (size_t)(c->rq.hdrs.rq_line.rq_tgt_qmark - c->rq.hdrs.rq_line.rq_tgt);
 1336|       |
 1337|    317|    mhd_assert (1 <= params_len);
  ------------------
  |  |   66|    317|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1338|       |
 1339|    317|    c->rq.hdrs.rq_line.rq_tgt_qmark[0] = 0; /* Replace '?' with zero termination */
 1340|       |
 1341|       |    // TODO: support detection of decoding errors
 1342|    317|    if (!mhd_parse_uri_args (params_len - 1,
  ------------------
  |  Branch (1342:9): [True: 21, False: 296]
  ------------------
 1343|    317|                             c->rq.hdrs.rq_line.rq_tgt_qmark + 1,
 1344|    317|                             &request_add_get_arg,
 1345|    317|                             &(c->h1_stream)))
 1346|     21|    {
 1347|     21|      mhd_LOG_MSG (c->daemon, MHD_SC_CONNECTION_POOL_NO_MEM_GET_PARAM,
  ------------------
  |  |   80|     21|#  define mhd_LOG_MSG(daemon, sc, msg) mhd_logger (daemon,sc,msg)
  ------------------
 1348|     21|                   "Not enough memory in the pool to store GET parameter");
 1349|       |
 1350|     21|      mhd_RESPOND_WITH_ERROR_STATIC (
  ------------------
  |  |   85|     21|          respond_with_error_len ((c), (code), \
  |  |   86|     21|                                  mhd_SSTR_LEN (msg), (msg), \
  |  |  ------------------
  |  |  |  |   54|     21|#define mhd_SSTR_LEN(sstr) (sizeof(sstr) / sizeof(char) - 1)
  |  |  ------------------
  |  |   87|     21|                                  0, NULL)
  ------------------
 1351|     21|        c,
 1352|     21|        mhd_stream_get_no_space_err_status_code (c,
 1353|     21|                                                 MHD_PROC_RECV_URI,
 1354|     21|                                                 0,
 1355|     21|                                                 NULL),
 1356|     21|        ERR_RSP_MSG_REQUEST_TOO_BIG);
 1357|     21|      mhd_assert (mhd_HTTP_STAGE_REQ_LINE_RECEIVING != c->stage);
  ------------------
  |  |   66|     21|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1358|     21|      return false;
 1359|       |
 1360|     21|    }
 1361|    317|  }
 1362|    502|  else
 1363|    502|    params_len = 0;
 1364|       |
 1365|    798|  mhd_assert (strlen (c->rq.hdrs.rq_line.rq_tgt) == \
  ------------------
  |  |   66|    798|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 1366|    798|              c->rq.req_target_len - params_len);
 1367|       |
 1368|       |  /* Finally unescape URI itself */
 1369|       |  // TODO: support detection of decoding errors
 1370|    798|  c->rq.url_len =
 1371|    798|    mhd_str_pct_decode_lenient_n (c->rq.hdrs.rq_line.rq_tgt,
 1372|    798|                                  c->rq.req_target_len - params_len,
 1373|    798|                                  c->rq.hdrs.rq_line.rq_tgt,
 1374|    798|                                  c->rq.req_target_len - params_len,
 1375|    798|                                  NULL);
 1376|    798|  c->rq.url = c->rq.hdrs.rq_line.rq_tgt;
 1377|       |
 1378|    798|  return true;
 1379|    819|}
stream_process_request.c:_ZL19request_add_get_argPvPK10MHD_StringPK18MHD_StringNullable:
 1206|    317|{
 1207|    317|  struct MHD_Stream *s = (struct MHD_Stream *)cls;
 1208|       |
 1209|    317|  return mhd_stream_add_field_nullable (s, MHD_VK_URI_QUERY_PARAM, name, value);
 1210|    317|}
stream_process_request.c:_ZL31process_request_nonchunked_bodyP14MHD_Connection:
 3569|    897|{
 3570|    897|  size_t cntn_data_ready;
 3571|    897|  bool read_buf_reuse;
 3572|    897|  bool state_updated;
 3573|       |
 3574|    897|  mhd_assert (NULL == c->rp.response);
  ------------------
  |  |   66|    897|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3575|    897|  mhd_assert (!c->rq.have_chunked_upload);
  ------------------
  |  |   66|    897|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3576|    897|  mhd_assert (MHD_SIZE_UNKNOWN != c->rq.cntn.cntn_size);
  ------------------
  |  |   66|    897|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3577|    897|  mhd_assert (c->rq.cntn.recv_size < c->rq.cntn.cntn_size);
  ------------------
  |  |   66|    897|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3578|    897|  mhd_assert (c->rq.app_aware);
  ------------------
  |  |   66|    897|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3579|       |
 3580|    897|  if ((c->rq.cntn.cntn_size - c->rq.cntn.recv_size) < c->read_buffer_offset)
  ------------------
  |  Branch (3580:7): [True: 260, False: 637]
  ------------------
 3581|    260|    cntn_data_ready = (size_t)(c->rq.cntn.cntn_size - c->rq.cntn.recv_size);
 3582|    637|  else
 3583|    637|    cntn_data_ready = c->read_buffer_offset;
 3584|       |
 3585|    897|  read_buf_reuse = false;
 3586|    897|  state_updated = false;
 3587|    897|  mhd_assert (!read_buf_reuse);  /* Mute analyser warning */
  ------------------
  |  |   66|    897|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3588|       |
 3589|    897|#ifdef MHD_SUPPORT_POST_PARSER
 3590|    897|  if (mhd_ACTION_POST_PARSE == c->rq.app_act.head_act.act)
  ------------------
  |  Branch (3590:7): [True: 801, False: 96]
  ------------------
 3591|    801|  {
 3592|    801|    size_t size_provided;
 3593|       |    // TODO: rework to correctly support partial processing
 3594|       |    // TODO: rework to support receiving directly into "large buffer"
 3595|    801|    c->rq.cntn.recv_size += cntn_data_ready;
 3596|    801|    size_provided = cntn_data_ready;
 3597|       |
 3598|    801|    state_updated = mhd_stream_post_parse (c,
 3599|    801|                                           &size_provided,
 3600|    801|                                           c->read_buffer);
 3601|    801|    mhd_assert ((0 == size_provided) \
  ------------------
  |  |   66|    801|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3602|    801|                || (MHD_POST_PARSE_RES_OK != c->rq.u_proc.post.parse_result) \
 3603|    801|                || (mhd_HTTP_STAGE_BODY_RECEIVING != c->stage));
 3604|    801|    if (mhd_HTTP_STAGE_BODY_RECEIVING != c->stage)
  ------------------
  |  Branch (3604:9): [True: 342, False: 459]
  ------------------
 3605|    342|      c->discard_request = true;
 3606|       |
 3607|    801|    read_buf_reuse = true;
 3608|       |    /* Only the data actually taken by the parser is "processed".
 3609|       |       Currently the parser takes all the provided data, unless it failed to
 3610|       |       get enough large buffer memory.
 3611|       |       TODO: in-place processing will require reworking the "recv_size"
 3612|       |       accounting above and the read buffer reuse as well. */
 3613|    801|    mhd_assert (size_provided <= cntn_data_ready);
  ------------------
  |  |   66|    801|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3614|    801|    c->rq.cntn.proc_size += cntn_data_ready - size_provided;
 3615|    801|    if (c->rq.cntn.recv_size == c->rq.cntn.cntn_size)
  ------------------
  |  Branch (3615:9): [True: 801, False: 0]
  ------------------
 3616|    801|    {
 3617|    801|      c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
 3618|    801|      state_updated = true;
 3619|    801|    }
 3620|    801|  }
 3621|     96|  else
 3622|     96|#endif /* MHD_SUPPORT_POST_PARSER */
 3623|     96|  if (1)
  ------------------
  |  Branch (3623:7): [True: 96, Folded]
  ------------------
 3624|     96|  {
 3625|     96|    mhd_assert (mhd_ACTION_UPLOAD == c->rq.app_act.head_act.act);
  ------------------
  |  |   66|     96|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3626|     96|    if (NULL != c->rq.app_act.head_act.data.upload.full.cb)
  ------------------
  |  Branch (3626:9): [True: 96, False: 0]
  ------------------
 3627|     96|    {
 3628|       |      // TODO: implement processing in pool memory if buffer is large enough
 3629|     96|      mhd_assert ((c->rq.cntn.recv_size + cntn_data_ready) <=
  ------------------
  |  |   66|     96|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3630|     96|                  (uint_fast64_t)c->rq.cntn.lbuf.size);
 3631|     96|      memcpy (c->rq.cntn.lbuf.data + c->rq.cntn.recv_size,
 3632|     96|              c->read_buffer, cntn_data_ready);
 3633|     96|      c->rq.cntn.recv_size += cntn_data_ready;
 3634|     96|      read_buf_reuse = true;
 3635|     96|      if (c->rq.cntn.recv_size == c->rq.cntn.cntn_size)
  ------------------
  |  Branch (3635:11): [True: 96, False: 0]
  ------------------
 3636|     96|      {
 3637|     96|        c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;
 3638|     96|        state_updated = true;
 3639|     96|      }
 3640|     96|    }
 3641|      0|    else
 3642|      0|    {
 3643|      0|      const struct MHD_UploadAction *act;
 3644|      0|      mhd_assert (NULL != c->rq.app_act.head_act.data.upload.inc.cb);
  ------------------
  |  |   66|      0|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3645|       |
 3646|      0|      c->rq.cntn.recv_size += cntn_data_ready;
 3647|      0|      act = c->rq.app_act.head_act.data.upload.inc.cb (
 3648|      0|        c->rq.app_act.head_act.data.upload.inc.cls,
 3649|      0|        &(c->rq),
 3650|      0|        cntn_data_ready,
 3651|      0|        c->read_buffer);
 3652|      0|      c->rq.cntn.proc_size += cntn_data_ready;
 3653|      0|      read_buf_reuse = true;
 3654|      0|      state_updated = mhd_stream_process_upload_action (c, act, false);
 3655|      0|    }
 3656|     96|  }
 3657|       |
 3658|    897|  if (read_buf_reuse)
  ------------------
  |  Branch (3658:7): [True: 897, False: 0]
  ------------------
 3659|    897|  {
 3660|    897|    size_t data_left_size;
 3661|    897|    mhd_assert (c->read_buffer_offset >= cntn_data_ready);
  ------------------
  |  |   66|    897|#  define mhd_assert(ignore) ((void) 0)
  ------------------
 3662|    897|    data_left_size = c->read_buffer_offset - cntn_data_ready;
 3663|    897|    if (0 != data_left_size)
  ------------------
  |  Branch (3663:9): [True: 260, False: 637]
  ------------------
 3664|    260|      memmove (c->read_buffer,
 3665|    260|               c->read_buffer + cntn_data_ready,
 3666|    260|               data_left_size);
 3667|    897|    c->read_buffer_offset = data_left_size;
 3668|    897|  }
 3669|       |
 3670|    897|  return state_updated;
 3671|    897|}

