aboutsummaryrefslogtreecommitdiffstats
path: root/apps/higet
diff options
context:
space:
mode:
Diffstat (limited to 'apps/higet')
-rw-r--r--apps/higet/CMakeLists.txt6
-rw-r--r--apps/higet/higet.cc37
2 files changed, 21 insertions, 22 deletions
diff --git a/apps/higet/CMakeLists.txt b/apps/higet/CMakeLists.txt
index f4d2d4ec4..791191872 100644
--- a/apps/higet/CMakeLists.txt
+++ b/apps/higet/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2021-2022 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -49,7 +49,9 @@ if (NOT DISABLE_EXECUTABLES)
${CMAKE_THREAD_LIBS_INIT}
${WSOCK32_LIBRARY}
${WS2_32_LIBRARY}
- DEPENDS ${LIBTRANSPORT_LIBRARIES}
+ INCLUDE_DIRS
+ PRIVATE ${THIRD_PARTY_INCLUDE_DIRS} ${COMMON_INCLUDE_DIRS}
+ DEPENDS ${LIBTRANSPORT_LIBRARIES} ${THIRD_PARTY_DEPENDENCIES}
COMPONENT ${HICN_APPS}
DEFINITIONS ${COMPILER_DEFINITIONS}
LINK_FLAGS ${LINK_FLAGS}
diff --git a/apps/higet/higet.cc b/apps/higet/higet.cc
index d72d7d74f..c86f05f12 100644
--- a/apps/higet/higet.cc
+++ b/apps/higet/higet.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Cisco and/or its affiliates.
+ * Copyright (c) 2021-2022 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -13,6 +13,7 @@
* limitations under the License.
*/
+#include <hicn/apps/utils/logger.h>
#include <hicn/transport/http/client_connection.h>
#include <hicn/transport/utils/chrono_typedefs.h>
@@ -172,7 +173,7 @@ class ReadBytesCallbackImplementation
}
print_bar(100, 100, true);
- std::cout << "\nDownloaded " << bytes << " bytes" << std::endl;
+ LoggerInfo() << "\nDownloaded " << bytes << " bytes";
}
work_.reset();
});
@@ -216,8 +217,7 @@ class ReadBytesCallbackImplementation
}
}
if (last) {
- std::cout << "] " << int(progress * 100.0) << " %" << std::endl
- << std::endl;
+ std::cout << "] " << int(progress * 100.0) << " %";
} else {
std::cout << "] " << int(progress * 100.0) << " %\r";
std::cout.flush();
@@ -250,20 +250,17 @@ long checkFileStatus(std::string file_name) {
}
void usage(char *program_name) {
- std::cerr << "usage:" << std::endl;
- std::cerr << program_name << " [option]... [url]..." << std::endl;
- std::cerr << program_name << " options:" << std::endl;
- std::cerr
- << "-O <out_put_path> = write documents to <out_put_file>"
- << 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;
+ LoggerInfo() << "usage:";
+ LoggerInfo() << program_name << " [option]... [url]...";
+ LoggerInfo() << program_name << " options:";
+ LoggerInfo()
+ << "-O <out_put_path> = write documents to <out_put_file>";
+ LoggerInfo() << "-S = print server response";
+ LoggerInfo()
+ << "-P = first word of the ipv6 name of "
+ "the response";
+ LoggerInfo() << "example:";
+ LoggerInfo() << "\t" << program_name << " -O - http://origin/index.html";
exit(EXIT_FAILURE);
}
@@ -308,8 +305,8 @@ int main(int argc, char **argv) {
}
name = argv[optind];
- std::cerr << "Using name " << name << " and name first word "
- << conf.ipv6_first_word << std::endl;
+ LoggerInfo() << "Using name " << name << " and name first word "
+ << conf.ipv6_first_word;
if (conf.file_name.empty()) {
conf.file_name = name.substr(1 + name.find_last_of("/"));