_ZNK4crow7ci_hashclENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   15|  1.04M|        {
   16|  1.04M|            std::size_t seed = 0;
   17|  1.04M|            std::locale locale;
   18|       |
   19|  1.04M|            for (auto c : key)
  ------------------
  |  Branch (19:25): [True: 10.5M, False: 1.04M]
  ------------------
   20|  10.5M|                hash_combine(seed, std::toupper(c, locale));
   21|       |
   22|  1.04M|            return seed;
   23|  1.04M|        }
_ZN4crow7ci_hash12hash_combineERmc:
   27|  10.5M|        {
   28|  10.5M|            std::hash<char> hasher;
   29|  10.5M|            seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
   30|  10.5M|        }
_ZNK4crow9ci_key_eqclENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   37|  52.4M|        {
   38|  52.4M|            return utility::string_equals(l, r);
   39|  52.4M|        }

_ZN4crow11bad_requestC2EPKc:
   12|  7.20k|            : std::runtime_error(what_arg) {}

_ZN4crow7requestC2Ev:
   67|  5.85k|          method(HTTPMethod::Get)
   68|  5.85k|        {}
_ZN4crow7request10add_headerENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_:
   76|  5.85k|        {
   77|  5.85k|            sanitize_header_value(key);
   78|  5.85k|            sanitize_header_value(value);
   79|  5.85k|            headers.emplace(std::move(key), std::move(value));
   80|  5.85k|        }
_ZN4crow21sanitize_header_valueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   26|  11.7k|    {
   27|  11.7k|        s.erase(std::remove_if(s.begin(), s.end(),
   28|  11.7k|                               [](char c) { return c == '\r' || c == '\n'; }),
   29|  11.7k|                s.end());
   30|  11.7k|    }
_ZZN4crow21sanitize_header_valueERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEENKUlcE_clEc:
   28|   254k|                               [](char c) { return c == '\r' || c == '\n'; }),
  ------------------
  |  Branch (28:52): [True: 0, False: 254k]
  |  Branch (28:65): [True: 0, False: 254k]
  ------------------
_ZN4crow16get_header_valueERKNSt3__118unordered_multimapINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES7_NS_7ci_hashENS_9ci_key_eqENS5_INS0_4pairIKS7_S7_EEEEEERSB_:
   34|  11.5k|    {
   35|  11.5k|        static const std::string EMPTY;
   36|  11.5k|        const auto it = headers.find(key);
   37|  11.5k|        if (it != headers.end()) {
  ------------------
  |  Branch (37:13): [True: 11.5k, False: 0]
  ------------------
   38|  11.5k|            return it->second;
   39|  11.5k|        }
   40|      0|        else {
   41|      0|            return EMPTY;
   42|      0|        }
   43|  11.5k|    }

_ZN4crow9multipart7messageC2ERKNS_7requestE:
  146|  5.78k|              returnable("multipart/form-data; boundary=CROW-BOUNDARY"),
  147|  5.78k|              headers(req.headers),
  148|  5.78k|              boundary(get_boundary(get_header_value("Content-Type")))
  149|  5.78k|            {
  150|  5.78k|                if (!boundary.empty())
  ------------------
  |  Branch (150:21): [True: 5.78k, False: 0]
  ------------------
  151|  5.78k|                {
  152|  5.78k|                    content_type = "multipart/form-data; boundary=" + boundary;
  153|  5.78k|                    parse_body(req.body);
  154|  5.78k|                }
  155|      0|                else
  156|      0|                {
  157|      0|                    throw bad_request("Empty boundary in multipart message");
  158|      0|                }
  159|  5.78k|            }
