Commit 21ffc57d by Nelson Elhage Committed by Patrick Steinhardt

Small style tweak, and set an error

(cherry picked from commit 895a668e)
parent be98c9e9
...@@ -402,7 +402,17 @@ int git_pkt_parse_line( ...@@ -402,7 +402,17 @@ int git_pkt_parse_line(
len = parse_len(line); len = parse_len(line);
if (len < 0) { if (len < 0) {
return GIT_ERROR; /*
* If we fail to parse the length, it might be because the
* server is trying to send us the packfile already.
*/
if (bufflen >= 4 && !git__prefixcmp(line, "PACK")) {
giterr_set(GITERR_NET, "unexpected pack file");
} else {
giterr_set(GITERR_NET, "bad packet length");
}
return -1;
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment