diff --git a/src/h2load.cc b/src/h2load.cc index cba7cc00..e3dfbcde 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -833,7 +833,7 @@ int main(int argc, char **argv) // Note that there is no processing currently to handle multiple // message-header fields with the same field name config.custom_headers.emplace_back(header, value); - util::inp_strlower(config.custom_headers.back().first); + util::inp_strlower(config.custom_headers.back().name); break; } case 'i': { @@ -982,18 +982,18 @@ int main(int argc, char **argv) }; for(auto& kv : config.custom_headers) { - if(std::find(std::begin(override_hdrs), std::end(override_hdrs), kv.first) + if(std::find(std::begin(override_hdrs), std::end(override_hdrs), kv.name) != std::end(override_hdrs)) { // override header for(auto& nv : shared_nva) { - if((nv.name == ":authority" && kv.first == ":host") - || (nv.name == kv.first) ) { - nv.value = kv.second; + if((nv.name == ":authority" && kv.name == ":host") + || (nv.name == kv.name) ) { + nv.value = kv.value; } } } else { // add additional headers - shared_nva.emplace_back(kv.first, kv.second); + shared_nva.push_back(kv); } } diff --git a/src/h2load.h b/src/h2load.h index 57b1db86..15e44d0b 100644 --- a/src/h2load.h +++ b/src/h2load.h @@ -43,6 +43,8 @@ #include +#include "http2.h" + namespace h2load { class Session; @@ -50,7 +52,7 @@ class Session; struct Config { std::vector> nva; std::vector> nv; - std::vector> custom_headers; + nghttp2::Headers custom_headers; std::string scheme; std::string host; std::string ifile;