Skip to main content

Module pktline

Module pktline 

Source
Expand description

The pkt-line framing git’s long-running filter protocol speaks.

A packet is four hexadecimal digits of length — counting those four bytes — followed by the payload. 0000 is a flush, which ends a list. Payloads are arbitrary bytes, so nothing here may become a String.

Enums§

Packet
One item read from the stream.

Constants§

MAX_PAYLOAD
Largest payload one packet can carry: git’s limit minus the length prefix.

Functions§

read_content
Reads packets until the next flush and concatenates them.
read_packet
Reads one packet.
read_until_flush
Reads packets until the next flush, returning their payloads.
write_data
Writes one payload, splitting it across packets when it is too long.
write_flush
Writes a flush and pushes everything out.