diff options
Diffstat (limited to 'apps/higet')
-rw-r--r-- | apps/higet/CMakeLists.txt | 5 | ||||
-rw-r--r-- | apps/higet/higet.cc | 21 |
2 files changed, 19 insertions, 7 deletions
diff --git a/apps/higet/CMakeLists.txt b/apps/higet/CMakeLists.txt index 8c7188c49..747760f00 100644 --- a/apps/higet/CMakeLists.txt +++ b/apps/higet/CMakeLists.txt @@ -22,6 +22,11 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" ) +if (NOT CMAKE_BUILD_TYPE) + message(STATUS "No build type selected, default to Release") + set(CMAKE_BUILD_TYPE "Release") +endif () + list(APPEND APPS_SRC higet.cc ) diff --git a/apps/higet/higet.cc b/apps/higet/higet.cc index 7662c1a2b..fa19528f8 100644 --- a/apps/higet/higet.cc +++ b/apps/higet/higet.cc @@ -31,6 +31,7 @@ typedef struct { std::string file_name; bool print_headers; std::string producer_certificate; + std::string ipv6_first_word; } Configuration; void processResponse(Configuration &conf, @@ -90,6 +91,9 @@ void usage(char *program_name) { << std::endl; std::cerr << "-S = print server response" << std::endl; + std::cerr << "-P = first word of the ipv6 name of " + "the response" + << std::endl; std::cerr << "example:" << std::endl; std::cerr << "\t" << program_name << " -O - http://origin/index.html" << std::endl; @@ -106,11 +110,12 @@ int main(int argc, char **argv) { conf.file_name = ""; conf.print_headers = false; conf.producer_certificate = ""; + conf.ipv6_first_word = "b001"; std::string name("http://webserver/sintel/mpd"); int opt; - while ((opt = getopt(argc, argv, "O:Sc:")) != -1) { + while ((opt = getopt(argc, argv, "O:Sc:P:")) != -1) { switch (opt) { case 'O': conf.file_name = optarg; @@ -121,6 +126,9 @@ int main(int argc, char **argv) { case 'c': conf.producer_certificate = optarg; break; + case 'P': + conf.ipv6_first_word = optarg; + break; case 'h': default: usage(argv[0]); @@ -128,11 +136,10 @@ int main(int argc, char **argv) { } } - if (argv[optind] == 0) { - std::cerr << "Using default name " << name << std::endl; - } else { - name = argv[optind]; - } + name = argv[optind]; + + std::cerr << "Using name " << name << " and name first word " + << conf.ipv6_first_word << std::endl; if (conf.file_name.empty()) { conf.file_name = name.substr(1 + name.find_last_of("/")); @@ -149,7 +156,7 @@ int main(int argc, char **argv) { t1 = std::chrono::system_clock::now(); - connection.get(name, headers); + connection.get(name, headers, {}, nullptr, nullptr, conf.ipv6_first_word); processResponse(conf, connection.response()); #ifdef _WIN32 |