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>
Jeff King committed
Jun 12, 2015 at 17:28 UTC
d6d1a75e51cf90650ac6e2cdcd8d108324b6fdb9
1 file changed
+1
-1
pkt-line.c
+1
-1
@@ -24,7 +24,7 @@ static void packet_trace(const char *buf, unsigned int len, int write)
24
strbuf_addf(&out, "packet: %12s%c ",
25
packet_trace_prefix, write ? '>' : '<');
26
27
- if (starts_with(buf, "PACK") || starts_with(buf + 1, "PACK")) {
27
+ if (starts_with(buf, "PACK") || starts_with(buf, "\1PACK")) {
28
strbuf_addstr(&out, "PACK ...");
29
trace_disable(&trace_packet);
30
}