Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pkt-line: tighten sideband PACK check when tracing
To find the start of the pack data, we accept the word PACK
at the beginning of any sideband channel, even though what
we really want is to find the pack data on channel 1. In
practice this doesn't matter, as sideband-2 messages tend to
start with "error:" or similar, but it is a good idea to be
explicit (especially as we add more code in this area, we
will rely on this assumption).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jun 15, 2015
1 parent f3612ac commit d6d1a75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkt-line.c
Expand Up @@ -24,7 +24,7 @@ static void packet_trace(const char *buf, unsigned int len, int write)
strbuf_addf(&out, "packet: %12s%c ",
packet_trace_prefix, write ? '>' : '<');

if (starts_with(buf, "PACK") || starts_with(buf + 1, "PACK")) {
if (starts_with(buf, "PACK") || starts_with(buf, "\1PACK")) {
strbuf_addstr(&out, "PACK ...");
trace_disable(&trace_packet);
}
Expand Down

0 comments on commit d6d1a75

Please sign in to comment.