h09server: Remove the processing of u and i query parameters
Remove the processing of u and i query parameters because h09server
does not support the prioritization.
@@ -107,10 +107,6 @@ std::string make_status_body(unsigned int status_code) {
struct Request {
std::string path;
- struct {
- int32_t urgency;
- int inc;
- } pri;
};
namespace {
@@ -118,9 +114,6 @@ Request request_path(const std::string_view &uri) {
http_parser_url u;
Request req;
- req.pri.urgency = -1;
- req.pri.inc = -1;
-
http_parser_url_init(&u);
if (auto rv = http_parser_parse_url(uri.data(), uri.size(),
@@ -147,48 +140,6 @@ Request request_path(const std::string_view &uri) {
req.path = "/index.html";
}
- if (u.field_set & (1 << UF_QUERY)) {
- static constexpr char urgency_prefix[] = "u=";
- static constexpr char inc_prefix[] = "i=";
- auto q = std::string(uri.data() + u.field_data[UF_QUERY].off,
- u.field_data[UF_QUERY].len);
- for (auto p = std::begin(q); p != std::end(q);) {
- if (util::istarts_with(p, std::end(q), std::begin(urgency_prefix),
- std::end(urgency_prefix) - 1)) {
- auto urgency_start = p + sizeof(urgency_prefix) - 1;
- auto urgency_end = std::find(urgency_start, std::end(q), '&');
- if (urgency_start + 1 == urgency_end && '0' <= *urgency_start &&
- *urgency_start <= '7') {
- req.pri.urgency = *urgency_start - '0';
- }
- if (urgency_end == std::end(q)) {
- break;
- }
- p = urgency_end + 1;
- continue;
- }
- if (util::istarts_with(p, std::end(q), std::begin(inc_prefix),
- std::end(inc_prefix) - 1)) {
- auto inc_start = p + sizeof(inc_prefix) - 1;
- auto inc_end = std::find(inc_start, std::end(q), '&');
- if (inc_start + 1 == inc_end &&
- (*inc_start == '0' || *inc_start == '1')) {
- req.pri.inc = *inc_start - '0';
- }
- if (inc_end == std::end(q)) {
- break;
- }
- p = inc_end + 1;
- continue;
- }
-
- p = std::find(p, std::end(q), '&');
- if (p == std::end(q)) {
- break;
- }
- ++p;
- }
- }
return req;
}
} // namespace
