]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commit
src/rrd_daemon.c: fix incorrect line number reporting by rrdcached in fetch 752/head
authorMarek Schimara <Marek.Schimara@bull.net>
Mon, 24 Oct 2016 11:11:24 +0000 (13:11 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Mon, 24 Oct 2016 11:44:12 +0000 (13:44 +0200)
commita501880b0aadedc68615539ad8c3dae89b672a8f
tree0b935b477ee20103dfa003abce7a250647f743ea
parentac9bc2eca2bc44a6b5326071c942f51b4122071f
src/rrd_daemon.c: fix incorrect line number reporting by rrdcached in fetch

  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.
src/rrd_daemon.c