git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Use local structs for HTTP slot callback data

From
NHNick Hengeveld <nickh@reactrix.com>
Date
Feb 1, 2006, 02:00 UTC
Message-ID
<20060201020037.GG3873@reactrix.com>

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>
---
 http-fetch.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
6146f9e8be9d4bb49b7008af5b99853ee7c0afc1
diff --git a/http-fetch.c b/http-fetch.c
index 92326f9..97ce13c 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -375,7 +375,7 @@ static int fetch_index(struct alt_base *
 
 	FILE *indexfile;
 	struct active_request_slot *slot;
-	static struct slot_results results;
+	struct slot_results results;
 
 	if (has_pack_index(sha1))
 		return 0;
@@ -555,7 +555,7 @@ static void fetch_alternates(char *base)
 	char *url;
 	char *data;
 	struct active_request_slot *slot;
-	static struct alternates_request alt_req;
+	struct alternates_request alt_req;
 
 	/* If another request has already started fetching alternates,
 	   wait for them to arrive and return to processing this request's
@@ -618,7 +618,7 @@ static int fetch_indices(struct alt_base
 	int i = 0;
 
 	struct active_request_slot *slot;
-	static struct slot_results results;
+	struct slot_results results;
 
 	if (repo->got_indices)
 		return 0;
@@ -699,7 +699,7 @@ static int fetch_pack(struct alt_base *r
 	struct curl_slist *range_header = NULL;
 
 	struct active_request_slot *slot;
-	static struct slot_results results;
+	struct slot_results results;
 
 	if (fetch_indices(repo))
 		return -1;
@@ -900,7 +900,7 @@ int fetch_ref(char *ref, unsigned char *
         struct buffer buffer;
 	char *base = alt->base;
 	struct active_request_slot *slot;
-	static struct slot_results results;
+	struct slot_results results;
         buffer.size = 41;
         buffer.posn = 0;
         buffer.buffer = hex;
-- 
1.1.6.g1417-dirty
Message 1 of 1 in “Use local structs for HTTP slot callback data”
  1. Use local structs for HTTP slot callback dataNick Hengeveld, Feb 1, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.