nghttpx: Refactor

This commit is contained in:
Tatsuhiro Tsujikawa 2017-11-01 22:33:49 +09:00
parent e29b9c1261
commit 549053710b
1 changed files with 2 additions and 4 deletions

View File

@ -308,8 +308,7 @@ StringRef Downstream::assemble_request_cookie() {
size_t Downstream::count_crumble_request_cookie() { size_t Downstream::count_crumble_request_cookie() {
size_t n = 0; size_t n = 0;
for (auto &kv : req_.fs.headers()) { for (auto &kv : req_.fs.headers()) {
if (kv.name.size() != 6 || kv.name[5] != 'e' || if (kv.token != http2::HD_COOKIE) {
!util::streq_l("cooki", kv.name.c_str(), 5)) {
continue; continue;
} }
@ -329,8 +328,7 @@ size_t Downstream::count_crumble_request_cookie() {
void Downstream::crumble_request_cookie(std::vector<nghttp2_nv> &nva) { void Downstream::crumble_request_cookie(std::vector<nghttp2_nv> &nva) {
for (auto &kv : req_.fs.headers()) { for (auto &kv : req_.fs.headers()) {
if (kv.name.size() != 6 || kv.name[5] != 'e' || if (kv.token != http2::HD_COOKIE) {
!util::streq_l("cooki", kv.name.c_str(), 5)) {
continue; continue;
} }