From: Florian Forster Date: Fri, 5 Oct 2007 14:09:11 +0000 (+0200) Subject: Merge branch 'collectd-4.1' X-Git-Tag: collectd-4.2.0~46 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=44b7ae5761481f8853c70ececd46437c6d0d8c9e;p=collectd.git Merge branch 'collectd-4.1' --- 44b7ae5761481f8853c70ececd46437c6d0d8c9e diff --cc src/snmp.c index a10509da,4bcdcf7d..8673df19 --- a/src/snmp.c +++ b/src/snmp.c @@@ -928,31 -725,15 +925,31 @@@ static int csnmp_dispatch_table (host_d vl.host[sizeof (vl.host) - 1] = '\0'; strcpy (vl.plugin, "snmp"); - vl.interval = host->skip_num; + vl.interval = host->interval; vl.time = time (NULL); - for (instance_list_ptr = instance_list; - instance_list_ptr != NULL; - instance_list_ptr = instance_list_ptr->next) + subid = 0; + have_more = 1; + + while (have_more != 0) { - strncpy (vl.type_instance, instance_list_ptr->instance, sizeof (vl.type_instance)); - vl.type_instance[sizeof (vl.type_instance) - 1] = '\0'; + if (instance_list != NULL) + { + while ((instance_list_ptr != NULL) + && (instance_list_ptr->subid < subid)) + instance_list_ptr = instance_list_ptr->next; + + if (instance_list_ptr == NULL) + { + have_more = 0; + continue; + } + else if (instance_list_ptr->subid > subid) + { + subid = instance_list_ptr->subid; + continue; + } + } /* if (instance_list != NULL) */ for (i = 0; i < data->values_len; i++) {