_ZNK4crow9multipart7message12get_boundaryERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  163|  5.78k|            {
  164|  5.78k|                constexpr char boundary_text[] = "boundary=";
  165|  5.78k|                size_t found = header.find(boundary_text);
  166|  5.78k|                if (found != std::string::npos)
  ------------------
  |  Branch (166:21): [True: 5.78k, False: 0]
  ------------------
  167|  5.78k|                {
  168|  5.78k|                    std::string to_return(header.substr(found + strlen(boundary_text)));
  169|  5.78k|                    if (to_return[0] == '\"')
  ------------------
  |  Branch (169:25): [True: 0, False: 5.78k]
  ------------------
  170|      0|                    {
  171|      0|                        to_return = to_return.substr(1, to_return.length() - 2);
  172|      0|                    }
  173|  5.78k|                    return to_return;
  174|  5.78k|                }
  175|      0|                return std::string();
  176|  5.78k|            }
_ZNK4crow9multipart7message16get_header_valueERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   83|  5.78k|            {
   84|  5.78k|                return crow::get_header_value(headers, key);
   85|  5.78k|            }
_ZN4crow9multipart7message10parse_bodyENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  179|  5.78k|            {
  180|  5.78k|                std::string delimiter = dd + boundary;
  181|       |
  182|       |                // TODO(EDev): Exit on error
  183|  33.5k|                while (body != (crlf))
  ------------------
  |  Branch (183:24): [True: 31.4k, False: 2.16k]
  ------------------
  184|  31.4k|                {
  185|  31.4k|                    size_t found = body.find(delimiter);
  186|  31.4k|                    if (found == std::string::npos)
  ------------------
  |  Branch (186:25): [True: 137, False: 31.2k]
  ------------------
  187|    137|                    {
  188|       |                        // did not find delimiter; probably an ill-formed body; throw to indicate the issue to user
  189|    137|                        throw bad_request("Unable to find delimiter in multipart message. Probably ill-formed body");
  190|    137|                    }
  191|  31.2k|                    std::string section = body.substr(0, found);
  192|       |
  193|       |                    // +2 is the CRLF.
  194|       |                    // We don't check it and delete it so that the same delimiter can be used for The last delimiter (--delimiter--CRLF).
  195|  31.2k|                    body.erase(0, found + delimiter.length() + 2);
  196|  31.2k|                    if (!section.empty()) {
  ------------------
  |  Branch (196:25): [True: 25.5k, False: 5.72k]
  ------------------
  197|  25.5k|                        part parsed_section(parse_section(section));
  198|  25.5k|                        const auto section_params_headers = get_header_object(
  199|  25.5k|                            parsed_section.headers, "Content-Disposition").params;
  200|  25.5k|                        const auto name_header = section_params_headers.find("name");
  201|  25.5k|                        if (name_header == section_params_headers.end()) {
  ------------------
  |  Branch (201:29): [True: 3.47k, False: 22.0k]
  ------------------
  202|  3.47k|                            throw bad_request("Unable to find header 'name' in multipart section. Probably ill-formed body.");
  203|  22.0k|                        } else {
  204|  22.0k|                            part_map.emplace(name_header->second, parsed_section);
  205|  22.0k|                            parts.push_back(std::move(parsed_section));
  206|  22.0k|                        }
  207|  25.5k|                    }
  208|  31.2k|                }
  209|  5.78k|            }
_ZN4crow9multipart7message13parse_sectionERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  212|  25.5k|            {
  213|  25.5k|                struct part to_return;
  214|       |
  215|  25.5k|                size_t found = section.find(crlfcrlf);
  216|  25.5k|                if (found == std::string::npos)
  ------------------
  |  Branch (216:21): [True: 46, False: 25.5k]
  ------------------
  217|     46|                {
  218|     46|                    throw bad_request("Unable to find section headers in multipart message. Probably ill-formed body.");
  219|     46|                }
  220|  25.5k|                std::string head_line = section.substr(0, found + 2);
  221|  25.5k|                section.erase(0, found + 4);
  222|       |
  223|  25.5k|                parse_section_head(head_line, to_return);
  224|  25.5k|                to_return.body = section.substr(0, section.length() - 2);
  225|  25.5k|                return to_return;
  226|  25.5k|            }
