}
}
-static int _rs_event_status(UNUSED void *ctx, fr_time_delta_t wake_t)
+static int _rs_event_status(fr_time_delta_t wake_t, UNUSED void *uctx)
{
struct timeval wake;
};
static void fr_network_post_event(fr_event_list_t *el, fr_time_t now, void *uctx);
-static int fr_network_pre_event(void *ctx, fr_time_t wake);
+static int fr_network_pre_event(fr_time_t wake, void *uctx);
static void fr_network_socket_dead(fr_network_t *nr, fr_network_socket_t *s);
static void fr_network_read(UNUSED fr_event_list_t *el, int sockfd, UNUSED int flags, void *ctx);
static int8_t reply_cmp(void const *one, void const *two)
* work, and tell the event code to return to the main loop if
* there's work to do.
*
- * @param[in] ctx the network
* @param[in] wake the time when the event loop will wake up.
+ * @param[in] uctx the network
*/
-static int fr_network_pre_event(void *ctx, UNUSED fr_time_t wake)
+static int fr_network_pre_event(UNUSED fr_time_t wake, void *uctx)
{
- fr_network_t *nr = talloc_get_type_abort(ctx, fr_network_t);
+ fr_network_t *nr = talloc_get_type_abort(uctx, fr_network_t);
- if (fr_heap_num_elements(nr->replies) > 0) {
- return 1;
- }
+ if (fr_heap_num_elements(nr->replies) > 0) return 1;
return 0;
}
*
* This should be run ONLY in single-threaded mode!
*/
-int fr_worker_pre_event(void *uctx, UNUSED fr_time_t wake)
+int fr_worker_pre_event(UNUSED fr_time_t wake, void *uctx)
{
fr_worker_t *worker = talloc_get_type_abort(uctx, fr_worker_t);
request_t *request;
void fr_worker_debug(fr_worker_t *worker, FILE *fp) CC_HINT(nonnull);
-int fr_worker_pre_event(void *uctx, fr_time_t wake);
+int fr_worker_pre_event(fr_time_t wake, void *uctx);
void fr_worker_post_event(fr_event_list_t *el, fr_time_t now, void *uctx);
#include <freeradius-devel/server/module.h>
-int fr_worker_request_add(request_t *request, module_method_t process, void *ctx);
+int fr_worker_request_add(request_t *request, module_method_t process, void *uctx) CC_HINT(nonnull(1,2));
+
+int fr_worker_subrequest_add(request_t *request) CC_HINT(nonnull);
#ifdef __cplusplus
}
return ret;
}
-static int _loop_status(UNUSED void *ctx, fr_time_t wake)
+static int _loop_status(fr_time_t wake, UNUSED void *ctx)
{
if (wake > (NSEC / 10)) DEBUG3("Main loop waking up in %pV seconds", fr_box_time_delta(wake));
for (pre = fr_dlist_head(&el->pre_callbacks);
pre != NULL;
pre = fr_dlist_next(&el->pre_callbacks, pre)) {
- if (pre->callback(pre->uctx, wake ? *wake : 0) > 0) {
+ if (pre->callback(wake ? *wake : 0, pre->uctx) > 0) {
wake = &when;
when = 0;
}
* @param[in] now The current time.
* @param[in] uctx User ctx passed to #fr_event_list_alloc.
*/
-typedef int (*fr_event_status_cb_t)(void *uctx, fr_time_t now);
+typedef int (*fr_event_status_cb_t)(fr_time_t now, void *uctx);
/** Called when an IO event occurs on a file descriptor
*