commit - 8ee2e0cf585dcaf492487fb8afc4c9099194651a
commit + ff4d9c2e05d9f8f0b985f1ca27789ff37c9968bd
blob - 53f97cf1eb90762e361151b23bfb6223d09c5302
blob + 8d8ebb693f81dbed4045da8fa1c57f90b2e362a2
--- libexec/got-fetch-http/got-fetch-http.c
+++ libexec/got-fetch-http/got-fetch-http.c
"service=git-upload-pack", NULL) == -1)
goto err;
+ /* Fetch the initial reference announcement from the server. */
if (http_parse_reply(&bio, &chunked, UPLOAD_PACK_ADV) == -1)
goto err;
NULL, UPLOAD_PACK_REQ) == -1)
goto err;
+ /*
+ * Read have/want lines generated by got-fetch-pack and forward
+ * them to the server in the POST request body.
+ */
for (;;) {
r = fread(buf, 1, 4, in);
if (r != 4)
if (http_parse_reply(&bio, &chunked, UPLOAD_PACK_RES) == -1)
goto err;
+ /* Fetch pack file data from server. */
for (;;) {
r = http_read(&bio, chunked, &chunksz, buf, sizeof(buf));
if (r == -1)