From 2c5702635c50fac63e9daa40f3664c073d2ecc17 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Sun, 5 Feb 2017 12:13:54 +0100 Subject: [PATCH] Use `sendSizeAndMsgWithTimeout()` in Remote Logger (protobuf) --- pdns/remote_logger.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pdns/remote_logger.cc b/pdns/remote_logger.cc index de77e78c2e..07ab13e133 100644 --- a/pdns/remote_logger.cc +++ b/pdns/remote_logger.cc @@ -49,10 +49,8 @@ void RemoteLogger::worker() } try { - uint16_t len = data.length(); - len = htons(len); - writen2WithTimeout(d_socket, &len, sizeof(len), (int) d_timeout); - writen2WithTimeout(d_socket, data.c_str(), data.length(), (int) d_timeout); + uint16_t len = static_cast(data.length()); + sendSizeAndMsgWithTimeout(d_socket, len, data.c_str(), static_cast(d_timeout), nullptr, nullptr, 0, 0, 0); } catch(const std::runtime_error& e) { #ifdef WE_ARE_RECURSOR -- 2.47.2