]> git.ipfire.org Git - thirdparty/xz.git/commit
xz: Set the --flush-timeout deadline when the first input byte arrives.
authorLasse Collin <lasse.collin@tukaani.org>
Sun, 26 Jan 2020 18:53:25 +0000 (20:53 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Sun, 26 Jan 2020 18:53:25 +0000 (20:53 +0200)
commitba76d67585f88677af9f48b48e7bdc3bb7687def
tree76acbc9d826bf86a26f1546c4c517078e69244b0
parentfd47fd62bbb1bfd13ab63869137971d8b390025f
xz: Set the --flush-timeout deadline when the first input byte arrives.

xz --flush-timeout=2000, old version:

  1. xz is started. The next flush will happen after two seconds.
  2. No input for one second.
  3. A burst of a few kilobytes of input.
  4. No input for one second.
  5. Two seconds have passed and flushing starts.

The first second counted towards the flush-timeout even though
there was no pending data. This can cause flushing to occur more
often than needed.

xz --flush-timeout=2000, after this commit:

  1. xz is started.
  2. No input for one second.
  3. A burst of a few kilobytes of input. The next flush will
     happen after two seconds counted from the time when the
     first bytes of the burst were read.
  4. No input for one second.
  5. No input for another second.
  6. Two seconds have passed and flushing starts.
src/xz/coder.c
src/xz/file_io.c
src/xz/mytime.c