_ZN4crow9multipart7message18parse_section_headERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERNS0_4partE:
  229|  25.5k|            {
  230|   120k|                while (!lines.empty())
  ------------------
  |  Branch (230:24): [True: 94.5k, False: 25.5k]
  ------------------
  231|  94.5k|                {
  232|  94.5k|                    header to_add;
  233|       |
  234|  94.5k|                    const size_t found_crlf = lines.find(crlf);
  235|  94.5k|                    std::string line = lines.substr(0, found_crlf);
  236|  94.5k|                    std::string key;
  237|  94.5k|                    lines.erase(0, found_crlf + 2);
  238|       |                    // Add the header if available
  239|  94.5k|                    if (!line.empty())
  ------------------
  |  Branch (239:25): [True: 91.8k, False: 2.68k]
  ------------------
  240|  91.8k|                    {
  241|  91.8k|                        const size_t found_semicolon = line.find("; ");
  242|  91.8k|                        std::string header = line.substr(0, found_semicolon);
  243|  91.8k|                        if (found_semicolon != std::string::npos)
  ------------------
  |  Branch (243:29): [True: 29.4k, False: 62.4k]
  ------------------
  244|  29.4k|                            line.erase(0, found_semicolon + 2);
  245|  62.4k|                        else
  246|  62.4k|                            line = std::string();
  247|       |
  248|  91.8k|                        size_t header_split = header.find(": ");
  249|  91.8k|                        key = header.substr(0, header_split);
  250|       |
  251|  91.8k|                        to_add.value = header.substr(header_split + 2);
  252|  91.8k|                    }
  253|       |
  254|       |                    // Add the parameters
  255|   153k|                    while (!line.empty())
  ------------------
  |  Branch (255:28): [True: 59.0k, False: 94.5k]
  ------------------
  256|  59.0k|                    {
  257|  59.0k|                        const size_t found_semicolon = line.find("; ");
  258|  59.0k|                        std::string param = line.substr(0, found_semicolon);
  259|  59.0k|                        if (found_semicolon != std::string::npos)
  ------------------
  |  Branch (259:29): [True: 30.1k, False: 28.8k]
  ------------------
  260|  30.1k|                            line.erase(0, found_semicolon + 2);
  261|  28.8k|                        else
  262|  28.8k|                            line = std::string();
  263|       |
  264|  59.0k|                        size_t param_split = param.find('=');
  265|       |
  266|  59.0k|                        std::string value = param.substr(param_split + 1);
  267|       |
  268|  59.0k|                        to_add.params.emplace(param.substr(0, param_split), trim(value));
  269|  59.0k|                    }
  270|  94.5k|                    part.headers.emplace(key, to_add);
  271|  94.5k|                }
  272|  25.5k|            }
_ZNK4crow9multipart7message4trimERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKc:
  275|  59.0k|            {
  276|  59.0k|                if (string.length() > 1 && string[0] == excess && string[string.length() - 1] == excess)
  ------------------
  |  Branch (276:21): [True: 34.6k, False: 24.4k]
  |  Branch (276:44): [True: 9.03k, False: 25.5k]
  |  Branch (276:67): [True: 7.13k, False: 1.90k]
  ------------------
  277|  7.13k|                    return string.substr(1, string.length() - 2);
  278|  51.9k|                return string;
  279|  59.0k|            }
_ZN4crow9multipart17get_header_objectINSt3__118unordered_multimapINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS0_6headerENS_7ci_hashENS_9ci_key_eqENS7_INS2_4pairIKS9_SA_EEEEEEEERKSA_RKT_RSE_:
   49|  25.4k|        {
   50|  25.4k|            return get_header_value_object<header>(headers, key);
   51|  25.4k|        }
