typedef std::unordered_map<std::string, boost::variant<bool, int, std::string, std::vector<std::pair<int,int> >, std::vector<std::pair<int, std::string> >, std::map<std::string,std::string> > > localbind_t;
-static void parseLocalBindVars(boost::optional<localbind_t> vars, bool& reusePort, int& tcpFastOpenQueueSize, std::string& interface, std::set<int>& cpus, int& tcpListenQueueSize)
+static void parseLocalBindVars(boost::optional<localbind_t> vars, bool& reusePort, int& tcpFastOpenQueueSize, std::string& interface, std::set<int>& cpus, int& tcpListenQueueSize, size_t& maxInFlightQueriesPerConnection)
{
if (vars) {
if (vars->count("reusePort")) {
if (vars->count("tcpListenQueueSize")) {
tcpListenQueueSize = boost::get<int>((*vars)["tcpListenQueueSize"]);
}
+ if (vars->count("maxInFlight")) {
+ maxInFlightQueriesPerConnection = boost::get<int>((*vars)["maxInFlight"]);
+ }
if (vars->count("interface")) {
interface = boost::get<std::string>((*vars)["interface"]);
}
}
}
+ if(vars.count("maxInFlight")) {
+ ret->d_maxInFlightQueriesPerConn = std::stoi(boost::get<string>(vars["maxInFlight"]));
+ }
+
if(vars.count("name")) {
ret->setName(boost::get<string>(vars["name"]));
}
bool reusePort = false;
int tcpFastOpenQueueSize = 0;
int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
std::string interface;
std::set<int> cpus;
- parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize);
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn);
try {
ComboAddress loc(addr, 53);
if (tcpListenQueueSize > 0) {
tcpCS->tcpListenQueueSize = tcpListenQueueSize;
}
+ if (maxInFlightQueriesPerConn > 0) {
+ tcpCS->d_maxInFlightQueriesPerConn = maxInFlightQueriesPerConn;
+ }
g_frontends.push_back(std::move(tcpCS));
}
catch(const std::exception& e) {
bool reusePort = false;
int tcpFastOpenQueueSize = 0;
int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
std::string interface;
std::set<int> cpus;
- parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize);
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn);
try {
ComboAddress loc(addr, 53);
if (tcpListenQueueSize > 0) {
tcpCS->tcpListenQueueSize = tcpListenQueueSize;
}
+ if (maxInFlightQueriesPerConn > 0) {
+ tcpCS->d_maxInFlightQueriesPerConn = maxInFlightQueriesPerConn;
+ }
g_frontends.push_back(std::move(tcpCS));
}
catch(std::exception& e) {
bool reusePort = false;
int tcpFastOpenQueueSize = 0;
int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
std::string interface;
std::set<int> cpus;
std::vector<DNSCryptContext::CertKeyPaths> certKeys;
- parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize);
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn);
if (certFiles.type() == typeid(std::string) && keyFiles.type() == typeid(std::string)) {
auto certFile = boost::get<std::string>(certFiles);
bool reusePort = false;
int tcpFastOpenQueueSize = 0;
int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
std::string interface;
std::set<int> cpus;
if (vars) {
- parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize);
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn);
if (vars->count("idleTimeout")) {
frontend->d_idleTimeout = boost::get<int>((*vars)["idleTimeout"]);
bool reusePort = false;
int tcpFastOpenQueueSize = 0;
int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
std::string interface;
std::set<int> cpus;
if (vars) {
- parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize);
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn);
if (vars->count("provider")) {
frontend->d_provider = boost::get<const string>((*vars)["provider"]);
if (tcpListenQueueSize > 0) {
cs->tcpListenQueueSize = tcpListenQueueSize;
}
+ if (maxInFlightQueriesPerConn > 0) {
+ cs->d_maxInFlightQueriesPerConn = maxInFlightQueriesPerConn;
+ }
+
g_tlslocals.push_back(cs->tlsFrontend);
g_frontends.push_back(std::move(cs));
}
.. versionchanged:: 1.5.0
Added ``tcpListenQueueSize`` parameter.
+ .. versionchanged:: 1.6.0
+ Added ``maxInFlight`` parameter.
+
Add to the list of listen addresses.
:param str address: The IP Address with an optional port to listen on.
* ``interface=""``: str - Set the network interface to use.
* ``cpus={}``: table - Set the CPU affinity for this listener thread, asking the scheduler to run it on a single CPU id, or a set of CPU ids. This parameter is only available if the OS provides the pthread_setaffinity_np() function.
* ``tcpListenQueueSize=SOMAXCONN``: int - Set the size of the listen queue. Default is ``SOMAXCONN``.
+ * ``maxInFlight=0``: int - Maximum number of in-flight queries. The default is 0, which disables out-of-order processing.
.. code-block:: lua
``ciphersTLS13``, ``minTLSVersion``, ``ocspResponses``, ``preferServerCiphers``, ``keyLogFile`` options added.
.. versionchanged:: 1.5.0
``sessionTimeout`` and ``tcpListenQueueSize`` options added.
+ .. versionchanged:: 1.6.0
+ Added ``maxInFlight`` parameter.
Listen on the specified address and TCP port for incoming DNS over TLS connections, presenting the specified X.509 certificate.
* ``preferServerCiphers``: bool - Whether to prefer the order of ciphers set by the server instead of the one set by the client. Default is true, meaning that the order of the server is used. For OpenSSL >= 1.1.1, setting this option also enables the temporary re-prioritization of the ChaCha20-Poly1305 cipher if the client prioritizes it.
* ``keyLogFile``: str - Write the TLS keys in the specified file so that an external program can decrypt TLS exchanges, in the format described in https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format. Note that this feature requires OpenSSL >= 1.1.1.
* ``tcpListenQueueSize=SOMAXCONN``: int - Set the size of the listen queue. Default is ``SOMAXCONN``.
+ * ``maxInFlight=0``: int - Maximum number of in-flight queries. The default is 0, which disables out-of-order processing.
.. function:: setLocal(address[, options])
.. versionchanged:: 1.5.0
Added ``useProxyProtocol`` to server_table.
+ .. versionchanged:: 1.6.0
+ Added ``maxInFlight`` to server_table.
+
Add a new backend server. Call this function with either a string::
newServer(
disableZeroScope=BOOL, -- Disable the EDNS Client Subnet 'zero scope' feature, which does a cache lookup for an answer valid for all subnets (ECS scope of 0) before adding ECS information to the query and doing the regular lookup. This requires the ``parseECS`` option of the corresponding cache to be set to true
rise=NUM, -- Require NUM consecutive successful checks before declaring the backend up, default: 1
useProxyProtocol=BOOL, -- Add a proxy protocol header to the query, passing along the client's IP address and port along with the original destination address and port. Default is disabled.
- reconnectOnUp=BOOL -- Close and reopen the sockets when a server transits from Down to Up. This helps when an interface is missing when dnsdist is started. Default is disabled.
+ reconnectOnUp=BOOL, -- Close and reopen the sockets when a server transits from Down to Up. This helps when an interface is missing when dnsdist is started. Default is disabled.
+ maxInFlight -- Maximum number of in-flight queries. The default is 0, which disables out-of-order processing. It should only be enabled if the backend does support out-of-order processing.
})
:param str server_string: A simple IP:PORT string.