From 3c5236d5d46dea44562362934b89e4573ed2c82d Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Fri, 27 Oct 2023 13:39:00 -0400 Subject: [PATCH] const correctness --- include/insane_dns/util.h | 4 ++-- src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/insane_dns/util.h b/include/insane_dns/util.h index e5a664b..d016cbf 100644 --- a/include/insane_dns/util.h +++ b/include/insane_dns/util.h @@ -125,7 +125,7 @@ namespace blt * @param out buffer to write to * @param out_size size of data that was written. Make sure `out` has enough room for the packet. */ - void sendUDPMessage(const std::string& host, const unsigned char*& in, size_t in_size, blt::scoped_buffer& out, + void sendUDPMessage(const std::string& host, const unsigned char* const& in, size_t in_size, blt::scoped_buffer& out, size_t& out_size) { asio::io_context io_context; @@ -148,7 +148,7 @@ namespace blt * @param out buffer to write to * @param out_size size of data that was written. Make sure `out` has enough room for the packet. */ - void sendTCPMessage(const std::string& host, const unsigned char*& in, size_t in_size, blt::scoped_buffer& out, + void sendTCPMessage(const std::string& host, const unsigned char* const& in, size_t in_size, blt::scoped_buffer& out, size_t& out_size) { asio::io_context io_context; diff --git a/src/main.cpp b/src/main.cpp index 38f589a..7650b17 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -345,7 +345,7 @@ request_info handle_forward_request(MESSENGER messenger, const INFO& info, const // forward to google. size_t out_bytes; - auto data = input_recv_buffer.data(); + const auto* const data = input_recv_buffer.data(); messenger(DNS_SERVER_IP(), data, bytes, forward_recv_buffer, out_bytes); uint16_t num_of_answers;