Home GnuPG

In PhutilLogFileChannel, don't log empty messages
9f66fbd018f1Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

In PhutilLogFileChannel, don't log empty messages

Summary:
Ref T2794. The LogFile channel is used to debug another channel by sending all the messages to a logfile.

We perform empty (zero-length) reads over nonblocking channels in various reasonable situations. Currently, these get written to the logfile as empty lines. However, they are probably never useful.

Instead, only write data if it has nonzero length.

Test Plan: After this change, debugging output from the experimental Phage stuff no longer fills up the protocol logfile with tons of empty messages.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T2794

Differential Revision: https://secure.phabricator.com/D17368

Details

Provenance
epriestley <git@epriestley.com>Authored on Feb 16 2017, 2:46 PM
Parents
rPHUTIL863226f4e56c: Prevent backtracking on long JSON strings with escape codes
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUTIL9f66fbd018f1: In PhutilLogFileChannel, don't log empty messages (authored by epriestley <git@epriestley.com>).Feb 18 2017, 1:57 AM