_ZN4crow9multipart23get_header_value_objectINS0_6headerENSt3__118unordered_multimapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEES2_NS_7ci_hashENS_9ci_key_eqENS8_INS3_4pairIKSA_S2_EEEEEEEERKT_RKT0_RSE_:
   37|  25.4k|        {
   38|  25.4k|            if (headers.count(key))
  ------------------
  |  Branch (38:17): [True: 22.3k, False: 3.11k]
  ------------------
   39|  22.3k|            {
   40|  22.3k|                return headers.find(key)->second;
   41|  22.3k|            }
   42|  3.11k|            static O empty;
   43|  3.11k|            return empty;
   44|  25.4k|        }
_ZNK4crow9multipart7message4dumpEv:
   98|  2.07k|            {
   99|  2.07k|                std::stringstream str;
  100|  2.07k|                const std::string delimiter = dd + boundary;
  101|       |
  102|  14.9k|                for (unsigned i = 0; i < parts.size(); i++)
  ------------------
  |  Branch (102:38): [True: 12.8k, False: 2.07k]
  ------------------
  103|  12.8k|                {
  104|  12.8k|                    str << delimiter << crlf;
  105|  12.8k|                    str << dump(i);
  106|  12.8k|                }
  107|  2.07k|                str << delimiter << dd << crlf;
  108|  2.07k|                return str.str();
  109|  2.07k|            }
_ZNK4crow9multipart7message4dumpEi:
  113|  25.7k|            {
  114|  25.7k|                std::stringstream str;
  115|  25.7k|                part item = parts[part_];
  116|  25.7k|                for (auto& item_h : item.headers)
  ------------------
  |  Branch (116:35): [True: 72.8k, False: 25.7k]
  ------------------
  117|  72.8k|                {
  118|  72.8k|                    str << item_h.first << ": " << item_h.second.value;
  119|  72.8k|                    for (auto& it : item_h.second.params)
  ------------------
  |  Branch (119:35): [True: 48.2k, False: 72.8k]
  ------------------
  120|  48.2k|                    {
  121|  48.2k|                        str << "; " << it.first << '=' << pad(it.second);
  122|  48.2k|                    }
  123|  72.8k|                    str << crlf;
  124|  72.8k|                }
  125|  25.7k|                str << crlf;
  126|  25.7k|                str << item.body << crlf;
  127|  25.7k|                return str.str();
  128|  25.7k|            }
_ZNK4crow9multipart7message3padERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKc:
  282|  48.2k|            {
  283|  48.2k|                return (padding + string + padding);
  284|  48.2k|            }
_ZN4crow9multipart7message16get_part_by_nameERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   88|  12.8k|            {
   89|  12.8k|                mp_map::iterator result = part_map.find(name);
   90|  12.8k|                if (result != part_map.end())
  ------------------
  |  Branch (90:21): [True: 12.8k, False: 0]
  ------------------
   91|  12.8k|                    return result->second;
   92|      0|                else
   93|      0|                    return {};
   94|  12.8k|            }

_ZN4crow9multipart12message_viewC2ERKNS_7requestE:
  174|  5.78k|              headers(req.headers),
  175|  5.78k|              boundary(get_boundary(get_header_value("Content-Type")))
  176|  5.78k|            {
  177|  5.78k|                if (boundary.empty())
  ------------------
  |  Branch (177:21): [True: 0, False: 5.78k]
  ------------------
  178|      0|                    throw bad_request("Empty boundary in multipart message");
  179|  5.78k|                parse_body(req.body);
  180|  5.78k|            }
_ZN4crow9multipart12message_view12get_boundaryENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  184|  5.78k|            {
  185|  5.78k|                constexpr std::string_view boundary_text = "boundary=";
  186|  5.78k|                const size_t found = header.find(boundary_text);
  187|  5.78k|                if (found == std::string_view::npos)
  ------------------
  |  Branch (187:21): [True: 0, False: 5.78k]
  ------------------
  188|      0|                {
  189|      0|                    return {};
  190|      0|                }
  191|       |
  192|  5.78k|                const std::string_view to_return = header.substr(found + boundary_text.size());
  193|  5.78k|                if (!to_return.empty() && to_return[0] == '\"')
  ------------------
  |  Branch (193:21): [True: 5.78k, False: 0]
  |  Branch (193:43): [True: 0, False: 5.78k]
  ------------------
  194|      0|                {
  195|      0|                    return to_return.substr(1, to_return.length() - 2);
  196|      0|                }
  197|  5.78k|                return to_return;
  198|  5.78k|            }
