]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Added "one shot" configuration
authorAlan T. DeKok <aland@freeradius.org>
Wed, 29 Dec 2010 07:34:37 +0000 (08:34 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 29 Dec 2010 07:34:37 +0000 (08:34 +0100)
src/include/detail.h
src/main/detail.c

index e3c13eef6e371763a93875393734c4f8ff5bdcff..82c33ac17f446583472d4f474721d5f7e3fd3adf 100644 (file)
@@ -43,6 +43,7 @@ typedef struct listen_detail_t {
        int             retry_interval;
        int             packets;
        int             tries;
+       int             one_shot;
 
        int             has_rtt;
        int             srtt;
index f94961e64dfcc1cb8c917d4f3045630e95219811..993c9831f500058c76e98c62c5a45317193da52f 100644 (file)
@@ -399,6 +399,12 @@ int detail_recv(rad_listen_t *listener,
                                listener->fd = -1;
                                data->state = STATE_UNOPENED;
                                rad_assert(data->vps == NULL);
+
+                               if (data->one_shot) {
+                                       radlog(L_INFO, "Finished reading \"one shot\" detail file - Exiting");
+                                       radius_signal_self(RADIUS_SIGNAL_SELF_EXIT);
+                               }
+
                                return 0;
                        }
 
@@ -832,6 +838,8 @@ static const CONF_PARSER detail_config[] = {
          offsetof(listen_detail_t, poll_interval), NULL, Stringify(1)},
        { "retry_interval",   PW_TYPE_INTEGER,
          offsetof(listen_detail_t, retry_interval), NULL, Stringify(30)},
+       { "one_shot",   PW_TYPE_BOOLEAN,
+         offsetof(listen_detail_t, one_shot), NULL, NULL},
 
        { NULL, -1, 0, NULL, NULL }             /* end the list */
 };