X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=parse.cpp;h=bec742b8897e850795d2720fc4ab79cdf27e2628;hp=c33543f3afc44b12ce1d16fa88a9616dd560b2c2;hb=58dd753c464d917dc446e2cbb4c01fd750d4eb87;hpb=5b6002ffa927ae9987d978126fa7cc30067ac1f2 diff --git a/parse.cpp b/parse.cpp index c33543f..bec742b 100644 --- a/parse.cpp +++ b/parse.cpp @@ -56,9 +56,9 @@ vector split_lines(const string &str) return ret; } -multimap extract_headers(const vector &lines, const string &log_context) +unordered_multimap extract_headers(const vector &lines, const string &log_context) { - multimap parameters; + unordered_multimap parameters; for (size_t i = 1; i < lines.size(); ++i) { size_t split = lines[i].find(":"); if (split == string::npos) { @@ -72,7 +72,7 @@ multimap extract_headers(const vector &lines, const stri // Skip any spaces after the colon. do { ++split; - } while (split < lines[i].size() && lines[i][split] == ' '); + } while (split < lines[i].size() && (lines[i][split] == ' ' || lines[i][split] == '\t')); string value(lines[i].begin() + split, lines[i].end()); @@ -100,7 +100,7 @@ RequestParseStatus wait_for_double_newline(string *existing_data, const char *ne const char *ptr = reinterpret_cast( memmem(existing_data->data() + start_at, existing_data->size() - start_at, "\r\n\r\n", 4)); - if (ptr == NULL) { + if (ptr == nullptr) { return RP_NOT_FINISHED_YET; } if (ptr != existing_data->data() + existing_data->size() - 4) {