_ZNK4crow9multipart12message_view16get_header_valueERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  129|  5.78k|            {
  130|  5.78k|                return crow::get_header_value(headers.get(), key);
  131|  5.78k|            }
_ZN4crow9multipart12message_view10parse_bodyENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  201|  5.78k|            {
  202|  5.78k|                const std::string delimiter = dd + boundary;
  203|       |
  204|       |                // TODO(EDev): Exit on error
  205|  33.5k|                while (body != (crlf))
  ------------------
  |  Branch (205:24): [True: 31.2k, False: 2.28k]
  ------------------
  206|  31.2k|                {
  207|  31.2k|                    const size_t found = body.find(delimiter);
  208|  31.2k|                    if (found == std::string_view::npos)
  ------------------
  |  Branch (208:25): [True: 109, False: 31.1k]
  ------------------
  209|    109|                    {
  210|       |                        // did not find delimiter; probably an ill-formed body; ignore the rest
  211|    109|                        throw bad_request("Unable to find multipart delimiter. Probably ill-formed body.");
  212|    109|                    }
  213|       |
  214|  31.1k|                    const std::string_view section = body.substr(0, found);
  215|       |
  216|       |                    // +2 is the CRLF.
  217|       |                    // We don't check it and delete it so that the same delimiter can be used for The last delimiter (--delimiter--CRLF).
  218|  31.1k|                    body = body.substr(found + delimiter.length() + 2);
  219|  31.1k|                    if (!section.empty())
  ------------------
  |  Branch (219:25): [True: 25.3k, False: 5.84k]
  ------------------
  220|  25.3k|                    {
  221|  25.3k|                        part_view parsed_section = parse_section(section);
  222|  25.3k|                        const auto& section_params = get_header_object(parsed_section.headers, "Content-Disposition").params;
  223|  25.3k|                        const auto name_header = section_params.find("name");
  224|  25.3k|                        if (name_header == section_params.end())
  ------------------
  |  Branch (224:29): [True: 3.38k, False: 21.9k]
  ------------------
  225|  3.38k|                        {
  226|  3.38k|                            throw bad_request("Unable to find header 'name' in multipart section. Probably ill-formed body.");
  227|  3.38k|                        }
  228|  21.9k|                        part_map.emplace(name_header->second, parsed_section);
  229|  21.9k|                        parts.push_back(std::move(parsed_section));
  230|  21.9k|                    }
  231|  31.1k|                }
  232|  5.78k|            }
_ZN4crow9multipart12message_view13parse_sectionENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  235|  25.3k|            {
  236|  25.3k|                const size_t found = section.find(crlfcrlf);
  237|  25.3k|                if (found==std::string_view::npos)
  ------------------
  |  Branch (237:21): [True: 45, False: 25.2k]
  ------------------
  238|     45|                {
  239|     45|                    throw bad_request("Section Header end missing in multipart message");
  240|     45|                }
  241|  25.2k|                const std::string_view head_line = section.substr(0, found + 2);
  242|  25.2k|                section = section.substr(found + 4);
  243|       |
  244|  25.2k|                return part_view{
  245|  25.2k|                  parse_section_head(head_line),
  246|  25.2k|                  section.substr(0, section.length() - 2),
  247|  25.2k|                };
  248|  25.3k|            }
