rlm_unbound_thread_t *t; //!< Thread running this request
int done; //!< Indicator that the callback has been called
///< Negative values indicate errors.
+ bool timedout; //!< Request timedout.
fr_type_t return_type; //!< Data type to parse results into
bool has_priority; //!< Does the returned data start with a priority field
uint16_t count; //!< Number of results to return
unbound_request_t *ur = talloc_get_type_abort(uctx, unbound_request_t);
request_t *request = ur->request;
- REDEBUG("Timeout waiting for DNS resolution");
- talloc_free(ur);
+ REDEBUG("Timeout waiting for DNS resolution");;
unlang_interpret_mark_runnable(request);
+
+ ur->timedout = true;
}
/*
if (ur->ev) (void)fr_event_timer_delete(&ur->ev);
RDEBUG2("Forcefully cancelling pending unbound request");
- talloc_free(ur);
}
/*
fr_value_box_t *vb;
unbound_request_t *ur = talloc_get_type_abort(rctx, unbound_request_t);
+ /*
+ * Request timed out
+ */
+ if (ur->timedout) return XLAT_ACTION_FAIL;
+
#define RCODEERROR(_code, _message) case _code: \
REDEBUG(_message, ur->t->inst->name); \
goto error
test_fail
}
-if (&Module-Failure-Message != "dns - Nonexistent domain name") {
+# Running this on macOS produces a timeout due to the nonexistent TLD
+if ((&Module-Failure-Message != "dns - Nonexistent domain name") && (&Module-Failure-Message != "Timeout waiting for DNS resolution")) {
test_fail
}