Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-977

RecCore usage cleanup

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.3.1
    • Cleanup
    • None

    Description

      in RecCore.*

      int RecGetRecordInt(const char *name, RecInt * rec_int, bool lock = true);
      //-------------------------------------------------------------------------
      // RecGetRecordXXX
      //-------------------------------------------------------------------------
      int
      RecGetRecordInt(const char *name, RecInt *rec_int, bool lock)
      {
        int err;
        RecData data;
        if ((err = RecGetRecord_Xmalloc(name, RECD_INT, &data, lock)) == REC_ERR_OKAY)
          *rec_int = data.rec_int;
        return err;
      }
      

      and there is something heavy used:

      //-------------------------------------------------------------------------
      // Backwards Compatibility Items (REC_ prefix)
      //-------------------------------------------------------------------------
      #define REC_ReadConfigInt32(_var,_config_var_name) do { \
        RecInt tmp = 0; \
        RecGetRecordInt(_config_var_name, (RecInt*) &tmp); \
        _var = (int32_t)tmp; \
      } while (0)
      
      #define REC_ReadConfigInteger(_var,_config_var_name) do { \
        RecInt tmp = 0; \
        RecGetRecordInt(_config_var_name, &tmp); \
        _var = tmp; \
      } while (0)
      

      and a real case, the REC_ReadConfigInteger is renamed to IOCORE_ReadConfigInteger:

      RecInt cache_config_threads_per_disk = 12;
      #define IOCORE_ReadConfigInteger            REC_ReadConfigInteger
        IOCORE_ReadConfigInteger(cache_config_threads_per_disk, "proxy.config.cache.threads_per_disk");
      

      my question is, why it is so complex in all these renaming? why not just:

      RecGetRecordInt("proxy.config.cache.threads_per_disk", &cache_config_threads_per_disk);
      

      brief talk with Leif, we may need to cleanup the use of REC_*. make it a small task here

      Attachments

        Issue Links

          Activity

            People

              zym Zhao Yongming
              zym Zhao Yongming
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: