Unverified Commit fa401a32 by Patrick Steinhardt Committed by GitHub

Merge pull request #4704 from nelhage/no-pkt-pack

Remove GIT_PKT_PACK entirely
parents 99bb98c0 388149f5
...@@ -40,7 +40,6 @@ typedef enum { ...@@ -40,7 +40,6 @@ typedef enum {
GIT_PKT_HAVE, GIT_PKT_HAVE,
GIT_PKT_ACK, GIT_PKT_ACK,
GIT_PKT_NAK, GIT_PKT_NAK,
GIT_PKT_PACK,
GIT_PKT_COMMENT, GIT_PKT_COMMENT,
GIT_PKT_ERR, GIT_PKT_ERR,
GIT_PKT_DATA, GIT_PKT_DATA,
......
...@@ -86,19 +86,6 @@ static int nak_pkt(git_pkt **out) ...@@ -86,19 +86,6 @@ static int nak_pkt(git_pkt **out)
return 0; 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) static int comment_pkt(git_pkt **out, const char *line, size_t len)
{ {
git_pkt_comment *pkt; git_pkt_comment *pkt;
...@@ -417,12 +404,12 @@ int git_pkt_parse_line( ...@@ -417,12 +404,12 @@ int git_pkt_parse_line(
* server is trying to send us the packfile already. * server is trying to send us the packfile already.
*/ */
if (bufflen >= 4 && !git__prefixcmp(line, "PACK")) { if (bufflen >= 4 && !git__prefixcmp(line, "PACK")) {
giterr_clear(); giterr_set(GITERR_NET, "unexpected pack file");
*out = line; } else {
return pack_pkt(head); giterr_set(GITERR_NET, "bad packet length");
} }
return (int)len; return -1;
} }
/* /*
......
...@@ -70,12 +70,6 @@ int git_smart__store_refs(transport_smart *t, int flushes) ...@@ -70,12 +70,6 @@ int git_smart__store_refs(transport_smart *t, int flushes)
return -1; return -1;
} }
if (pkt->type == GIT_PKT_PACK) {
giterr_set(GITERR_NET, "unexpected packfile");
git__free(pkt);
return -1;
}
if (pkt->type != GIT_PKT_FLUSH && git_vector_insert(refs, pkt) < 0) if (pkt->type != GIT_PKT_FLUSH && git_vector_insert(refs, pkt) < 0)
return -1; 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