Re: [PATCH v8 07/11] pkt-line: add functions to read/write flush terminated packet streams
- From
Jeff King <peff@peff.net>
- Date
- Sep 27, 2016, 12:13 UTC
- Message-ID
- <20160927121336.7ftrqw2242tetcf3@sigill.intra.peff.net>
- In-Reply-To
- <AF15F1E5-4DA0-459F-84EE-EDCB5FA23EF7@gmail.com>
On Tue, Sep 27, 2016 at 02:10:50PM +0200, Lars Schneider wrote:
Show 12 quoted lines
> > That being said, why don't you just use LARGE_PACKET_MAX here? It is > > already the accepted size for feeding to packet_read(), and we know it > > has enough space to hold a NUL terminator. Yes, we may over-allocate by > > 4 bytes, but that isn't really relevant. Strbufs over-allocate anyway. > > TBH in that case I would prefer the "PKTLINE_DATA_MAXLEN+1" solution with > an additional comment explaining "+1". > > Would that be OK for you? > > I am not worried about the extra 4 bytes. I am worried that we make it harder > to see what is going on if we use LARGE_PACKET_MAX.
I guess I don't feel to strongly either way. My interest in LARGE_PACKET_MAX is mostly that this is how all the rest of the packet_read() callers behave.
-Peff