]> Sergey Matveev's repositories - public-inbox.git/commit
lei: fix output race in client/daemon mode
authorEric Wong <e@80x24.org>
Sun, 3 Jan 2021 11:24:51 +0000 (11:24 +0000)
committerEric Wong <e@80x24.org>
Sun, 3 Jan 2021 18:24:09 +0000 (18:24 +0000)
commit8ee251fcd420533c7b69f40c18f3536bcc30abaf
tree5de03f71a81452330b8fc0e308fe8bec77e2946c
parentb156cb4ef176b41131154a6d7632aed92b143fa0
lei: fix output race in client/daemon mode

The daemon needs to flush stdout before disconnecting or killing
clients, otherwise they may reread empty data on redirected
outputs.  We also don't want to unbuffer stdout too early in
case we have lots of small chunks of data to output.

The received ($self->{2}) will always have autoflush, matching normal
STDERR behavior.
lib/PublicInbox/LEI.pm