_ZN4crow9multipart12message_view18parse_section_headENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  251|  25.2k|            {
  252|  25.2k|                mph_view_map result;
  253|       |
  254|   118k|                while (!lines.empty())
  ------------------
  |  Branch (254:24): [True: 93.5k, False: 25.2k]
  ------------------
  255|  93.5k|                {
  256|  93.5k|                    header_view to_add;
  257|       |
  258|  93.5k|                    const size_t found_crlf = lines.find(crlf);
  259|  93.5k|                    std::string_view line = lines.substr(0, found_crlf);
  260|  93.5k|                    std::string_view key;
  261|  93.5k|                    lines = lines.substr(found_crlf + 2);
  262|       |                    // Add the header if available
  263|  93.5k|                    if (!line.empty())
  ------------------
  |  Branch (263:25): [True: 90.8k, False: 2.67k]
  ------------------
  264|  90.8k|                    {
  265|  90.8k|                        const size_t found_semicolon = line.find("; ");
  266|  90.8k|                        std::string_view header = line.substr(0, found_semicolon);
  267|  90.8k|                        if (found_semicolon != std::string_view::npos)
  ------------------
  |  Branch (267:29): [True: 29.3k, False: 61.5k]
  ------------------
  268|  29.3k|                            line = line.substr(found_semicolon + 2);
  269|  61.5k|                        else
  270|  61.5k|                            line = std::string_view();
  271|       |
  272|  90.8k|                        const size_t header_split = header.find(": ");
  273|  90.8k|                        key = header.substr(0, header_split);
  274|       |
  275|  90.8k|                        to_add.value = header.substr(header_split + 2);
  276|  90.8k|                    }
  277|       |
  278|       |                    // Add the parameters
  279|   151k|                    while (!line.empty())
  ------------------
  |  Branch (279:28): [True: 58.0k, False: 93.5k]
  ------------------
  280|  58.0k|                    {
  281|  58.0k|                        const size_t found_semicolon = line.find("; ");
  282|  58.0k|                        std::string_view param = line.substr(0, found_semicolon);
  283|  58.0k|                        if (found_semicolon != std::string_view::npos)
  ------------------
  |  Branch (283:29): [True: 29.2k, False: 28.7k]
  ------------------
  284|  29.2k|                            line = line.substr(found_semicolon + 2);
  285|  28.7k|                        else
  286|  28.7k|                            line = std::string_view();
  287|       |
  288|  58.0k|                        const size_t param_split = param.find('=');
  289|       |
  290|  58.0k|                        const std::string_view value = param.substr(param_split + 1);
  291|       |
  292|  58.0k|                        to_add.params.emplace(param.substr(0, param_split), trim(value));
  293|  58.0k|                    }
  294|  93.5k|                    result.emplace(key, to_add);
  295|  93.5k|                }
  296|       |
  297|  25.2k|                return result;
  298|  25.2k|            }
_ZN4crow9multipart12message_view4trimENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEc:
  301|  58.0k|            {
  302|  58.0k|                if (string.length() > 1 && string[0] == excess && string[string.length() - 1] == excess)
  ------------------
  |  Branch (302:21): [True: 33.8k, False: 24.1k]
  |  Branch (302:44): [True: 8.83k, False: 25.0k]
  |  Branch (302:67): [True: 7.11k, False: 1.72k]
  ------------------
  303|  7.11k|                    return string.substr(1, string.length() - 2);
  304|  50.8k|                return string;
  305|  58.0k|            }
_ZN4crow9multipart17get_header_objectERKNSt3__118unordered_multimapINS1_17basic_string_viewIcNS1_11char_traitsIcEEEENS0_11header_viewENS_7ci_hashENS_9ci_key_eqENS1_9allocatorINS1_4pairIKS6_S7_EEEEEES6_:
   47|  25.2k|        {
   48|  25.2k|            const auto header = headers.find(key);
   49|  25.2k|            if (header != headers.cend())
  ------------------
  |  Branch (49:17): [True: 22.2k, False: 3.05k]
  ------------------
   50|  22.2k|            {
   51|  22.2k|                return header->second;
   52|  22.2k|            }
   53|       |
   54|  3.05k|            static header_view empty;
   55|  3.05k|            return empty;
   56|  25.2k|        }
_ZNK4crow9multipart12message_view4dumpEv:
  158|  2.09k|            {
  159|  2.09k|                std::ostringstream str;
  160|  2.09k|                str << *this;
  161|  2.09k|                return std::move(str).str();
  162|  2.09k|            }
