Re: [WIP 01/15] pkt-line: introduce packet_read_with_status

2017-12-08 Thread Brandon Williams
On 12/07, Stefan Beller wrote: > On Mon, Dec 4, 2017 at 3:58 PM, Brandon Williams wrote: > > > diff --git a/pkt-line.h b/pkt-line.h > > index 3dad583e2..f1545929b 100644 > > --- a/pkt-line.h > > +++ b/pkt-line.h > > @@ -60,8 +60,16 @@ int write_packetized_from_buf(const char

Re: [WIP 01/15] pkt-line: introduce packet_read_with_status

2017-12-07 Thread Stefan Beller
On Mon, Dec 4, 2017 at 3:58 PM, Brandon Williams wrote: > diff --git a/pkt-line.h b/pkt-line.h > index 3dad583e2..f1545929b 100644 > --- a/pkt-line.h > +++ b/pkt-line.h > @@ -60,8 +60,16 @@ int write_packetized_from_buf(const char *src_in, size_t > len, int fd_out); > * If

[WIP 01/15] pkt-line: introduce packet_read_with_status

2017-12-04 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