summaryrefslogtreecommitdiff
path: root/http.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-06-25 19:27:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-25 19:27:47 (GMT)
commit34e849b05a454a2c6487f8fbfa68c39932d22730 (patch)
tree7a71a357e9f7e2c977849224ca18b2cb9a4461ea /http.h
parent10462829e35d1a88ef89be0465a5ee9fd229dc3a (diff)
parentcae2ee105505d45a92cf7abcc26f22890bce4202 (diff)
downloadgit-34e849b05a454a2c6487f8fbfa68c39932d22730.zip
git-34e849b05a454a2c6487f8fbfa68c39932d22730.tar.gz
git-34e849b05a454a2c6487f8fbfa68c39932d22730.tar.bz2
Merge branch 'jt/cdn-offload'
The "fetch/clone" protocol has been updated to allow the server to instruct the clients to grab pre-packaged packfile(s) in addition to the packed object data coming over the wire. * jt/cdn-offload: upload-pack: fix a sparse '0 as NULL pointer' warning upload-pack: send part of packfile response as uri fetch-pack: support more than one pack lockfile upload-pack: refactor reading of pack-objects out Documentation: add Packfile URIs design doc Documentation: order protocol v2 sections http-fetch: support fetching packfiles by URL http-fetch: refactor into function http: refactor finish_http_pack_request() http: use --stdin when indexing dumb HTTP pack
Diffstat (limited to 'http.h')
-rw-r--r--http.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/http.h b/http.h
index faf8cbb..5de792e 100644
--- a/http.h
+++ b/http.h
@@ -216,18 +216,36 @@ int http_get_info_packs(const char *base_url,
struct http_pack_request {
char *url;
- struct packed_git *target;
- struct packed_git **lst;
+
+ /*
+ * If this is true, finish_http_pack_request() will pass "--keep" to
+ * index-pack, resulting in the creation of a keep file, and will not
+ * suppress its stdout (that is, the "keep\t<hash>\n" line will be
+ * printed to stdout).
+ */
+ unsigned generate_keep : 1;
+
FILE *packfile;
struct strbuf tmpfile;
struct active_request_slot *slot;
};
struct http_pack_request *new_http_pack_request(
- struct packed_git *target, const char *base_url);
+ const unsigned char *packed_git_hash, const char *base_url);
+struct http_pack_request *new_direct_http_pack_request(
+ const unsigned char *packed_git_hash, char *url);
int finish_http_pack_request(struct http_pack_request *preq);
void release_http_pack_request(struct http_pack_request *preq);
+/*
+ * Remove p from the given list, and invoke install_packed_git() on it.
+ *
+ * This is a convenience function for users that have obtained a list of packs
+ * from http_get_info_packs() and have chosen a specific pack to fetch.
+ */
+void http_install_packfile(struct packed_git *p,
+ struct packed_git **list_to_remove_from);
+
/* Helpers for fetching object */
struct http_object_request {
char *url;