• yoav-steinberg's avatar
    Refactor config.c for generic setter interface (#9644) · 79ac5756
    yoav-steinberg authored
    
    
    This refactors all `CONFIG SET`s and conf file loading arguments go through
    the generic config handling interface.
    
    Refactoring changes:
    - All config params go through the `standardConfig` interface (some stuff which
      is only related to the config file and not the `CONFIG` command still has special
      handling for rewrite/config file parsing, `loadmodule`, for example.) .
    - Added `MULTI_ARG_CONFIG` flag for configs to signify they receive a variable
      number of arguments instead of a single argument. This is used to break up space
      separated arguments to `CONFIG SET` so the generic setter interface can pass
      multiple arguments to the setter function. When parsing the config file we also break
      up anything after the config name into multiple arguments to the setter function.
    
    Interface changes:
    - A side effect of the above interface is that the `bind` argument in the config file can
      be empty (no argument at all) this is treated the same as passing an single empty
      string argument (same as `save` already used to work).
    - Support rewrite and setting `watchdog-period` from config file (was only supported
      by the CONFIG command till now).
    - Another side effect is that the `save T X` config argument now supports multiple
      Time-Changes pairs in a single line like its `CONFIG SET` counterpart. So in the
      config file you can either do:
      ```
      save 3600 1
      save 600 10
      ```
      or do
      ```
      save 3600 1 600 10
      ```
    Co-authored-by: default avatarBjorn Svensson <bjorn.a.svensson@est.tech>
    79ac5756
debug.c 78 KB