Re: [PATCHv2 04/10] pkt-line: change error message for oversized packet
- From
Jeff King <peff@peff.net>
- Date
- Feb 18, 2013, 21:33 UTC
- Message-ID
- <20130218213331.GA29200@sigill.intra.peff.net>
- In-Reply-To
- <7v1ucdb9gw.fsf@alter.siamese.dyndns.org>
On Mon, Feb 18, 2013 at 01:25:35PM -0800, Junio C Hamano wrote:
Show 6 quoted lines
> Jeff King <peff@peff.net> writes: > > > But it's easy to do (1), and it starts the clock ticking for > > the 1000-byte readers to become obsolete. > > Yup, I agree with that goal.
Having just looked at the pkt-line callers a lot, I think most of them could go for something like:
char *packet_read(int fd, unsigned *len_p)
{
static char buffer[LARGE_PACKET_MAX];
int len; len = packet_read_to_buf(fd, buffer, sizeof(buffer));
if (len < 0)
return NULL; *len_p = len;
return buffer;
}That would actually simplify the callers a bit, and would harmonize the buffer sizes at the same time. I'll look into doing a series tonight.
-Peff