Re: [PATCH v4 01/35] pkt-line: introduce packet_read_with_status

2018-03-13 Thread Brandon Williams
On 03/13, Jonathan Tan wrote: > On Wed, 28 Feb 2018 15:22:18 -0800 > Brandon Williams wrote: > > > + if (len < 0) { > > die("protocol error: bad line length character: %.4s", linelen); > > - if (!len) { > > + } else if (!len) { > >

Re: [PATCH v4 01/35] pkt-line: introduce packet_read_with_status

2018-03-13 Thread Jonathan Tan
On Wed, 28 Feb 2018 15:22:18 -0800 Brandon Williams wrote: > + if (len < 0) { > die("protocol error: bad line length character: %.4s", linelen); > - if (!len) { > + } else if (!len) { > packet_trace("", 4, 0); > - return

[PATCH v4 01/35] pkt-line: introduce packet_read_with_status

2018-02-28 Thread Brandon Williams
The current pkt-line API encodes the status of a pkt-line read in the length of the read content. An error is indicated with '-1', a flush with '0' (which can be confusing since a return value of '0' can also indicate an empty pkt-line), and a positive integer for the length of the read content