From 549053710b2fc2c02269d598929293edd4392698 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 1 Nov 2017 22:33:49 +0900 Subject: [PATCH] nghttpx: Refactor --- src/shrpx_downstream.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/shrpx_downstream.cc b/src/shrpx_downstream.cc index 5683dac8..bb76e812 100644 --- a/src/shrpx_downstream.cc +++ b/src/shrpx_downstream.cc @@ -308,8 +308,7 @@ StringRef Downstream::assemble_request_cookie() { size_t Downstream::count_crumble_request_cookie() { size_t n = 0; for (auto &kv : req_.fs.headers()) { - if (kv.name.size() != 6 || kv.name[5] != 'e' || - !util::streq_l("cooki", kv.name.c_str(), 5)) { + if (kv.token != http2::HD_COOKIE) { continue; } @@ -329,8 +328,7 @@ size_t Downstream::count_crumble_request_cookie() { void Downstream::crumble_request_cookie(std::vector &nva) { for (auto &kv : req_.fs.headers()) { - if (kv.name.size() != 6 || kv.name[5] != 'e' || - !util::streq_l("cooki", kv.name.c_str(), 5)) { + if (kv.token != http2::HD_COOKIE) { continue; }