]> Sergey Matveev's repositories - public-inbox.git/commit
ds: tmpio: store offsets per-buffer
authorEric Wong <e@yhbt.net>
Fri, 24 Jan 2020 09:43:51 +0000 (09:43 +0000)
committerEric Wong <e@yhbt.net>
Sat, 25 Jan 2020 19:21:36 +0000 (19:21 +0000)
commitaaf85aef560bc828b6e0fedb5a7632e8c47d7228
treea7823e8f48b86425db2892015602d54804ef2be6
parentb99e2465205a8f27801066b1e914bd4091406fa2
ds: tmpio: store offsets per-buffer

We want to be able to inject existing file handles + offsets and
even lengths into this in the future, without going through the
->getline interface[1]

We also switch to using a 64K buffer size since we can safely
discard whatever got truncated on write and full writes can help
negotiate a larger TCP window for high-latency, high-bandwidth
links.

While we're at it, make it obvious that we're using O_APPEND for
our tmpfile() interface so we can seek freely for reading while
the writer always prints to the end of the file.

[1] the getline interface for serving static files may result
    in us buffering on-FS data into another temporary file,
    which is a waste.
lib/PublicInbox/DS.pm