summaryrefslogtreecommitdiff
path: root/http-fetch.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2005-11-06 23:59:39 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-07 02:31:47 (GMT)
commit90279074ca5cc336a8bfffd47d19d089b291b432 (patch)
treee76c7c8b9b08165ae63c0d8796c4b0a1313d76c1 /http-fetch.c
parent67ffdf4c0af47679b8a4ac2b70e722e2f65fc4f9 (diff)
downloadgit-90279074ca5cc336a8bfffd47d19d089b291b432.zip
git-90279074ca5cc336a8bfffd47d19d089b291b432.tar.gz
git-90279074ca5cc336a8bfffd47d19d089b291b432.tar.bz2
http-fetch: do not use curl_message after releasing it
When curl_message is released using curl_multi_remove_handle(), it's contents are undefined. Therefore, get the information before releasing it. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http-fetch.c')
-rw-r--r--http-fetch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/http-fetch.c b/http-fetch.c
index b12779d..ea8af1b 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -578,6 +578,7 @@ void process_curl_messages(void)
while (curl_message != NULL) {
if (curl_message->msg == CURLMSG_DONE) {
+ int curl_result = curl_message->data.result;
slot = active_queue_head;
while (slot != NULL &&
slot->curl != curl_message->easy_handle)
@@ -587,7 +588,7 @@ void process_curl_messages(void)
active_requests--;
slot->done = 1;
slot->in_use = 0;
- slot->curl_result = curl_message->data.result;
+ slot->curl_result = curl_result;
curl_easy_getinfo(slot->curl,
CURLINFO_HTTP_CODE,
&slot->http_code);
@@ -599,8 +600,7 @@ void process_curl_messages(void)
fprintf(stderr, "Received DONE message for unknown request!\n");
}
if (request != NULL) {
- request->curl_result =
- curl_message->data.result;
+ request->curl_result = curl_result;
request->http_code = slot->http_code;
request->slot = NULL;
request->state = COMPLETE;