aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/http
diff options
context:
space:
mode:
authorMauro <you@example.com>2021-06-30 07:57:22 +0000
committerMauro Sardara <msardara@cisco.com>2021-07-06 16:16:04 +0000
commit08233d44a6cfde878d7e10bca38ae935ed1c8fd5 (patch)
tree7ecc534d55bdc7e8dd15ecab084720910bcdf4d9 /libtransport/src/http
parent147ba39bed26887f5eba84757e2463ab8e370a9a (diff)
[HICN-713] Transport Library Major Refactoring 2
Co-authored-by: Luca Muscariello <muscariello@ieee.org> Co-authored-by: Michele Papalini <micpapal@cisco.com> Co-authored-by: Olivier Roques <oroques+fdio@cisco.com> Co-authored-by: Giulio Grassi <gigrassi@cisco.com> Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: I5b2c667bad66feb45abdb5effe22ed0f6c85d1c2
Diffstat (limited to 'libtransport/src/http')
-rw-r--r--libtransport/src/http/CMakeLists.txt2
-rw-r--r--libtransport/src/http/client_connection.cc23
2 files changed, 10 insertions, 15 deletions
diff --git a/libtransport/src/http/CMakeLists.txt b/libtransport/src/http/CMakeLists.txt
index 00708822d..2407faea3 100644
--- a/libtransport/src/http/CMakeLists.txt
+++ b/libtransport/src/http/CMakeLists.txt
@@ -11,8 +11,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
-
list(APPEND SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/client_connection.cc
${CMAKE_CURRENT_SOURCE_DIR}/request.cc
diff --git a/libtransport/src/http/client_connection.cc b/libtransport/src/http/client_connection.cc
index a24a821e7..b4ab7cbc3 100644
--- a/libtransport/src/http/client_connection.cc
+++ b/libtransport/src/http/client_connection.cc
@@ -13,14 +13,12 @@
* limitations under the License.
*/
+#include <glog/logging.h>
+#include <hicn/transport/core/asio_wrapper.h>
#include <hicn/transport/core/content_object.h>
#include <hicn/transport/core/interest.h>
#include <hicn/transport/http/client_connection.h>
#include <hicn/transport/utils/hash.h>
-#include <hicn/transport/utils/log.h>
-
-#include <asio.hpp>
-#include <asio/steady_timer.hpp>
#define DEFAULT_BETA 0.99
#define DEFAULT_GAMMA 0.07
@@ -77,13 +75,12 @@ class HTTPClientConnection::Implementation
success_callback_ = [this, method = std::move(method), url = std::move(url),
start = std::move(start)](std::size_t size) -> void {
auto end = std::chrono::steady_clock::now();
- TRANSPORT_LOGI(
- "%s %s [%s] duration: %llu [usec] %zu [bytes]\n",
- method_map[method].c_str(), url.c_str(), name_.str().c_str(),
- (unsigned long long)
- std::chrono::duration_cast<std::chrono::microseconds>(end - start)
- .count(),
- size);
+ LOG(INFO) << method_map[method].c_str() << " " << url.c_str() << " ["
+ << name_.str() << "] duration: "
+ << std::chrono::duration_cast<std::chrono::microseconds>(end -
+ start)
+ .count()
+ << " [usec] " << size << " [bytes]";
};
sendRequestGetReply(ipv6_first_word);
@@ -203,8 +200,8 @@ class HTTPClientConnection::Implementation
}
void readError(const std::error_code ec) noexcept override {
- TRANSPORT_LOGE("Error %s during download of %s", ec.message().c_str(),
- current_url_.c_str());
+ LOG(ERROR) << "Error " << ec.message() << " during download of "
+ << current_url_.c_str();
if (read_bytes_callback_) {
read_bytes_callback_->onError(ec);
}