summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorNick Hengeveld <nickh@reactrix.com>2006-01-31 19:06:55 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-01 00:17:24 (GMT)
commitc8568e139ed2149fbfb7ef9a8d819d5b6b7c554f (patch)
treee44ab4d957ab445b6c1e5f3479f8c27c02ce3ab7 /http.c
parent7ec57556b29c3ed42769c122228ee4621676b642 (diff)
downloadgit-c8568e139ed2149fbfb7ef9a8d819d5b6b7c554f.zip
git-c8568e139ed2149fbfb7ef9a8d819d5b6b7c554f.tar.gz
git-c8568e139ed2149fbfb7ef9a8d819d5b6b7c554f.tar.bz2
Fix HTTP request result processing after slot reuse
Add a way to store the results of an HTTP request when a slot finishes so the results can be processed after the slot has been reused. Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http.c')
-rw-r--r--http.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/http.c b/http.c
index 75e6717..eefb0f0 100644
--- a/http.c
+++ b/http.c
@@ -335,6 +335,7 @@ struct active_request_slot *get_active_slot(void)
active_requests++;
slot->in_use = 1;
slot->local = NULL;
+ slot->results = NULL;
slot->callback_data = NULL;
slot->callback_func = NULL;
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, pragma_header);
@@ -421,7 +422,13 @@ static void finish_active_slot(struct active_request_slot *slot)
active_requests--;
slot->in_use = 0;
curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE, &slot->http_code);
-
+
+ /* Store slot results so they can be read after the slot is reused */
+ if (slot->results != NULL) {
+ slot->results->curl_result = slot->curl_result;
+ slot->results->http_code = slot->http_code;
+ }
+
/* Run callback if appropriate */
if (slot->callback_func != NULL) {
slot->callback_func(slot->callback_data);