]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove "flatten" migration flags
authorAlan T. DeKok <aland@freeradius.org>
Wed, 13 Sep 2023 22:40:11 +0000 (18:40 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 13 Sep 2023 22:40:11 +0000 (18:40 -0400)
raddb/radiusd.conf.in
src/bin/radiusd.c
src/lib/io/worker.c
src/lib/io/worker.h
src/lib/server/main_config.c
src/lib/server/main_config.h

index fc706f97284b92d5a3b259a94fb14578c43ae09e..71f03be20919f876618521b340180ed0aba90b18 100644 (file)
@@ -597,40 +597,6 @@ global {
 #  `-S flag=value`.
 #
 migrate {
-       #
-       #  flatten_after_decode:: Convert "nested" attribute lists to
-       #  "flat" ones after the protocol decoders have run, but
-       #  before any `unlang` policies are used.
-       #
-       flatten_after_decode = yes
-
-       #
-       #  flatten_before_encode:: Convert "nested" attribute lists to
-       #  "flat" ones before calling the protocol encoders.
-       #
-       flatten_before_encode = yes
-
-       #
-       #  unflatten_after_decode:: Convert "flat" attribute lists to
-       #  "nested" ones after the protocol decoders have run, but
-       #  before any `unlang` policies are used.
-       #
-       #  Some protocol decoders still produce "flat" attribute
-       #  lists.  This is in large part because many of the core
-       #  modules still expect to see "flat" lists.
-       #
-       unflatten_after_decode = no
-
-       #
-       #  unflatten_before_encode:: Convert "flat" attribute lists to
-       #  "nested" ones before calling the protocol encoders.
-       #
-       #  All of the protocol encoders currently handle flat or
-       #  nested attributes.  This flag should be forced to `true`,
-       #  and the "flat" code removed from the protocol encoders.
-       #
-       unflatten_before_encode = false
-
        #
        #  tmpl_tokenize_all_nested:: Create all internal "tmpl" data
        #  structures as using nested structures instead of flat ones.
index e482826eb2464fd4eb8b8a2bc998a36d8d00cf35..c7f2f085576238d2cda80d58de7e506216a74d17 100644 (file)
@@ -844,10 +844,6 @@ int main(int argc, char *argv[])
 #define COPY(_x) schedule->worker._x = config->_x
                COPY(max_requests);
                COPY(max_request_time);
-               COPY(unflatten_after_decode);
-               COPY(unflatten_before_encode);
-               COPY(flatten_after_decode);
-               COPY(flatten_before_encode);
 
                /*
                 *      Single server mode: use the global event list.
index 8db41e13f0b49cd89e4f97e60a43a24e571ab73b..230d465df10caef1521364cae1359e539536b31e 100644 (file)
@@ -670,13 +670,6 @@ static void worker_send_reply(fr_worker_t *worker, request_t *request, bool send
                ssize_t slen = 0;
                fr_listen_t const *listen = request->async->listen;
 
-               if (worker->config.unflatten_before_encode) {
-                       fr_pair_unflatten(request->pair_list.reply);
-
-               } else if (worker->config.flatten_before_encode) {
-                       fr_pair_flatten(request->pair_list.reply);
-               }
-
                if (listen->app_io->encode) {
                        slen = listen->app_io->encode(listen->app_io_instance, request,
                                                      reply->m.data, reply->m.rb_size);
@@ -857,13 +850,6 @@ nak:
                return;
        }
 
-       if (worker->config.unflatten_after_decode) {
-               fr_pair_unflatten(request->pair_list.request);
-
-       } else if (worker->config.flatten_after_decode) {
-               fr_pair_flatten(request->pair_list.request);
-       }
-
        /*
         *      Set the entry point for this virtual server.
         */
index 8eee4da464487cc5a2543a01ada4e64df5ab0d19..fb138f84a4068ba2ddc45f1acbf97afa8d06bf2d 100644 (file)
@@ -65,12 +65,6 @@ typedef struct {
 
        fr_time_delta_t max_request_time;       //!< maximum time a request can be processed
 
-       bool            unflatten_after_decode;  //!< the worker will call "unflatten" after protocol decoding
-       bool            unflatten_before_encode; //!< the worker will call "unflatten" before all encoding
-
-       bool            flatten_after_decode;    //!< the worker will call "flatten" after protocol decoding
-       bool            flatten_before_encode;   //!< the worker will call "flatten" before all encoding
-
        size_t          talloc_pool_size;       //!< for each request
 } fr_worker_config_t;
 
index eafc60bce604cad77621ad43eb1a770b30bfbe8c..3712556b81f164b0e0f07c4c6d2523458f04565f 100644 (file)
@@ -188,10 +188,6 @@ static const CONF_PARSER thread_config[] = {
  *     Migration configuration.
  */
 static const CONF_PARSER migrate_config[] = {
-       { FR_CONF_OFFSET("unflatten_after_decode", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, unflatten_after_decode) },
-       { FR_CONF_OFFSET("unflatten_before_encode", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, unflatten_before_encode) },
-       { FR_CONF_OFFSET("flatten_after_decode", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, flatten_after_decode), .dflt = "yes" },
-       { FR_CONF_OFFSET("flatten_before_encode", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, flatten_before_encode), .dflt = "yes" },
        { FR_CONF_OFFSET("tmpl_tokenize_all_nested", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, tmpl_tokenize_all_nested) },
        { FR_CONF_OFFSET("rewrite_update", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, rewrite_update) },
        { FR_CONF_OFFSET("forbid_update", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, forbid_update) },
@@ -1261,24 +1257,6 @@ do {\
                goto failure;
        }
 
-       /*
-        *      Handle migration.
-        *
-        *      If all of the tmpls are tokenized as nested, then we
-        *      MUST use the new conditions.  The old conditions can't
-        *      handle nested attributes.
-        *
-        *      Similarly, we MUST NOT flatten the attributes after
-        *      decoding, or before encoding.  The code should handle everything correctly.
-        */
-       if (config->tmpl_tokenize_all_nested) {
-               config->flatten_after_decode = false;
-               config->flatten_before_encode = false;
-
-               config->unflatten_after_decode = false;
-               config->unflatten_before_encode = false;
-       }
-
        /*
         *      If there was no log destination set on the command line,
         *      set it now.
index b579936c9a899c863d78b672ea53404f7d8f6abd..791ea6987a80b82a195cfeca8d862057068af806 100644 (file)
@@ -159,10 +159,6 @@ struct main_config_s {
        /*
         *      Migration tools
         */
-       bool            unflatten_after_decode;         //!< the worker will call "unflatten" after protocol decoding
-       bool            unflatten_before_encode;        //!< the worker will call "unflatten" before all encoding
-       bool            flatten_after_decode;           //!< the worker will call "flatten" after protocol decoding
-       bool            flatten_before_encode;          //!< the worker will call "flatten" before all encoding
        bool            tmpl_tokenize_all_nested;       //!< tmpl_tokenize will create nested tmpls instead of flat ones
        bool            rewrite_update;                 //!< rewrite "update" to be new edit sections
        bool            forbid_update;                  //!< forbid "update" sections