Commit 895a668e by Nelson Elhage

Small style tweak, and set an error

parent 90cf8607
......@@ -394,7 +394,17 @@ int git_pkt_parse_line(
len = parse_len(line);
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