Skip to content

Commit

Permalink
s/FR_SIGNAL_DONE/FR_SIGNAL_CANCEL/
Browse files Browse the repository at this point in the history
the request has been cancelled, but it might not be done.
  • Loading branch information
alandekok committed Feb 8, 2018
1 parent a9336e0 commit 84ca4b3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/include/signal.h
Expand Up @@ -37,9 +37,9 @@ extern "C" {
typedef enum fr_state_signal_t { /* server action */
FR_SIGNAL_INVALID = 0,
FR_SIGNAL_RUN,
FR_SIGNAL_DONE, //!< Request is completed. If a module is signalled
FR_SIGNAL_CANCEL, //!< Request has been cancelled. If a module is signalled
///< with this, the module should stop processing
///< the request and cleanup.
///< the request and cleanup anything it's done.
FR_SIGNAL_DUP, //!< A duplicate request was received.
} fr_state_signal_t;

Expand Down
2 changes: 1 addition & 1 deletion src/main/unlang_op.c
Expand Up @@ -1047,7 +1047,7 @@ static rlm_rcode_t unlang_parallel_run(REQUEST *request, unlang_parallel_t *stat
* stopped. This tells any child modules
* to clean up timers, etc.
*/
unlang_signal(state->children[i].child, FR_SIGNAL_DONE);
unlang_signal(state->children[i].child, FR_SIGNAL_CANCEL);
TALLOC_FREE(state->children[i].child);
/* FALL-THROUGH */

Expand Down
4 changes: 2 additions & 2 deletions src/modules/proto_ldap_sync/proto_ldap_sync.c
Expand Up @@ -312,7 +312,7 @@ static void request_running(REQUEST *request, fr_state_signal_t action)
/*
* Async (in the same thread, tho) signal to be done.
*/
if (action == FR_SIGNAL_DONE) goto done;
if (action == FR_SIGNAL_CANCEL) goto done;

/*
* We ignore all other actions.
Expand Down Expand Up @@ -428,7 +428,7 @@ static void request_queued(REQUEST *request, fr_state_signal_t action)
request->process(request, action);
break;

case FR_SIGNAL_DONE:
case FR_SIGNAL_CANCEL:
(void) fr_heap_extract(request->backlog, request);
request_delete(request);
break;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/proto_tacacs/proto_tacacs.c
Expand Up @@ -159,7 +159,7 @@ static void tacacs_running(REQUEST *request, fr_state_signal_t action)
REQUEST_VERIFY(request);

switch (action) {
case FR_SIGNAL_DONE:
case FR_SIGNAL_CANCEL:
goto done;

default:
Expand Down Expand Up @@ -427,7 +427,7 @@ static void tacacs_queued(REQUEST *request, fr_state_signal_t action)
request->process(request, action);
break;

case FR_SIGNAL_DONE:
case FR_SIGNAL_CANCEL:
(void) fr_heap_extract(request->backlog, request);
request_delete(request);
break;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/rlm_delay/rlm_delay.c
Expand Up @@ -137,7 +137,7 @@ static rlm_rcode_t mod_delay_return(UNUSED REQUEST *request,
static void mod_delay_cancel(REQUEST *request, UNUSED void *instance, UNUSED void *thread, void *ctx,
fr_state_signal_t action)
{
if (action != FR_SIGNAL_DONE) return;
if (action != FR_SIGNAL_CANCEL) return;

RDEBUG2("Cancelling delay");

Expand Down Expand Up @@ -207,7 +207,7 @@ static xlat_action_t xlat_delay_resume(TALLOC_CTX *ctx, fr_cursor_t *out,
static void xlat_delay_cancel(REQUEST *request, UNUSED void *instance, UNUSED void *thread,
void *rctx, fr_state_signal_t action)
{
if (action != FR_SIGNAL_DONE) return;
if (action != FR_SIGNAL_CANCEL) return;

RDEBUG2("Cancelling delay");

Expand Down
2 changes: 1 addition & 1 deletion src/modules/rlm_radius/rlm_radius.c
Expand Up @@ -392,7 +392,7 @@ static void mod_radius_signal(REQUEST *request, void *instance, void *thread, vo
* the IO modules to do additional debugging if
* necessary.
*/
if (action == FR_SIGNAL_DONE) {
if (action == FR_SIGNAL_CANCEL) {
talloc_free(link);
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/modules/rlm_rest/io.c
Expand Up @@ -324,7 +324,7 @@ static int _rest_io_event_modify(UNUSED CURL *easy, curl_socket_t fd, int what,

/** Handle asynchronous cancellation of a request
*
* If we're signalled that the request has been cancelled (FR_SIGNAL_DONE).
* If we're signalled that the request has been cancelled (FR_SIGNAL_CANCEL).
* Cleanup any pending state and release the connection handle back into the pool.
*
* @param[in] request being cancelled.
Expand All @@ -339,7 +339,7 @@ void rest_io_module_action(REQUEST *request, void *instance, void *thread, void
rlm_rest_thread_t *t = thread;
CURLMcode ret;

if (action != FR_SIGNAL_DONE) return;
if (action != FR_SIGNAL_CANCEL) return;

RDEBUG("Forcefully cancelling pending REST request");

Expand All @@ -356,7 +356,7 @@ void rest_io_module_action(REQUEST *request, void *instance, void *thread, void

/** Handle asynchronous cancellation of a request
*
* If we're signalled that the request has been cancelled (FR_SIGNAL_DONE).
* If we're signalled that the request has been cancelled (FR_SIGNAL_CANCEL).
* Cleanup any pending state and release the connection handle back into the pool.
*
* @param[in] request being cancelled.
Expand Down

0 comments on commit 84ca4b3

Please sign in to comment.