Make async hooks code use the 'recursions' array
Async hooks are the last feature using the client->fetchhandle and client->query.fetch pointers. Update ns_query_hookasync() and query_hookresume() so that they use a dedicated slot in the 'recursions' array. Note that async hooks are still not expected to initiate recursion if one was already started by a prior ns_query_recurse() call, so the REQUIRE assertion in ns_query_hookasync() needs to check the RECTYPE_NORMAL slot rather than the RECTYPE_HOOK one.
This commit is contained in:
@@ -46,6 +46,7 @@ typedef enum {
|
||||
RECTYPE_NORMAL,
|
||||
RECTYPE_PREFETCH,
|
||||
RECTYPE_RPZ,
|
||||
RECTYPE_HOOK,
|
||||
RECTYPE_COUNT,
|
||||
} ns_query_rectype_t;
|
||||
|
||||
@@ -59,6 +60,8 @@ typedef enum {
|
||||
((client)->query.recursions[RECTYPE_PREFETCH].handle)
|
||||
#define HANDLE_RECTYPE_RPZ(client) \
|
||||
((client)->query.recursions[RECTYPE_RPZ].handle)
|
||||
#define HANDLE_RECTYPE_HOOK(client) \
|
||||
((client)->query.recursions[RECTYPE_HOOK].handle)
|
||||
|
||||
/*%
|
||||
* Helper macros for accessing dns_fetch_t pointers for a specific recursion a
|
||||
@@ -70,6 +73,8 @@ typedef enum {
|
||||
((client)->query.recursions[RECTYPE_PREFETCH].fetch)
|
||||
#define FETCH_RECTYPE_RPZ(client) \
|
||||
((client)->query.recursions[RECTYPE_RPZ].fetch)
|
||||
#define FETCH_RECTYPE_HOOK(client) \
|
||||
((client)->query.recursions[RECTYPE_HOOK].fetch)
|
||||
|
||||
/*%
|
||||
* nameserver recursion parameters, to uniquely identify a recursion
|
||||
|
||||
Reference in New Issue
Block a user