summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Elhage <nelhage@nelhage.com>2018-06-26 02:32:50 +0000
committerNelson Elhage <nelhage@nelhage.com>2018-06-26 03:01:17 +0000
commit90cf86070046fcffd5306915b57786da054d8964 (patch)
tree9f0b7b04963e08a5ad4260e278f3a1b34f7ba4bb
parente212011b9872c52f6205d3a30b10f753c3108918 (diff)
downloadlibgit2-90cf86070046fcffd5306915b57786da054d8964.tar.gz
Remove GIT_PKT_PACK entirely
-rw-r--r--src/transports/smart.h2
-rw-r--r--src/transports/smart_pkt.c27
2 files changed, 3 insertions, 26 deletions
diff --git a/src/transports/smart.h b/src/transports/smart.h
index 26bd64e22..e63395b8c 100644
--- a/src/transports/smart.h
+++ b/src/transports/smart.h
@@ -40,7 +40,7 @@ typedef enum {
GIT_PKT_HAVE,
GIT_PKT_ACK,
GIT_PKT_NAK,
- GIT_PKT_PACK,
+ GIT_PKT_PACK__UNUSED,
GIT_PKT_COMMENT,
GIT_PKT_ERR,
GIT_PKT_DATA,
diff --git a/src/transports/smart_pkt.c b/src/transports/smart_pkt.c
index 48243305f..df35a6076 100644
--- a/src/transports/smart_pkt.c
+++ b/src/transports/smart_pkt.c
@@ -86,19 +86,6 @@ static int nak_pkt(git_pkt **out)
return 0;
}
-static int pack_pkt(git_pkt **out)
-{
- git_pkt *pkt;
-
- pkt = git__malloc(sizeof(git_pkt));
- GITERR_CHECK_ALLOC(pkt);
-
- pkt->type = GIT_PKT_PACK;
- *out = pkt;
-
- return 0;
-}
-
static int comment_pkt(git_pkt **out, const char *line, size_t len)
{
git_pkt_comment *pkt;
@@ -370,7 +357,7 @@ static int32_t parse_len(const char *line)
num[k] = '.';
}
}
-
+
giterr_set(GITERR_NET, "invalid hex digit in length: '%s'", num);
return -1;
}
@@ -407,17 +394,7 @@ int git_pkt_parse_line(
len = parse_len(line);
if (len < 0) {
- /*
- * 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_clear();
- *out = line;
- return pack_pkt(head);
- }
-
- return (int)len;
+ return GIT_ERROR;
}
/*