From b37716ab6af4dc69d483ebd4c81860ac8259481d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 19 Jul 2015 18:35:14 +0900 Subject: [PATCH] h2load: Workaround with clang-3.4 --- src/h2load.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index 32763a0a..ba57e251 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -899,14 +899,12 @@ int client_select_next_proto_cb(SSL *ssl, unsigned char **out, } // namespace namespace { -template -std::vector parse_uris(Iterator first, Iterator last) { +// Use std::vector::iterator explicitly, without that, +// http_parser_url u{} fails with clang-3.4. +std::vector parse_uris(std::vector::iterator first, + std::vector::iterator last) { std::vector 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) { std::cerr << "no URI available" << std::endl; exit(EXIT_FAILURE); @@ -915,6 +913,9 @@ std::vector parse_uris(Iterator first, Iterator last) { auto uri = (*first).c_str(); ++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 || !util::has_uri_field(u, UF_SCHEMA) || !util::has_uri_field(u, UF_HOST)) { std::cerr << "invalid URI: " << uri << std::endl;