_ZN4crow9multipartlsERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERKNS0_12message_viewE:
  143|  2.09k|            {
  144|  2.09k|                std::string delimiter = dd + message.boundary;
  145|       |
  146|  2.09k|                for (const part_view& part : message.parts)
  ------------------
  |  Branch (146:44): [True: 12.8k, False: 2.09k]
  ------------------
  147|  12.8k|                {
  148|  12.8k|                    stream << delimiter << crlf;
  149|  12.8k|                    stream << part;
  150|  12.8k|                }
  151|  2.09k|                stream << delimiter << dd << crlf;
  152|       |
  153|  2.09k|                return stream;
  154|  2.09k|            }
_ZN4crow9multipartlsERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERKNS0_9part_viewE:
  101|  25.6k|            {
  102|  25.6k|                for (const auto& [header_key, header_value] : part.headers)
  ------------------
  |  Branch (102:61): [True: 72.6k, False: 25.6k]
  ------------------
  103|  72.6k|                {
  104|  72.6k|                    stream << header_key << ": " << header_value.value;
  105|  72.6k|                    for (const auto& [param_key, param_value] : header_value.params)
  ------------------
  |  Branch (105:63): [True: 47.6k, False: 72.6k]
  ------------------
  106|  47.6k|                    {
  107|  47.6k|                        stream << "; " << param_key << '=' << padded{param_value};
  108|  47.6k|                    }
  109|  72.6k|                    stream << crlf;
  110|  72.6k|                }
  111|  25.6k|                stream << crlf;
  112|  25.6k|                stream << part.body << crlf;
  113|  25.6k|                return stream;
  114|  25.6k|            }
_ZN4crow9multipartlsERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS0_6paddedE:
   66|  47.6k|            {
   67|  47.6k|                return stream << padding << value_.value << padding;
   68|  47.6k|            }
_ZNK4crow9multipart12message_view4dumpEi:
  166|  12.8k|            {
  167|  12.8k|                std::ostringstream str;
  168|  12.8k|                str << parts.at(part_);
  169|  12.8k|                return std::move(str).str();
  170|  12.8k|            }

_ZN4crow12query_stringC2Ev:
  339|  5.85k|        query_string() = default;

_ZN4crow10returnableC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   14|  5.78k|          content_type{ctype}
   15|  5.78k|        {}
_ZN4crow10returnableD2Ev:
   17|  5.78k|        virtual ~returnable(){}

multipart_fuzzer.cpp:_ZN4crow7utilityL13string_equalsENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_b:
  812|  52.4M|        {
  813|  52.4M|            if (l.length() != r.length())
  ------------------
  |  Branch (813:17): [True: 14.5k, False: 52.4M]
  ------------------
  814|  14.5k|                return false;
  815|       |
  816|   117M|            for (size_t i = 0; i < l.length(); i++)
  ------------------
  |  Branch (816:32): [True: 65.2M, False: 52.4M]
  ------------------
  817|  65.2M|            {
  818|  65.2M|                if (case_sensitive)
  ------------------
  |  Branch (818:21): [True: 0, False: 65.2M]
  ------------------
  819|      0|                {
  820|      0|                    if (l[i] != r[i])
  ------------------
  |  Branch (820:25): [True: 0, False: 0]
  ------------------
  821|      0|                        return false;
  822|      0|                }
  823|  65.2M|                else
  824|  65.2M|                {
  825|  65.2M|                    if (std::toupper(static_cast<unsigned char>(l[i])) != std::toupper(static_cast<unsigned char>(r[i])))
  ------------------
  |  Branch (825:25): [True: 9.95k, False: 65.1M]
  ------------------
  826|  9.95k|                        return false;
  827|  65.2M|                }
  828|  65.2M|            }
  829|       |
  830|  52.4M|            return true;
  831|  52.4M|        }

