[collectd-changes] collectd, the system statistics collection daemon: Changes to 'collectd-5.6'

Florian Forster octo at verplant.org
Tue May 16 19:38:51 CEST 2017


 src/curl_json.c |  173 +++++++++++++++++++++++++++++--------------------------
 1 file changed, 90 insertions(+), 83 deletions(-)

New commits:
commit 8a2be9037587c1b80a00ddb1d7d396d1d48ec37d
Author: Florian Forster <octo at collectd.org>
Date:   Mon May 15 14:40:26 2017 +0200

    curl_json plugin: Fix array index and key handling.
    
    Previously, the "key" was loaded by calling cj_cb_map_key() from
    cj_cb_inc_array_index(). That means that the key for the previous element
    was loaded as the array index was updated for the next element, resulting
    in an off-by-one error. Also the key was not unset in time, resulting in
    two metrics with the same identifier being created.
    
    This patch fixes this with the following changes:
    
    *   cj_advance_array() (nee cj_cb_inc_array_index()) now loads the key for
        the new index position instead of the previous one.
    *   The initial "0" key is loaded from cj_cb_start_array().
    *   cj_advance_array() always updates the key. The "update_key" argument
        has been removed.
    *   Refactoring: key loading has been moved out of cj_cb_map_key() and
        into its own function, cj_load_key().
    
    Unit tests are in a separate commit for easier cherry-picking.
    
    Fixes: #2266




More information about the collectd-changes mailing list