auto query = dnsdist::getInternalQueryFromDQ(dr, false);
return dnsdist::queueQueryResumptionEvent(std::move(query));
});
+
+ luaCtx.registerMember<const ComboAddress (DNSResponse::*)>("selectedBackend",
+ []( const DNSResponse& dr) -> const ComboAddress {
+ if (dr.d_downstream == nullptr) {
+ return ComboAddress();
+ } else {
+ return dr.d_downstream->d_config.remote;
+ }
+ },
+ [](DNSResponse& dr, const ComboAddress newSelectedBackend) { (void) newSelectedBackend; }
+ );
#endif /* DISABLE_NON_FFI_DQ_BINDINGS */
}
- ``useECS``
If the value is really needed while the response is being processed, it is possible to set a tag while the query is processed, as tags will be passed to the response object.
- It also has one additional method:
+ The DNSResponse object has one additional attribute:
+
+ .. attribute:: DNSResponse.selectedBackend
+
+ .. versionadded:: 1.9.0
+
+ :ref:`ComboAddress` of the selected backend.
+
+ It also has additional methods:
.. method:: DNSResponse:editTTLs(func)