From: Óscar Nájera Date: Mon, 18 Mar 2019 15:22:31 +0000 (+0100) Subject: Fix bounds in rrd_xport X-Git-Tag: v1.7.2~28 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=bdf2105ddf4a87fb5dde9f4368e22175e3897f0c;p=thirdparty%2Frrdtool-1.x.git Fix bounds in rrd_xport rrdxport needs to provide enough data points in its output for the receiving client to be able to reproduce the graphs generated by rrdgraph. - The start time pointer needs to be at the start of the interval that contain the query start time. For the function that retrieves the data. On output the returned start timestamp is > than query timestamp. - SV export was missing the end boundary --- diff --git a/src/rrd_xport.c b/src/rrd_xport.c index 22193f6b..0df0af55 100644 --- a/src/rrd_xport.c +++ b/src/rrd_xport.c @@ -358,9 +358,6 @@ static int rrd_xport_fn( free(step_list); *start = im->start - im->start % (*step); - if (im->start > *start) { - *start = *start + *step; - } *end = im->end - im->end % (*step); if (im->end > *end) { @@ -633,7 +630,7 @@ static int rrd_xport_format_sv( /* and now write the data */ rrd_value_t *ptr = data; - for (time_t ti = start + step; ti < end; ti += step) { + for (time_t ti = start + step; ti <= end; ti += step) { /* write time */ if (timefmt) { struct tm loc;