summaryrefslogtreecommitdiffstats
path: root/dnsdist-tcp.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:28:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:28:35 +0000
commit94747970b5724254236b51cd41b77893785c7af6 (patch)
tree593ed52e2978ddf5ffe91ed81111e73d57807d30 /dnsdist-tcp.cc
parentAdding debian version 1.9.4-1. (diff)
downloaddnsdist-94747970b5724254236b51cd41b77893785c7af6.tar.xz
dnsdist-94747970b5724254236b51cd41b77893785c7af6.zip
Merging upstream version 1.9.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dnsdist-tcp.cc')
-rw-r--r--dnsdist-tcp.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/dnsdist-tcp.cc b/dnsdist-tcp.cc
index e3eb68e..3db77ae 100644
--- a/dnsdist-tcp.cc
+++ b/dnsdist-tcp.cc
@@ -170,7 +170,7 @@ void TCPClientCollection::addTCPClientThread(std::vector<ClientState*>& tcpAccep
++d_numthreads;
}
catch (const std::exception& e) {
- errlog("Error creating TCP worker: %", e.what());
+ errlog("Error creating TCP worker: %s", e.what());
}
}
@@ -195,7 +195,7 @@ static IOState sendQueuedResponses(std::shared_ptr<IncomingTCPConnectionState>&
return IOState::Done;
}
-void IncomingTCPConnectionState::handleResponseSent(TCPResponse& currentResponse)
+void IncomingTCPConnectionState::handleResponseSent(TCPResponse& currentResponse, size_t sentBytes)
{
if (currentResponse.d_idstate.qtype == QType::AXFR || currentResponse.d_idstate.qtype == QType::IXFR) {
return;
@@ -207,7 +207,7 @@ void IncomingTCPConnectionState::handleResponseSent(TCPResponse& currentResponse
if (!currentResponse.d_idstate.selfGenerated && backend) {
const auto& ids = currentResponse.d_idstate;
double udiff = ids.queryRealTime.udiff();
- vinfolog("Got answer from %s, relayed to %s (%s, %d bytes), took %f us", backend->d_config.remote.toStringWithPort(), ids.origRemote.toStringWithPort(), getProtocol().toString(), currentResponse.d_buffer.size(), udiff);
+ vinfolog("Got answer from %s, relayed to %s (%s, %d bytes), took %f us", backend->d_config.remote.toStringWithPort(), ids.origRemote.toStringWithPort(), getProtocol().toString(), sentBytes, udiff);
auto backendProtocol = backend->getProtocol();
if (backendProtocol == dnsdist::Protocol::DoUDP && !currentResponse.d_idstate.forwardedOverUDP) {
@@ -315,7 +315,7 @@ IOState IncomingTCPConnectionState::sendResponse(const struct timeval& now, TCPR
auto iostate = d_handler.tryWrite(d_currentResponse.d_buffer, d_currentPos, d_currentResponse.d_buffer.size());
if (iostate == IOState::Done) {
DEBUGLOG("response sent from " << __PRETTY_FUNCTION__);
- handleResponseSent(d_currentResponse);
+ handleResponseSent(d_currentResponse, d_currentResponse.d_buffer.size());
return iostate;
}
d_lastIOBlocked = true;
@@ -1120,7 +1120,7 @@ void IncomingTCPConnectionState::handleIO()
iostate = d_handler.tryWrite(d_currentResponse.d_buffer, d_currentPos, d_currentResponse.d_buffer.size());
if (iostate == IOState::Done) {
DEBUGLOG("response sent from " << __PRETTY_FUNCTION__);
- handleResponseSent(d_currentResponse);
+ handleResponseSent(d_currentResponse, d_currentResponse.d_buffer.size());
d_state = State::idle;
}
else {