aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2009-10-30 17:47:22 -0700
committerJunio C Hamano <gitster@pobox.com>2009-10-30 19:20:53 -0700
commit743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b (patch)
tree8bbf63388df51ae51be534dc4eec0cba6bc27d55
parentf5615d246770a2796e60b06dd5e17f5e79d5dd0c (diff)
downloadgit-743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b.tar.gz
git-743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b.tar.xz
pkt-line: Make packet_read_line easier to debug
When there is an error parsing the 4 byte length component we now display it as part of the die message, this may hint as to what data was misunderstood by the application. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--pkt-line.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkt-line.c b/pkt-line.c
index bd603f872..295ba2b16 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -129,7 +129,7 @@ int packet_read_line(int fd, char *buffer, unsigned size)
safe_read(fd, linelen, 4);
len = packet_length(linelen);
if (len < 0)
- die("protocol error: bad line length character");
+ die("protocol error: bad line length character: %.4s", linelen);
if (!len)
return 0;
len -= 4;