From 08233d44a6cfde878d7e10bca38ae935ed1c8fd5 Mon Sep 17 00:00:00 2001 From: Mauro Date: Wed, 30 Jun 2021 07:57:22 +0000 Subject: [HICN-713] Transport Library Major Refactoring 2 Co-authored-by: Luca Muscariello Co-authored-by: Michele Papalini Co-authored-by: Olivier Roques Co-authored-by: Giulio Grassi Signed-off-by: Mauro Sardara Change-Id: I5b2c667bad66feb45abdb5effe22ed0f6c85d1c2 --- libtransport/src/http/CMakeLists.txt | 2 -- libtransport/src/http/client_connection.cc | 23 ++++++++++------------- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'libtransport/src/http') 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 +#include #include #include #include #include -#include - -#include -#include #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(end - start) - .count(), - size); + LOG(INFO) << method_map[method].c_str() << " " << url.c_str() << " [" + << name_.str() << "] duration: " + << std::chrono::duration_cast(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); } -- cgit 1.2.3-korg