so that we don't erroneously resume modules on timers, when the
modules don't expect to be resumed.
return NULL;
}
+ /*
+ * If the module isn't marked as "retry safe", then disallow retries.
+ */
+ if (mi->actions.retry.irt && ((mi->module->type & RLM_TYPE_RETRY) != 0)) {
+ cf_log_err(cs, "Cannot do retries for module \"%s\" - it does not support them", mi->name);
+ talloc_free(mi);
+ return NULL;
+ }
+
return mi;
}
//!< with mutex.
#define RLM_TYPE_RESUMABLE (1 << 2) //!< does yield / resume
+#define RLM_TYPE_RETRY (1 << 3) //!< can handle retries
+
/** Module section callback
*
* Is called when the module is listed in a particular section of a virtual
}
}
+ /*
+ * If we're retrying this section, then all modules in
+ * the section have to be marked as retry-safe.
+ *
+ * src/lib/server/module.c already checks if the default
+ * module actions are retry safe, so we don't need to
+ * check that here.
+ */
+ if (unlang_ctx->actions->retry.irt && ((inst->module->type & RLM_TYPE_RETRY) != 0)) {
+ cf_log_err(ci, "Cannot do retries for module \"%s\" - it does not support them", inst->module->name);
+ talloc_free(c);
+ return NULL;
+ }
+
return c;
}