]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add unlang_signal callbacks
authorAlan T. DeKok <aland@freeradius.org>
Tue, 25 Jul 2017 19:48:49 +0000 (15:48 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 25 Jul 2017 19:53:05 +0000 (15:53 -0400)
src/modules/proto_radius/proto_radius_acct.c
src/modules/proto_radius/proto_radius_auth.c
src/modules/proto_radius/proto_radius_coa.c
src/modules/proto_radius/proto_radius_status.c

index 940856d034895a657e93359e461426778b157a0a..d287fe44ce34598965ab8856d7bc8dcb867f3c1b 100644 (file)
@@ -29,7 +29,7 @@
 #include <freeradius-devel/state.h>
 #include <freeradius-devel/rad_assert.h>
 
-static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
+static fr_io_final_t mod_process(REQUEST *request, fr_io_action_t action)
 {
        VALUE_PAIR *vp;
        rlm_rcode_t rcode;
@@ -39,6 +39,15 @@ static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
 
        VERIFY_REQUEST(request);
 
+       /*
+        *      Pass this through asynchronously to the module which
+        *      is waiting for something to happen.
+        */
+       if (action != FR_ACTION_RUN) {
+               unlang_signal(request, action);
+               return;
+       }
+
        switch (request->request_state) {
        case REQUEST_INIT:
                radlog_request(L_DBG, L_DBG_LVL_1, request, "Received %s ID %i",
index 5e036d4deabefc65fde4631da0cf7531d1b2bf1b..acda9dac9a2430401f03b89c42d813cbd29393c7 100644 (file)
@@ -115,7 +115,7 @@ static void auth_message(char const *msg, REQUEST *request, int goodpass)
                       extra);
 }
 
-static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
+static fr_io_final_t mod_process(REQUEST *request, fr_io_action_t action)
 {
        VALUE_PAIR              *vp, *auth_type;
        rlm_rcode_t             rcode;
@@ -124,6 +124,17 @@ static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
        fr_dict_attr_t const    *da = NULL;
        vp_cursor_t             cursor;
 
+       VERIFY_REQUEST(request);
+
+       /*
+        *      Pass this through asynchronously to the module which
+        *      is waiting for something to happen.
+        */
+       if (action != FR_ACTION_RUN) {
+               unlang_signal(request, action);
+               return;
+       }
+
        switch (request->request_state) {
        case REQUEST_INIT:
                radlog_request(L_DBG, L_DBG_LVL_1, request, "Received %s ID %i",
index 7e3bedb4942ea5e606d4ba48c380bc15e6fe332c..9fb84eb3b325e279ebe57a8aebd40fd31198ba57 100644 (file)
@@ -28,7 +28,7 @@
 #include <freeradius-devel/dict.h>
 #include <freeradius-devel/rad_assert.h>
 
-static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
+static fr_io_final_t mod_process(REQUEST *request, fr_io_action_t action)
 {
        VALUE_PAIR *vp;
        rlm_rcode_t rcode;
@@ -38,6 +38,15 @@ static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
 
        VERIFY_REQUEST(request);
 
+       /*
+        *      Pass this through asynchronously to the module which
+        *      is waiting for something to happen.
+        */
+       if (action != FR_ACTION_RUN) {
+               unlang_signal(request, action);
+               return;
+       }
+
        switch (request->request_state) {
        case REQUEST_INIT:
                radlog_request(L_DBG, L_DBG_LVL_1, request, "Received %s ID %i",
index 9c026937d8d2dce8c7abc653c48a3a4ec6eb36f6..238c4a3455263b0075a2d8d1af35ba398b0516fa 100644 (file)
@@ -28,7 +28,7 @@
 #include <freeradius-devel/dict.h>
 #include <freeradius-devel/rad_assert.h>
 
-static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
+static fr_io_final_t mod_process(REQUEST *request, fr_io_action_t action)
 {
        rlm_rcode_t rcode;
        CONF_SECTION *unlang;
@@ -38,6 +38,15 @@ static fr_io_final_t mod_process(REQUEST *request, UNUSED fr_io_action_t action)
 
        VERIFY_REQUEST(request);
 
+       /*
+        *      Pass this through asynchronously to the module which
+        *      is waiting for something to happen.
+        */
+       if (action != FR_ACTION_RUN) {
+               unlang_signal(request, action);
+               return;
+       }
+
        switch (request->request_state) {
        case REQUEST_INIT:
                radlog_request(L_DBG, L_DBG_LVL_1, request, "Received %s ID %i",