pkt-line: add functions to read/write flush terminated packet streams
authorLars Schneider <larsxschneider@gmail.com>
Sun, 16 Oct 2016 23:20:34 +0000 (16:20 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Oct 2016 18:36:50 +0000 (11:36 -0700)
commitbb643d8bf872c416b7445e728e2675ac6490fe1d
treebcfb2996f3848da2ef60bf24cc2e84361a82c991
parentedfb780cd4fe73474583016055542f5686d3d98d
pkt-line: add functions to read/write flush terminated packet streams

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 packets until it
detects a `flush` packet.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pkt-line.c
pkt-line.h