Thread (31 messages) flat view 31 messages, 2 authors, 2016-06-15
STALE3736d

Revision v5 of 5 in this series.

Revisions (5)
  1. rfc [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 current

[PATCH v5 03/28] pkt-line: Make packet_read_line easier to debug

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:47:38
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 pkt-line.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pkt-line.c b/pkt-line.c
index bd603f8..295ba2b 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;
-- 
1.6.5.2.181.gd6f41
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help