Example of error:
rrdtool fetch --daemon 127.0.0.1:42218 <path to>.rrd --start -5min LAST
ERROR: rrdc_fetch: Got 34 lines, expected 37
While the same, without '--daemon <address>' works fine.
The bug manifests itself when the last element of line to write falls
within the last 10% of the length of 'char linebuf[1024]', ie between
922 and 1023 bytes; in that case the '\n' at the end of the line is
not written, and so not seen by count_lines(), wrong number of lines
given in the daemon's response -> 'rrdtool fetch' errors out.
linebuf_fill = 0;
}
}
- if (linebuf_fill>0) {
+
+ /* only print out a line if parsed something */
+ if (i > 0) {
add_response_info (sock, "%s\n", linebuf);
}
} /* for (t) */