From: Remi Gacogne Date: Fri, 7 Jul 2023 15:16:02 +0000 (+0200) Subject: dnsdist: Remove unused function in outgoing DoH X-Git-Tag: rec-5.0.0-alpha1~19^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ff1d0052bf301be5d76f3be89034d267a22e385;p=thirdparty%2Fpdns.git dnsdist: Remove unused function in outgoing DoH --- diff --git a/pdns/dnsdistdist/dnsdist-nghttp2.cc b/pdns/dnsdistdist/dnsdist-nghttp2.cc index 9b774f0ed4..0aad871208 100644 --- a/pdns/dnsdistdist/dnsdist-nghttp2.cc +++ b/pdns/dnsdistdist/dnsdist-nghttp2.cc @@ -94,7 +94,6 @@ private: uint16_t d_responseCode{0}; bool d_finished{false}; }; - void addToIOState(IOState state, FDMultiplexer::callbackfunc_t callback); void updateIO(IOState newState, FDMultiplexer::callbackfunc_t callback, bool noTTD = false); void watchForRemoteHostClosingConnection(); void handleResponse(PendingRequest&& request); @@ -512,37 +511,6 @@ void DoHConnectionToBackend::watchForRemoteHostClosingConnection() } } -void DoHConnectionToBackend::addToIOState(IOState state, FDMultiplexer::callbackfunc_t callback) -{ - struct timeval now - { - .tv_sec = 0, .tv_usec = 0 - }; - - gettimeofday(&now, nullptr); - boost::optional ttd{boost::none}; - if (state == IOState::NeedRead) { - ttd = getBackendReadTTD(now); - } - else if (isFresh() && d_firstWrite == 0) { - /* first write just after the non-blocking connect */ - ttd = getBackendConnectTTD(now); - } - else { - ttd = getBackendWriteTTD(now); - } - - auto shared = std::dynamic_pointer_cast(shared_from_this()); - if (shared) { - if (state == IOState::NeedRead) { - d_ioState->add(state, callback, shared, ttd); - } - else if (state == IOState::NeedWrite) { - d_ioState->add(state, callback, shared, ttd); - } - } -} - ssize_t DoHConnectionToBackend::send_callback(nghttp2_session* session, const uint8_t* data, size_t length, int flags, void* user_data) { DoHConnectionToBackend* conn = reinterpret_cast(user_data);