Re: [PATCH v9 10/14] pkt-line: add functions to read/write flush terminated packet streams

2016-10-05 Thread Lars Schneider
> On 04 Oct 2016, at 21:53, Junio C Hamano wrote: > > larsxschnei...@gmail.com writes: > >> From: Lars Schneider >> > >> +int write_packetized_from_buf(const char *src_in, size_t len, int fd_out) >> +{ >> +static char buf[LARGE_PACKET_DATA_MAX]; >> +int err = 0; >> +size_t bytes_

Re: [PATCH v9 10/14] pkt-line: add functions to read/write flush terminated packet streams

2016-10-04 Thread Junio C Hamano
larsxschnei...@gmail.com writes: > From: Lars Schneider > > write_packetized_from_fd() and write_packetized_from_buf() write a > stream of packets. All content packets use the maximal packet size > except for the last one. After the last content packet a `flush` control > packet is written. > > r

Re: [PATCH v9 10/14] pkt-line: add functions to read/write flush terminated packet streams

2016-10-04 Thread Junio C Hamano
Junio C Hamano writes: > I must be missing something. Is the other side always supposed to > give a flush packet or something? Perhaps that is what is happening > here. If so, I am OK with that, even though it somehow sounds a bit > wasteful. Ah, scratch that. What I was missing was that thi

[PATCH v9 10/14] pkt-line: add functions to read/write flush terminated packet streams

2016-10-04 Thread larsxschneider
From: Lars Schneider write_packetized_from_fd() and write_packetized_from_buf() write a stream of packets. All content packets use the maximal packet size except for the last one. After the last content packet a `flush` control packet is written. read_packetized_to_strbuf() reads arbitrary sized