Re: [PATCH v7 05/10] pkt-line: add packet_write_gently()

2016-09-12 Thread Junio C Hamano
larsxschnei...@gmail.com writes: > +int packet_write_gently(const int fd_out, const char *buf, size_t size) > +{ > + static char packet_write_buffer[LARGE_PACKET_MAX]; > + > + if (size > sizeof(packet_write_buffer) - 4) { > + error("packet write failed"); > +

Re: [PATCH v7 05/10] pkt-line: add packet_write_gently()

2016-09-11 Thread Lars Schneider
> On 08 Sep 2016, at 23:24, Stefan Beller wrote: > > On Thu, Sep 8, 2016 at 11:21 AM, wrote: > >> >> Add packet_write_gently() which writes arbitrary data and returns `0` >> for success and `-1` for an error. > > I think documenting the return

Re: [PATCH v7 05/10] pkt-line: add packet_write_gently()

2016-09-08 Thread Stefan Beller
On Thu, Sep 8, 2016 at 11:21 AM, wrote: > From: Lars Schneider > > packet_write_fmt_gently() uses format_packet() which lets the caller > only send string data via "%s". That means it cannot be used for > arbitrary data that may contain NULs.

[PATCH v7 05/10] pkt-line: add packet_write_gently()

2016-09-08 Thread larsxschneider
From: Lars Schneider packet_write_fmt_gently() uses format_packet() which lets the caller only send string data via "%s". That means it cannot be used for arbitrary data that may contain NULs. Add packet_write_gently() which writes arbitrary data and returns `0` for