Commit b37716ab authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

h2load: Workaround with clang-3.4

parent 5dc060c1
...@@ -899,14 +899,12 @@ int client_select_next_proto_cb(SSL *ssl, unsigned char **out, ...@@ -899,14 +899,12 @@ int client_select_next_proto_cb(SSL *ssl, unsigned char **out,
} // namespace } // namespace
namespace { namespace {
template <typename Iterator> // Use std::vector<std::string>::iterator explicitly, without that,
std::vector<std::string> parse_uris(Iterator first, Iterator last) { // http_parser_url u{} fails with clang-3.4.
std::vector<std::string> parse_uris(std::vector<std::string>::iterator first,
std::vector<std::string>::iterator last) {
std::vector<std::string> reqlines; std::vector<std::string> reqlines;
// First URI is treated specially. We use scheme, host and port of
// this URI and ignore those in the remaining URIs if present.
http_parser_url u{};
if (first == last) { if (first == last) {
std::cerr << "no URI available" << std::endl; std::cerr << "no URI available" << std::endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
...@@ -915,6 +913,9 @@ std::vector<std::string> parse_uris(Iterator first, Iterator last) { ...@@ -915,6 +913,9 @@ std::vector<std::string> parse_uris(Iterator first, Iterator last) {
auto uri = (*first).c_str(); auto uri = (*first).c_str();
++first; ++first;
// First URI is treated specially. We use scheme, host and port of
// this URI and ignore those in the remaining URIs if present.
http_parser_url u{};
if (http_parser_parse_url(uri, strlen(uri), 0, &u) != 0 || if (http_parser_parse_url(uri, strlen(uri), 0, &u) != 0 ||
!util::has_uri_field(u, UF_SCHEMA) || !util::has_uri_field(u, UF_HOST)) { !util::has_uri_field(u, UF_SCHEMA) || !util::has_uri_field(u, UF_HOST)) {
std::cerr << "invalid URI: " << uri << std::endl; std::cerr << "invalid URI: " << uri << std::endl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment