diff options
author | Nick Hengeveld <nickh@reactrix.com> | 2006-03-10 20:18:01 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-03-10 23:01:48 -0800 |
commit | baa7b67d091acf4c666e79e386712bd5ea79326c (patch) | |
tree | 852116fd35adf81371c03bc50abd272ba2c61da4 /http.c | |
parent | 5241bfe6d1593ad775dd79a5f598f66f479968b5 (diff) | |
download | git-baa7b67d091acf4c666e79e386712bd5ea79326c.tar.gz |
HTTP slot reuse fixes
Incorporate into http-push a fix related to accessing slot results after
the slot was reused, and fix a case in run_active_slot where a
finished slot wasn't detected if the slot was reused.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -339,6 +339,7 @@ struct active_request_slot *get_active_slot(void) slot->in_use = 1; slot->local = NULL; slot->results = NULL; + slot->finished = NULL; slot->callback_data = NULL; slot->callback_func = NULL; curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, pragma_header); @@ -389,8 +390,10 @@ void run_active_slot(struct active_request_slot *slot) fd_set excfds; int max_fd; struct timeval select_timeout; + int finished = 0; - while (slot->in_use) { + slot->finished = &finished; + while (!finished) { data_received = 0; step_active_slots(); @@ -442,6 +445,9 @@ static void finish_active_slot(struct active_request_slot *slot) closedown_active_slot(slot); curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE, &slot->http_code); + if (slot->finished != NULL) + (*slot->finished) = 1; + /* Store slot results so they can be read after the slot is reused */ if (slot->results != NULL) { slot->results->curl_result = slot->curl_result; |