Merge branch 'jk/maint-http-half-auth-push' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 17 Oct 2012 17:29:24 +0000 (10:29 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Oct 2012 17:29:24 +0000 (10:29 -0700)
* jk/maint-http-half-auth-push:
  http: fix segfault in handle_curl_result

http.c
http.h
remote-curl.c

diff --git a/http.c b/http.c
index 345c171c5fd572e65e34ea421a334141a5438979..df9bb710863e30ba98d7661f84e872b30ed4449e 100644 (file)
--- a/http.c
+++ b/http.c
@@ -745,10 +745,9 @@ char *get_remote_object_url(const char *url, const char *hex,
        return strbuf_detach(&buf, NULL);
 }
 
-int handle_curl_result(struct active_request_slot *slot)
+int handle_curl_result(struct active_request_slot *slot,
+                      struct slot_results *results)
 {
-       struct slot_results *results = slot->results;
-
        if (results->curl_result == CURLE_OK) {
                credential_approve(&http_auth);
                return HTTP_OK;
@@ -822,7 +821,7 @@ static int http_request(const char *url, void *result, int target, int options)
 
        if (start_active_slot(slot)) {
                run_active_slot(slot);
-               ret = handle_curl_result(slot);
+               ret = handle_curl_result(slot, &results);
        } else {
                error("Unable to start HTTP request for %s", url);
                ret = HTTP_START_FAILED;
diff --git a/http.h b/http.h
index 12de25597df4077a52a44dace83093091514c10d..0bd1e849e1406c8c8a822c6ecc6de84d4b5e1798 100644 (file)
--- a/http.h
+++ b/http.h
@@ -78,7 +78,8 @@ extern int start_active_slot(struct active_request_slot *slot);
 extern void run_active_slot(struct active_request_slot *slot);
 extern void finish_active_slot(struct active_request_slot *slot);
 extern void finish_all_active_slots(void);
-extern int handle_curl_result(struct active_request_slot *slot);
+extern int handle_curl_result(struct active_request_slot *slot,
+                             struct slot_results *results);
 
 #ifdef USE_CURL_MULTI
 extern void fill_active_slots(void);
index a2696082fb8881d74de7a2f9c473fb03f82d81ec..468ccef58afbe273bc23bef88b1dfe527989637a 100644 (file)
@@ -355,7 +355,7 @@ static int run_slot(struct active_request_slot *slot)
        slot->curl_result = curl_easy_perform(slot->curl);
        finish_active_slot(slot);
 
-       err = handle_curl_result(slot);
+       err = handle_curl_result(slot, &results);
        if (err != HTTP_OK && err != HTTP_REAUTH) {
                error("RPC failed; result=%d, HTTP code = %ld",
                      results.curl_result, results.http_code);