Skip to content
This repository
Newer
Older
100644 591 lines (509 sloc) 14.275 kb
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
1 #include "cache.h"
2 #include "commit.h"
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
3 #include "walker.h"
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
4 #include "http.h"
7baa3e86 » dscho
2005-10-15 Some curl versions lack curl_easy_duphandle()
5
9cba13ca » jrn
2011-03-16 standardize brace placement in struct definitions
6 struct alt_base {
2afea3bc » Gerrit Pape
2007-03-28 http-fetch: don't use double-slash as directory separator in URLs
7 char *base;
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
8 int got_indices;
9 struct packed_git *packs;
10 struct alt_base *next;
11 };
12
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
13 enum object_request_state {
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
14 WAITING,
15 ABORTED,
16 ACTIVE,
4b05548f » Gary V. Vaughan
2010-05-14 enums: omit trailing comma for portability
17 COMPLETE
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
18 };
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
19
9cba13ca » jrn
2011-03-16 standardize brace placement in struct definitions
20 struct object_request {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
21 struct walker *walker;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
22 unsigned char sha1[20];
23 struct alt_base *repo;
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
24 enum object_request_state state;
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
25 struct http_object_request *req;
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
26 struct object_request *next;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
27 };
28
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
29 struct alternates_request {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
30 struct walker *walker;
8e29f6a0 » Petr Baudis
2006-07-27 Teach git-http-fetch the --stdin switch
31 const char *base;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
32 char *url;
028c2976 » glandium
2007-12-09 Use strbuf in http code
33 struct strbuf *buffer;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
34 struct active_request_slot *slot;
35 int http_specific;
36 };
37
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
38 struct walker_data {
39 const char *url;
40 int got_alternates;
41 struct alt_base *alt;
42 };
43
96f1e58f » David Rientjes
2006-08-15 remove unnecessary initializations
44 static struct object_request *object_queue_head;
bc8f2652 » sigprof
2005-10-13 git-http-fetch: Remove size limit for objects/info/{packs,alternates}
45
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
46 static void fetch_alternates(struct walker *walker, const char *base);
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
47
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
48 static void process_object_response(void *callback_data);
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
49
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
50 static void start_object_request(struct walker *walker,
51 struct object_request *obj_req)
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
52 {
53 struct active_request_slot *slot;
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
54 struct http_object_request *req;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
55
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
56 req = new_http_object_request(obj_req->repo->base, obj_req->sha1);
57 if (req == NULL) {
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
58 obj_req->state = ABORTED;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
59 return;
60 }
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
61 obj_req->req = req;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
62
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
63 slot = req->slot;
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
64 slot->callback_func = process_object_response;
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
65 slot->callback_data = obj_req;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
66
a7a8d378 » Nick Hengeveld
2005-10-10 Only compile parallel HTTP support with CURL >= 7.9.8
67 /* Try to get the request started, abort the request on error */
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
68 obj_req->state = ACTIVE;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
69 if (!start_active_slot(slot)) {
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
70 obj_req->state = ABORTED;
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
71 release_http_object_request(req);
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
72 return;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
73 }
74 }
75
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
76 static void finish_object_request(struct object_request *obj_req)
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
77 {
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
78 if (finish_http_object_request(obj_req->req))
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
79 return;
80
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
81 if (obj_req->req->rename == 0)
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
82 walker_say(obj_req->walker, "got %s\n", sha1_to_hex(obj_req->sha1));
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
83 }
84
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
85 static void process_object_response(void *callback_data)
86 {
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
87 struct object_request *obj_req =
88 (struct object_request *)callback_data;
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
89 struct walker *walker = obj_req->walker;
90 struct walker_data *data = walker->data;
91 struct alt_base *alt = data->alt;
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
92
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
93 process_http_object_request(obj_req->req);
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
94 obj_req->state = COMPLETE;
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
95
96 /* Use alternates if necessary */
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
97 if (missing_target(obj_req->req)) {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
98 fetch_alternates(walker, alt->base);
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
99 if (obj_req->repo->next != NULL) {
100 obj_req->repo =
101 obj_req->repo->next;
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
102 release_http_object_request(obj_req->req);
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
103 start_object_request(walker, obj_req);
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
104 return;
105 }
106 }
107
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
108 finish_object_request(obj_req);
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
109 }
110
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
111 static void release_object_request(struct object_request *obj_req)
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
112 {
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
113 struct object_request *entry = object_queue_head;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
114
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
115 if (obj_req->req !=NULL && obj_req->req->localfile != -1)
116 error("fd leakage in release: %d", obj_req->req->localfile);
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
117 if (obj_req == object_queue_head) {
118 object_queue_head = obj_req->next;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
119 } else {
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
120 while (entry->next != NULL && entry->next != obj_req)
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
121 entry = entry->next;
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
122 if (entry->next == obj_req)
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
123 entry->next = entry->next->next;
124 }
125
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
126 free(obj_req);
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
127 }
128
a7a8d378 » Nick Hengeveld
2005-10-10 Only compile parallel HTTP support with CURL >= 7.9.8
129 #ifdef USE_CURL_MULTI
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
130 static int fill_active_slot(struct walker *walker)
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
131 {
45c17412 » Daniel Barkalow
2007-09-10 Refactor http.h USE_CURL_MULTI fill_active_slots().
132 struct object_request *obj_req;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
133
45c17412 » Daniel Barkalow
2007-09-10 Refactor http.h USE_CURL_MULTI fill_active_slots().
134 for (obj_req = object_queue_head; obj_req; obj_req = obj_req->next) {
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
135 if (obj_req->state == WAITING) {
136 if (has_sha1_file(obj_req->sha1))
09db444f » Mark Wooding
2006-02-01 http-fetch: Fix object list corruption in fill_active_slots().
137 obj_req->state = COMPLETE;
45c17412 » Daniel Barkalow
2007-09-10 Refactor http.h USE_CURL_MULTI fill_active_slots().
138 else {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
139 start_object_request(walker, obj_req);
45c17412 » Daniel Barkalow
2007-09-10 Refactor http.h USE_CURL_MULTI fill_active_slots().
140 return 1;
141 }
f1a906a3 » Nick Hengeveld
2005-10-21 [PATCH 1/3] Clean up CURL handles in unused request slots
142 }
8fcf7f9a » Junio C Hamano
2006-01-31 whitespace cleanup.
143 }
45c17412 » Daniel Barkalow
2007-09-10 Refactor http.h USE_CURL_MULTI fill_active_slots().
144 return 0;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
145 }
a7a8d378 » Nick Hengeveld
2005-10-10 Only compile parallel HTTP support with CURL >= 7.9.8
146 #endif
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
147
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
148 static void prefetch(struct walker *walker, unsigned char *sha1)
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
149 {
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
150 struct object_request *newreq;
151 struct object_request *tail;
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
152 struct walker_data *data = walker->data;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
153
154 newreq = xmalloc(sizeof(*newreq));
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
155 newreq->walker = walker;
e702496e » spearce
2006-08-23 Convert memcpy(a,b,20) to hashcpy(a,b).
156 hashcpy(newreq->sha1, sha1);
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
157 newreq->repo = data->alt;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
158 newreq->state = WAITING;
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
159 newreq->req = NULL;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
160 newreq->next = NULL;
161
e9176745 » rctay
2009-06-06 http*: move common variables and macros to http.[ch]
162 http_is_verbose = walker->get_verbosely;
163
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
164 if (object_queue_head == NULL) {
165 object_queue_head = newreq;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
166 } else {
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
167 tail = object_queue_head;
4c42aa1a » rctay
2009-06-06 http-push, http-walker: style fixes
168 while (tail->next != NULL)
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
169 tail = tail->next;
170 tail->next = newreq;
171 }
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
172
a7a8d378 » Nick Hengeveld
2005-10-10 Only compile parallel HTTP support with CURL >= 7.9.8
173 #ifdef USE_CURL_MULTI
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
174 fill_active_slots();
175 step_active_slots();
a7a8d378 » Nick Hengeveld
2005-10-10 Only compile parallel HTTP support with CURL >= 7.9.8
176 #endif
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
177 }
178
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
179 static void process_alternates_response(void *callback_data)
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
180 {
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
181 struct alternates_request *alt_req =
182 (struct alternates_request *)callback_data;
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
183 struct walker *walker = alt_req->walker;
184 struct walker_data *cdata = walker->data;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
185 struct active_request_slot *slot = alt_req->slot;
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
186 struct alt_base *tail = cdata->alt;
8e29f6a0 » Petr Baudis
2006-07-27 Teach git-http-fetch the --stdin switch
187 const char *base = alt_req->base;
a04ff3ec » toofishes
2011-05-03 http: make curl callbacks match contracts from curl header
188 const char null_byte = '\0';
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
189 char *data;
190 int i = 0;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
191
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
192 if (alt_req->http_specific) {
193 if (slot->curl_result != CURLE_OK ||
028c2976 » glandium
2007-12-09 Use strbuf in http code
194 !alt_req->buffer->len) {
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
195
196 /* Try reusing the slot to get non-http alternates */
197 alt_req->http_specific = 0;
198 sprintf(alt_req->url, "%s/objects/info/alternates",
199 base);
200 curl_easy_setopt(slot->curl, CURLOPT_URL,
201 alt_req->url);
202 active_requests++;
203 slot->in_use = 1;
c9826473 » Nick Hengeveld
2006-03-15 Fix broken slot reuse when fetching alternates
204 if (slot->finished != NULL)
205 (*slot->finished) = 0;
a3f583cb » Mark Wooding
2006-02-01 http-fetch: Tidy control flow in process_alternate_response
206 if (!start_active_slot(slot)) {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
207 cdata->got_alternates = -1;
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
208 slot->in_use = 0;
c9826473 » Nick Hengeveld
2006-03-15 Fix broken slot reuse when fetching alternates
209 if (slot->finished != NULL)
210 (*slot->finished) = 1;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
211 }
a3f583cb » Mark Wooding
2006-02-01 http-fetch: Tidy control flow in process_alternate_response
212 return;
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
213 }
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
214 } else if (slot->curl_result != CURLE_OK) {
be4a015b » Junio C Hamano
2006-09-16 http-fetch.c: consolidate code to detect missing fetch target
215 if (!missing_target(slot)) {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
216 cdata->got_alternates = -1;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
217 return;
218 }
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
219 }
220
a04ff3ec » toofishes
2011-05-03 http: make curl callbacks match contracts from curl header
221 fwrite_buffer((char *)&null_byte, 1, 1, alt_req->buffer);
028c2976 » glandium
2007-12-09 Use strbuf in http code
222 alt_req->buffer->len--;
223 data = alt_req->buffer->buf;
1b0c1e67 » Daniel Barkalow
2005-09-18 [PATCH] Support alternates and http-alternates in http-fetch
224
028c2976 » glandium
2007-12-09 Use strbuf in http code
225 while (i < alt_req->buffer->len) {
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
226 int posn = i;
028c2976 » glandium
2007-12-09 Use strbuf in http code
227 while (posn < alt_req->buffer->len && data[posn] != '\n')
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
228 posn++;
229 if (data[posn] == '\n') {
1b0c1e67 » Daniel Barkalow
2005-09-18 [PATCH] Support alternates and http-alternates in http-fetch
230 int okay = 0;
231 int serverlen = 0;
232 struct alt_base *newalt;
233 char *target = NULL;
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
234 if (data[i] == '/') {
4c42aa1a » rctay
2009-06-06 http-push, http-walker: style fixes
235 /*
236 * This counts
5df1e0d0 » Junio C Hamano
2006-09-12 http-fetch: fix alternates handling.
237 * http://git.host/pub/scm/linux.git/
238 * -----------here^
239 * so memcpy(dst, base, serverlen) will
240 * copy up to "...git.host".
241 */
242 const char *colon_ss = strstr(base,"://");
243 if (colon_ss) {
244 serverlen = (strchr(colon_ss + 3, '/')
245 - base);
246 okay = 1;
247 }
1b0c1e67 » Daniel Barkalow
2005-09-18 [PATCH] Support alternates and http-alternates in http-fetch
248 } else if (!memcmp(data + i, "../", 3)) {
4c42aa1a » rctay
2009-06-06 http-push, http-walker: style fixes
249 /*
250 * Relative URL; chop the corresponding
5df1e0d0 » Junio C Hamano
2006-09-12 http-fetch: fix alternates handling.
251 * number of subpath from base (and ../
252 * from data), and concatenate the result.
253 *
254 * The code first drops ../ from data, and
255 * then drops one ../ from data and one path
256 * from base. IOW, one extra ../ is dropped
257 * from data than path is dropped from base.
258 *
259 * This is not wrong. The alternate in
260 * http://git.host/pub/scm/linux.git/
261 * to borrow from
262 * http://git.host/pub/scm/linus.git/
263 * is ../../linus.git/objects/. You need
264 * two ../../ to borrow from your direct
265 * neighbour.
266 */
1b0c1e67 » Daniel Barkalow
2005-09-18 [PATCH] Support alternates and http-alternates in http-fetch
267 i += 3;
268 serverlen = strlen(base);
8fcf7f9a » Junio C Hamano
2006-01-31 whitespace cleanup.
269 while (i + 2 < posn &&
1b0c1e67 » Daniel Barkalow
2005-09-18 [PATCH] Support alternates and http-alternates in http-fetch
270 !memcmp(data + i, "../", 3)) {
271 do {
272 serverlen--;
273 } while (serverlen &&
274 base[serverlen - 1] != '/');
275 i += 3;
276 }
a9486b02 » proski
2006-07-10 Avoid C99 comments, use old-style C comments instead.
277 /* If the server got removed, give up. */
8fcf7f9a » Junio C Hamano
2006-01-31 whitespace cleanup.
278 okay = strchr(base, ':') - base + 3 <
4c42aa1a » rctay
2009-06-06 http-push, http-walker: style fixes
279 serverlen;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
280 } else if (alt_req->http_specific) {
1b0c1e67 » Daniel Barkalow
2005-09-18 [PATCH] Support alternates and http-alternates in http-fetch
281 char *colon = strchr(data + i, ':');
282 char *slash = strchr(data + i, '/');
283 if (colon && slash && colon < data + posn &&
284 slash < data + posn && colon < slash) {
285 okay = 1;
286 }
287 }
5df1e0d0 » Junio C Hamano
2006-09-12 http-fetch: fix alternates handling.
288 /* skip "objects\n" at end */
1b0c1e67 » Daniel Barkalow
2005-09-18 [PATCH] Support alternates and http-alternates in http-fetch
289 if (okay) {
290 target = xmalloc(serverlen + posn - i - 6);
5df1e0d0 » Junio C Hamano
2006-09-12 http-fetch: fix alternates handling.
291 memcpy(target, base, serverlen);
292 memcpy(target + serverlen, data + i,
293 posn - i - 7);
294 target[serverlen + posn - i - 7] = 0;
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
295 if (walker->get_verbosely)
8fcf7f9a » Junio C Hamano
2006-01-31 whitespace cleanup.
296 fprintf(stderr,
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
297 "Also look at %s\n", target);
298 newalt = xmalloc(sizeof(*newalt));
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
299 newalt->next = NULL;
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
300 newalt->base = target;
301 newalt->got_indices = 0;
302 newalt->packs = NULL;
8d9fbe57 » Nick Hengeveld
2006-04-04 http-fetch: add optional DAV-based pack list
303
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
304 while (tail->next != NULL)
305 tail = tail->next;
306 tail->next = newalt;
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
307 }
308 }
309 i = posn + 1;
310 }
bc8f2652 » sigprof
2005-10-13 git-http-fetch: Remove size limit for objects/info/{packs,alternates}
311
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
312 cdata->got_alternates = 1;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
313 }
314
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
315 static void fetch_alternates(struct walker *walker, const char *base)
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
316 {
028c2976 » glandium
2007-12-09 Use strbuf in http code
317 struct strbuf buffer = STRBUF_INIT;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
318 char *url;
319 struct active_request_slot *slot;
cb754fdf » Nick Hengeveld
2006-01-31 Use local structs for HTTP slot callback data
320 struct alternates_request alt_req;
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
321 struct walker_data *cdata = walker->data;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
322
4c42aa1a » rctay
2009-06-06 http-push, http-walker: style fixes
323 /*
324 * If another request has already started fetching alternates,
325 * wait for them to arrive and return to processing this request's
326 * curl message
327 */
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
328 #ifdef USE_CURL_MULTI
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
329 while (cdata->got_alternates == 0) {
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
330 step_active_slots();
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
331 }
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
332 #endif
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
333
334 /* Nothing to do if they've already been fetched */
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
335 if (cdata->got_alternates == 1)
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
336 return;
337
338 /* Start the fetch */
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
339 cdata->got_alternates = 0;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
340
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
341 if (walker->get_verbosely)
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
342 fprintf(stderr, "Getting alternates list for %s\n", base);
8fcf7f9a » Junio C Hamano
2006-01-31 whitespace cleanup.
343
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
344 url = xmalloc(strlen(base) + 31);
345 sprintf(url, "%s/objects/info/http-alternates", base);
346
4c42aa1a » rctay
2009-06-06 http-push, http-walker: style fixes
347 /*
348 * Use a callback to process the result, since another request
349 * may fail and need to have alternates loaded before continuing
350 */
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
351 slot = get_active_slot();
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
352 slot->callback_func = process_alternates_response;
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
353 alt_req.walker = walker;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
354 slot->callback_data = &alt_req;
355
356 curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
357 curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
358 curl_easy_setopt(slot->curl, CURLOPT_URL, url);
359
360 alt_req.base = base;
361 alt_req.url = url;
362 alt_req.buffer = &buffer;
363 alt_req.http_specific = 1;
364 alt_req.slot = slot;
365
366 if (start_active_slot(slot))
367 run_active_slot(slot);
368 else
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
369 cdata->got_alternates = -1;
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
370
028c2976 » glandium
2007-12-09 Use strbuf in http code
371 strbuf_release(&buffer);
acc075a8 » Nick Hengeveld
2005-11-12 Fix for multiple alternates requests in http-fetch
372 free(url);
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
373 }
374
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
375 static int fetch_indices(struct walker *walker, struct alt_base *repo)
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
376 {
b8caac2b » rctay
2009-06-06 http*: add http_get_info_packs
377 int ret;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
378
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
379 if (repo->got_indices)
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
380 return 0;
381
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
382 if (walker->get_verbosely)
6fd72e39 » Petr Baudis
2005-11-12 Show URL in the "Getting <foo> list" http-fetch messages
383 fprintf(stderr, "Getting pack list for %s\n", repo->base);
8fcf7f9a » Junio C Hamano
2006-01-31 whitespace cleanup.
384
b8caac2b » rctay
2009-06-06 http*: add http_get_info_packs
385 switch (http_get_info_packs(repo->base, &repo->packs)) {
386 case HTTP_OK:
387 case HTTP_MISSING_TARGET:
388 repo->got_indices = 1;
389 ret = 0;
390 break;
391 default:
5e3a7691 » Nick Hengeveld
2005-11-18 Improve pack list response handling
392 repo->got_indices = 0;
b8caac2b » rctay
2009-06-06 http*: add http_get_info_packs
393 ret = -1;
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
394 }
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
395
3a462bc9 » glandium
2007-12-10 Fix various memory leaks in http-push.c and http-walker.c
396 return ret;
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
397 }
398
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
399 static int fetch_pack(struct walker *walker, struct alt_base *repo, unsigned char *sha1)
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
400 {
401 struct packed_git *target;
49a0f240 » Nick Hengeveld
2005-09-28 [PATCH] HTTP partial transfer support for object, pack, and index tra…
402 int ret;
cb754fdf » Nick Hengeveld
2006-01-31 Use local structs for HTTP slot callback data
403 struct slot_results results;
2264dfa5 » rctay
2009-06-06 http*: add helper methods for fetching packs
404 struct http_pack_request *preq;
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
405
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
406 if (fetch_indices(walker, repo))
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
407 return -1;
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
408 target = find_sha1_pack(sha1, repo->packs);
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
409 if (!target)
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
410 return -1;
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
411
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
412 if (walker->get_verbosely) {
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
413 fprintf(stderr, "Getting pack %s\n",
414 sha1_to_hex(target->sha1));
415 fprintf(stderr, " which contains %s\n",
416 sha1_to_hex(sha1));
417 }
418
2264dfa5 » rctay
2009-06-06 http*: add helper methods for fetching packs
419 preq = new_http_pack_request(target, repo->base);
420 if (preq == NULL)
421 goto abort;
422 preq->lst = &repo->packs;
423 preq->slot->results = &results;
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
424
2264dfa5 » rctay
2009-06-06 http*: add helper methods for fetching packs
425 if (start_active_slot(preq->slot)) {
426 run_active_slot(preq->slot);
c8568e13 » Nick Hengeveld
2006-01-31 Fix HTTP request result processing after slot reuse
427 if (results.curl_result != CURLE_OK) {
2264dfa5 » rctay
2009-06-06 http*: add helper methods for fetching packs
428 error("Unable to get pack file %s\n%s", preq->url,
429 curl_errorstr);
430 goto abort;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
431 }
432 } else {
2264dfa5 » rctay
2009-06-06 http*: add helper methods for fetching packs
433 error("Unable to start request");
434 goto abort;
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
435 }
436
2264dfa5 » rctay
2009-06-06 http*: add helper methods for fetching packs
437 ret = finish_http_pack_request(preq);
438 release_http_pack_request(preq);
49a0f240 » Nick Hengeveld
2005-09-28 [PATCH] HTTP partial transfer support for object, pack, and index tra…
439 if (ret)
b721e01f » Junio C Hamano
2005-10-10 Use the same move_temp_to_file in git-http-fetch.
440 return ret;
49a0f240 » Nick Hengeveld
2005-09-28 [PATCH] HTTP partial transfer support for object, pack, and index tra…
441
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
442 return 0;
2264dfa5 » rctay
2009-06-06 http*: add helper methods for fetching packs
443
444 abort:
445 return -1;
182005b9 » barkalow@iabervon.org
2005-07-31 [PATCH] Support downloading packs by HTTP (whitespace fixed)
446 }
447
53f31389 » Mark Wooding
2006-02-07 http-fetch: Abort requests for objects which arrived in packs
448 static void abort_object_request(struct object_request *obj_req)
449 {
450 release_object_request(obj_req);
451 }
452
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
453 static int fetch_object(struct walker *walker, struct alt_base *repo, unsigned char *sha1)
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
454 {
455 char *hex = sha1_to_hex(sha1);
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
456 int ret = 0;
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
457 struct object_request *obj_req = object_queue_head;
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
458 struct http_object_request *req;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
459
a89fccd2 » David Rientjes
2006-08-17 Do not use memcmp(sha1_1, sha1_2, 20) with hardcoded length.
460 while (obj_req != NULL && hashcmp(obj_req->sha1, sha1))
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
461 obj_req = obj_req->next;
462 if (obj_req == NULL)
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
463 return error("Couldn't find request for %s in the queue", hex);
464
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
465 if (has_sha1_file(obj_req->sha1)) {
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
466 if (obj_req->req != NULL)
467 abort_http_object_request(obj_req->req);
53f31389 » Mark Wooding
2006-02-07 http-fetch: Abort requests for objects which arrived in packs
468 abort_object_request(obj_req);
11f0dafe » Nick Hengeveld
2005-10-10 [PATCH] Don't fetch objects that exist in the local repository
469 return 0;
470 }
471
a7a8d378 » Nick Hengeveld
2005-10-10 Only compile parallel HTTP support with CURL >= 7.9.8
472 #ifdef USE_CURL_MULTI
4c42aa1a » rctay
2009-06-06 http-push, http-walker: style fixes
473 while (obj_req->state == WAITING)
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
474 step_active_slots();
a7a8d378 » Nick Hengeveld
2005-10-10 Only compile parallel HTTP support with CURL >= 7.9.8
475 #else
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
476 start_object_request(walker, obj_req);
a7a8d378 » Nick Hengeveld
2005-10-10 Only compile parallel HTTP support with CURL >= 7.9.8
477 #endif
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
478
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
479 /*
480 * obj_req->req might change when fetching alternates in the callback
481 * process_object_response; therefore, the "shortcut" variable, req,
482 * is used only after we're done with slots.
483 */
4c42aa1a » rctay
2009-06-06 http-push, http-walker: style fixes
484 while (obj_req->state == ACTIVE)
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
485 run_active_slot(obj_req->req->slot);
486
487 req = obj_req->req;
4c42aa1a » rctay
2009-06-06 http-push, http-walker: style fixes
488
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
489 if (req->localfile != -1) {
490 close(req->localfile);
491 req->localfile = -1;
313c4714 » Petr Baudis
2005-11-12 Fix bunch of fd leaks in http-fetch
492 }
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
493
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
494 if (obj_req->state == ABORTED) {
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
495 ret = error("Request for %s aborted", hex);
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
496 } else if (req->curl_result != CURLE_OK &&
497 req->http_code != 416) {
498 if (missing_target(req))
e2029eb9 » Petr Baudis
2005-10-21 Silence confusing and false-positive curl error message
499 ret = -1; /* Be silent, it is probably in a pack. */
500 else
501 ret = error("%s (curl_result = %d, http_code = %ld, sha1 = %s)",
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
502 req->errorstr, req->curl_result,
503 req->http_code, hex);
504 } else if (req->zret != Z_STREAM_END) {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
505 walker->corrupt_object_found++;
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
506 ret = error("File %s (%s) corrupt", hex, req->url);
507 } else if (hashcmp(obj_req->sha1, req->real_sha1)) {
bd2afde8 » Junio C Hamano
2006-02-22 Give no terminating LF to error() function.
508 ret = error("File %s has bad hash", hex);
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
509 } else if (req->rename < 0) {
7b934ec0 » Mark Wooding
2006-02-01 http-fetch: Fix message reporting rename of object file.
510 ret = error("unable to write sha1 filename %s",
0da8b2e7 » spearce
2010-04-17 http.c: Don't store destination name in request structures
511 sha1_file_name(req->sha1));
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
512 }
49a0f240 » Nick Hengeveld
2005-09-28 [PATCH] HTTP partial transfer support for object, pack, and index tra…
513
5424bc55 » rctay
2009-06-06 http*: add helper methods for fetching objects (loose)
514 release_http_object_request(req);
e388ab74 » Nick Hengeveld
2005-11-18 Make http-fetch request types more clear
515 release_object_request(obj_req);
29508e1e » Nick Hengeveld
2005-11-18 Isolate shared HTTP request functionality
516 return ret;
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
517 }
518
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
519 static int fetch(struct walker *walker, unsigned char *sha1)
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
520 {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
521 struct walker_data *data = walker->data;
522 struct alt_base *altbase = data->alt;
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
523
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
524 if (!fetch_object(walker, altbase, sha1))
1d389ab6 » Nick Hengeveld
2005-10-10 Add support for parallel HTTP transfers
525 return 0;
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
526 while (altbase) {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
527 if (!fetch_pack(walker, altbase, sha1))
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
528 return 0;
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
529 fetch_alternates(walker, data->alt->base);
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
530 altbase = altbase->next;
531 }
bd2afde8 » Junio C Hamano
2006-02-22 Give no terminating LF to error() function.
532 return error("Unable to find %s under %s", sha1_to_hex(sha1),
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
533 data->alt->base);
b3661567 » Daniel Barkalow
2005-09-14 [PATCH] Add support for alternates in HTTP
534 }
535
c13b2633 » Daniel Barkalow
2008-04-26 Make walker.fetch_ref() take a struct ref.
536 static int fetch_ref(struct walker *walker, struct ref *ref)
cd541a68 » Daniel Barkalow
2005-06-06 [PATCH] Generic support for pulling refs
537 {
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
538 struct walker_data *data = walker->data;
c13b2633 » Daniel Barkalow
2008-04-26 Make walker.fetch_ref() take a struct ref.
539 return http_fetch_ref(data->alt->base, ref);
cd541a68 » Daniel Barkalow
2005-06-06 [PATCH] Generic support for pulling refs
540 }
541
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
542 static void cleanup(struct walker *walker)
543 {
09ae9aca » rctay
2010-03-02 http-walker: cleanup more thoroughly
544 struct walker_data *data = walker->data;
545 struct alt_base *alt, *alt_next;
546
547 if (data) {
548 alt = data->alt;
549 while (alt) {
550 alt_next = alt->next;
551
552 free(alt->base);
553 free(alt);
554
555 alt = alt_next;
556 }
557 free(data);
558 walker->data = NULL;
559 }
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
560 }
561
888692b7 » rctay
2010-03-02 http: init and cleanup separately from http-walker
562 struct walker *get_http_walker(const char *url)
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
563 {
9c880b3e » Gerrit Pape
2007-03-28 http-fetch: remove path_len from struct alt_base, it was computed but…
564 char *s;
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
565 struct walker_data *data = xmalloc(sizeof(struct walker_data));
566 struct walker *walker = xmalloc(sizeof(struct walker));
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
567
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
568 data->alt = xmalloc(sizeof(*data->alt));
569 data->alt->base = xmalloc(strlen(url) + 1);
570 strcpy(data->alt->base, url);
571 for (s = data->alt->base + strlen(data->alt->base) - 1; *s == '/'; --s)
9c880b3e » Gerrit Pape
2007-03-28 http-fetch: remove path_len from struct alt_base, it was computed but…
572 *s = 0;
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
573
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
574 data->alt->got_indices = 0;
575 data->alt->packs = NULL;
576 data->alt->next = NULL;
577 data->got_alternates = -1;
fc57b6aa » Daniel Barkalow
2007-09-10 Make function to refill http queue a callback
578
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
579 walker->corrupt_object_found = 0;
580 walker->fetch = fetch;
581 walker->fetch_ref = fetch_ref;
582 walker->prefetch = prefetch;
583 walker->cleanup = cleanup;
584 walker->data = data;
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
585
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
586 #ifdef USE_CURL_MULTI
587 add_fill_function(walker, (int (*)(void *)) fill_active_slot);
588 #endif
8e29f6a0 » Petr Baudis
2006-07-27 Teach git-http-fetch the --stdin switch
589
30ae764b » Daniel Barkalow
2007-09-10 Modularize commit-walker
590 return walker;
6eb7ed54 » Daniel Barkalow
2005-04-23 [PATCH] Various transport programs
591 }
Something went wrong with that request. Please try again.