]> arthur.barton.de Git - netdata.git/blobdiff - src/rrd2json.c
fixes for enabling clion debugging
[netdata.git] / src / rrd2json.c
index 62ce949734557120d66c2ce1376b6fa7d7d92d50..b2c1a05583ab535f4ed22a7164ad164e4e913c3b 100644 (file)
@@ -1158,7 +1158,7 @@ inline static void rrdr_free(RRDR *r)
     freez(r);
 }
 
-inline void rrdr_done(RRDR *r)
+static inline void rrdr_done(RRDR *r)
 {
     r->rows = r->c + 1;
     r->c = 0;
@@ -1214,13 +1214,13 @@ RRDR *rrd2rrdr(RRDSET *st, long points, long long after, long long before, int g
         absolute_period_requested = 0;
     }
 
-    // allow relative for before and after
-    if(((before < 0)?-before:before) <= (st->update_every * st->entries)) {
+    // allow relative for before and after (smaller than 3 years)
+    if(((before < 0)?-before:before) <= (3 * 365 * 86400)) {
         before = last_entry_t + before;
         absolute_period_requested = 0;
     }
 
-    if(((after < 0)?-after:after) <= (st->update_every * st->entries)) {
+    if(((after < 0)?-after:after) <= (3 * 365 * 86400)) {
         if(after == 0) after = -st->update_every;
         after = before + after;
         absolute_period_requested = 0;
@@ -1564,9 +1564,9 @@ int rrd2value(RRDSET *st, BUFFER *wb, calculated_number *n, const char *dimensio
     }
 
     if(r->result_options & RRDR_RESULT_OPTION_RELATIVE)
-        wb->options |= WB_CONTENT_NO_CACHEABLE;
+        buffer_no_cacheable(wb);
     else if(r->result_options & RRDR_RESULT_OPTION_ABSOLUTE)
-        wb->options |= WB_CONTENT_CACHEABLE;
+        buffer_cacheable(wb);
 
     options = rrdr_check_options(r, options, dimensions);
 
@@ -1592,9 +1592,9 @@ int rrd2format(RRDSET *st, BUFFER *wb, BUFFER *dimensions, uint32_t format, long
     }
 
     if(r->result_options & RRDR_RESULT_OPTION_RELATIVE)
-        wb->options |= WB_CONTENT_NO_CACHEABLE;
+        buffer_no_cacheable(wb);
     else if(r->result_options & RRDR_RESULT_OPTION_ABSOLUTE)
-        wb->options |= WB_CONTENT_CACHEABLE;
+        buffer_cacheable(wb);
 
     options = rrdr_check_options(r, options, (dimensions)?buffer_tostring(dimensions):NULL);