Thread (3 messages) 3 messages, 3 authors, 2021-04-29

Re: pkt-line and LF terminated lines of data

flat view

From: brian m. carlson <hidden>
Date: 2021-04-29 02:08:45

On 2021-04-29 at 00:12:00, Ævar Arnfjörð Bjarmason wrote:
On Wed, Apr 28 2021, dwh@linuxprogrammer.org wrote:
quoted
I was just reading the Documentation/technical/protocol-common.txt
description of the pkt-line format. One detail that is left out is how a
receiver of pkt-line encoded data determines if a line is binary data or
contains non-binary data.
They don't. The "is it binary" is a client convention / awareness of the
consumed payload.
As a general rule of thumb, if the pkt-line is a pack or object, it's
binary, and otherwise (a ref advertisement, a negotiation, etc.) it's
text.  Almost any case where GIT_TRACE_PACKET prints the output is going
to be text, and almost any case where it does not is going to be binary.

Note that whether something is text or binary is specifically an
attribute of what part of the protocol is being parsed, not what bytes
it contains.  For example, a ref advertisement with a ref containing the
bytes FE and FF is text, despite those not appearing in UTF-8.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help