LLVMFuzzerTestOneInput:
   38|  5.85k|{
   39|  5.85k|    FuzzedDataProvider fdp{data, size};
   40|       |
   41|  5.85k|    const std::uint8_t mode = fdp.ConsumeIntegral<std::uint8_t>();
   42|  5.85k|    const std::string boundary = (mode & 1) ? "X" : "CROW-BOUNDARY";
  ------------------
  |  Branch (42:34): [True: 5.65k, False: 200]
  ------------------
   43|  5.85k|    std::string body = bounded(fdp.ConsumeRemainingBytesAsString());
   44|       |
   45|  5.85k|    if (mode & 2)
  ------------------
  |  Branch (45:9): [True: 5.47k, False: 381]
  ------------------
   46|  5.47k|    {
   47|       |        // Structurally valid multipart framing around the fuzzed payload.
   48|  5.47k|        body = "--" + boundary + "\r\n"
   49|  5.47k|               "Content-Disposition: form-data; name=\"field\"\r\n"
   50|  5.47k|               "\r\n" + body + "\r\n"
   51|  5.47k|               "--" + boundary + "--\r\n";
   52|  5.47k|    }
   53|       |
   54|  5.85k|    crow::request req;
   55|  5.85k|    req.body = body;
   56|  5.85k|    req.add_header("Content-Type", "multipart/form-data; boundary=" + boundary);
   57|       |
   58|  5.85k|    if (mode & 4)
  ------------------
  |  Branch (58:9): [True: 5.78k, False: 71]
  ------------------
   59|  5.78k|    {
   60|  5.78k|        try
   61|  5.78k|        {
   62|  5.78k|            crow::multipart::message msg(req);
   63|  5.78k|            (void)msg.dump();
   64|  18.6k|            for (std::size_t i = 0; i < msg.parts.size(); ++i)
  ------------------
  |  Branch (64:37): [True: 12.8k, False: 5.78k]
  ------------------
   65|  12.8k|            {
   66|  12.8k|                (void)msg.dump(static_cast<int>(i));
   67|  12.8k|                (void)msg.parts[i].body.size();
   68|  12.8k|            }
   69|  5.78k|            for (const auto& entry : msg.part_map)
  ------------------
  |  Branch (69:36): [True: 12.8k, False: 5.78k]
  ------------------
   70|  12.8k|                (void)msg.get_part_by_name(entry.first).body.size();
   71|  5.78k|        }
   72|  5.78k|        catch (const std::exception&)
   73|  5.78k|        {
   74|       |            // Ill-formed multipart body: documented parser error channel.
   75|  3.70k|        }
   76|  5.78k|    }
   77|       |
   78|  5.85k|    if (mode & 8)
  ------------------
  |  Branch (78:9): [True: 5.78k, False: 69]
  ------------------
   79|  5.78k|    {
   80|  5.78k|        try
   81|  5.78k|        {
   82|  5.78k|            crow::multipart::message_view view(req);
   83|  5.78k|            (void)view.dump();
   84|  18.5k|            for (std::size_t i = 0; i < view.parts.size(); ++i)
  ------------------
  |  Branch (84:37): [True: 12.8k, False: 5.78k]
  ------------------
   85|  12.8k|                (void)view.dump(static_cast<int>(i));
   86|  5.78k|        }
   87|  5.78k|        catch (const std::exception&)
   88|  5.78k|        {
   89|       |            // Ill-formed multipart body: documented parser error channel.
   90|  3.69k|        }
   91|  5.78k|    }
   92|       |
   93|  5.85k|    return 0;
   94|  5.85k|}
multipart_fuzzer.cpp:_ZN12_GLOBAL__N_17boundedENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   29|  5.85k|    {
   30|  5.85k|        constexpr std::size_t max_body = 8192;
   31|  5.85k|        if (s.size() > max_body)
  ------------------
  |  Branch (31:13): [True: 25, False: 5.82k]
  ------------------
   32|     25|            s.resize(max_body);
   33|  5.85k|        return s;
   34|  5.85k|    }

