From: Remi Gacogne Date: Sun, 5 Feb 2017 11:13:54 +0000 (+0100) Subject: Use `sendSizeAndMsgWithTimeout()` in Remote Logger (protobuf) X-Git-Tag: rec-4.1.0-alpha1~282^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c5702635c50fac63e9daa40f3664c073d2ecc17;p=pdns Use `sendSizeAndMsgWithTimeout()` in Remote Logger (protobuf) --- diff --git a/pdns/remote_logger.cc b/pdns/remote_logger.cc index de77e78c2..07ab13e13 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