Use local structs for HTTP slot callback data
There's no need for these structures to be static, and it could potentially cause problems down the road. Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Nick Hengeveld committed
Jan 31, 2006 at 18:00 UTC
cb754fdf5a742a5479458da84d8f92bce2434ed5
1 file changed
+5
-5
http-fetch.c
+5
-5
@@ -375,7 +375,7 @@ static int fetch_index(struct alt_base *repo, unsigned char *sha1)
375
376
FILE *indexfile;
377
struct active_request_slot *slot;
378
- static struct slot_results results;
378
+ struct slot_results results;
379
380
if (has_pack_index(sha1))
381
return 0;
@@ -555,7 +555,7 @@ static void fetch_alternates(char *base)
555
char *url;
556
char *data;
557
struct active_request_slot *slot;
558
- static struct alternates_request alt_req;
558
+ struct alternates_request alt_req;
559
560
/* If another request has already started fetching alternates,
561
wait for them to arrive and return to processing this request's
@@ -618,7 +618,7 @@ static int fetch_indices(struct alt_base *repo)
618
int i = 0;
619
620
struct active_request_slot *slot;
621
- static struct slot_results results;
621
+ struct slot_results results;
622
623
if (repo->got_indices)
624
return 0;
@@ -699,7 +699,7 @@ static int fetch_pack(struct alt_base *repo, unsigned char *sha1)
699
struct curl_slist *range_header = NULL;
700
701
struct active_request_slot *slot;
702
- static struct slot_results results;
702
+ struct slot_results results;
703
704
if (fetch_indices(repo))
705
return -1;
@@ -900,7 +900,7 @@ int fetch_ref(char *ref, unsigned char *sha1)
900
struct buffer buffer;
901
char *base = alt->base;
902
struct active_request_slot *slot;
903
- static struct slot_results results;
903
+ struct slot_results results;
904
buffer.size = 41;
905
buffer.posn = 0;
906
buffer.buffer = hex;