static std::string s_quicRetryTokenKey = newKey(false);
+#ifdef HAVE_DNS_OVER_QUIC
+
+#include <quiche.h>
+
+using QuicheConnection = std::unique_ptr<quiche_conn, decltype(&quiche_conn_free)>;
+using QuicheConfig = std::unique_ptr<quiche_config, decltype(&quiche_config_free)>;
+
+class Connection
+{
+public:
+ Connection(const ComboAddress& peer, std::unique_ptr<quiche_conn, decltype(&quiche_conn_free)>&& conn) :
+ d_peer(peer), d_conn(std::move(conn))
+ {
+ }
+ Connection(const Connection&) = delete;
+ Connection(Connection&&) = default;
+ Connection& operator=(const Connection&) = delete;
+ Connection& operator=(Connection&&) = default;
+ ~Connection() = default;
+
+ ComboAddress d_peer;
+ QuicheConnection d_conn;
+};
+
+#endif
+
static void sendBackDOQUnit(DOQUnitUniquePtr&& du, const char* description);
struct DOQServerConfig
{
}
auto du = std::move(response.d_idstate.doqu);
- if (du->responseSender == nullptr) {
+ if (du->dsc == nullptr) {
return;
}
static void sendBackDOQUnit(DOQUnitUniquePtr&& du, const char* description)
{
- if (du->responseSender == nullptr) {
+ if (du->dsc == nullptr) {
return;
}
try {
- if (!du->responseSender->send(std::move(du))) {
+ if (!du->dsc->d_responseSender.send(std::move(du))) {
vinfolog("Unable to pass a %s to the DoQ worker thread because the pipe is full", description);
}
} catch (const std::exception& e) {
du->ids.protocol = dnsdist::Protocol::DoQ;
du->serverConnID = serverConnID;
du->streamID = streamID;
- du->responseSender = &dsc.d_responseSender;
processDOQQuery(std::move(du));
}
#include "stat_t.hh"
#include "dnsdist-idstate.hh"
-#ifdef HAVE_DNS_OVER_QUIC
-
-#include <quiche.h>
-
-using QuicheConnection = std::unique_ptr<quiche_conn, decltype(&quiche_conn_free)>;
-using QuicheConfig = std::unique_ptr<quiche_config, decltype(&quiche_config_free)>;
-
-class Connection
-{
-public:
- Connection(const ComboAddress& peer, std::unique_ptr<quiche_conn, decltype(&quiche_conn_free)>&& conn) :
- d_peer(peer), d_conn(std::move(conn))
- {
- }
- Connection(const Connection&) = delete;
- Connection(Connection&&) = default;
- Connection& operator=(const Connection&) = delete;
- Connection& operator=(Connection&&) = default;
- ~Connection() = default;
-
- ComboAddress d_peer;
- QuicheConnection d_conn;
-};
-
-#endif
-
struct DOQServerConfig;
struct DownstreamState;
InternalQueryState ids;
PacketBuffer query;
PacketBuffer response;
+ PacketBuffer serverConnID;
std::shared_ptr<DownstreamState> downstream{nullptr};
DOQServerConfig* dsc{nullptr};
- pdns::channel::Sender<DOQUnit>* responseSender{nullptr};
- size_t proxyProtocolPayloadSize{0};
uint64_t streamID{0};
- PacketBuffer serverConnID;
+ size_t proxyProtocolPayloadSize{0};
/* whether the query was re-sent to the backend over
TCP after receiving a truncated answer over UDP */
bool tcp{false};
- bool truncated{false};
};
using DOQUnitUniquePtr = std::unique_ptr<DOQUnit>;