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

dynamic update for string vars does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.2.0
    • 3.3.2
    • Configuration
    • None

    Description

      i noticed that when i try to do a dynamic update of the scheme in congestion control it doesn't appear to work:
      registerd callback: CongestionControlDefaultSchemeChanged

      this function gets called back correctly when the var:
      CONFIG proxy.config.http.congestion_control.default.congestion_scheme STRING per_host

      is updated and 'traffic_line -x' is called..
      however the var returned via r->data (record data) or DEFAULT_congestion_scheme_str has not been updated unlike for its integer config counterparts -
      Th r->data has been overwritten with rubbish - in fact tracing it back i see

      P_RecCore.i calls
      for (cur_callback = r->config_meta.update_cb_list; cur_callback; cur_callback = cur_callback->next) {
      (*(cur_callback->update_cb)) (r->name, r->data_type, r->data, cur_callback->update_cookie);

      this then calls before the callback function (r->data is correct at this point) a function called 'link_string_alloc' which has been registered via this function for all strings in general:
      CC_EstablishStaticConfigStringAlloc(DEFAULT_congestion_scheme_str, "proxy.config.http.congestion_control.default.congestion_scheme");

      The link_string_alloc overwrites the string with the passed in cookie var which has rubbish - this function looks completely wrong -

      i have commented it out updated string in r->data doesn't get overwritten and so is passed through ok -

      ***could anyone explain what link_string alloc is actually needed for and does removing this lead to a memory leak?

      Attachments

        1. string_alloc.patch.txt
          2 kB
          Aidan McGurn

        Activity

          People

            jamespeach James Peach
            amcgurn Aidan McGurn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: