Merge branch 'nh/http'
* nh/http: http-push: cleanup http-push: support for updating remote info/refs http-push: improve remote lock management http-push: refactor remote file/directory processing HTTP slot reuse fixes http-push: fix revision walkmaint
commit
2e158bee7a
1001
http-push.c
1001
http-push.c
File diff suppressed because it is too large
Load Diff
8
http.c
8
http.c
|
@ -339,6 +339,7 @@ struct active_request_slot *get_active_slot(void)
|
||||||
slot->in_use = 1;
|
slot->in_use = 1;
|
||||||
slot->local = NULL;
|
slot->local = NULL;
|
||||||
slot->results = NULL;
|
slot->results = NULL;
|
||||||
|
slot->finished = NULL;
|
||||||
slot->callback_data = NULL;
|
slot->callback_data = NULL;
|
||||||
slot->callback_func = NULL;
|
slot->callback_func = NULL;
|
||||||
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, pragma_header);
|
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;
|
fd_set excfds;
|
||||||
int max_fd;
|
int max_fd;
|
||||||
struct timeval select_timeout;
|
struct timeval select_timeout;
|
||||||
|
int finished = 0;
|
||||||
|
|
||||||
while (slot->in_use) {
|
slot->finished = &finished;
|
||||||
|
while (!finished) {
|
||||||
data_received = 0;
|
data_received = 0;
|
||||||
step_active_slots();
|
step_active_slots();
|
||||||
|
|
||||||
|
@ -442,6 +445,9 @@ static void finish_active_slot(struct active_request_slot *slot)
|
||||||
closedown_active_slot(slot);
|
closedown_active_slot(slot);
|
||||||
curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE, &slot->http_code);
|
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 */
|
/* Store slot results so they can be read after the slot is reused */
|
||||||
if (slot->results != NULL) {
|
if (slot->results != NULL) {
|
||||||
slot->results->curl_result = slot->curl_result;
|
slot->results->curl_result = slot->curl_result;
|
||||||
|
|
1
http.h
1
http.h
|
@ -35,6 +35,7 @@ struct active_request_slot
|
||||||
int in_use;
|
int in_use;
|
||||||
CURLcode curl_result;
|
CURLcode curl_result;
|
||||||
long http_code;
|
long http_code;
|
||||||
|
int *finished;
|
||||||
struct slot_results *results;
|
struct slot_results *results;
|
||||||
void *callback_data;
|
void *callback_data;
|
||||||
void (*callback_func)(void *data);
|
void (*callback_func)(void *data);
|
||||||
|
|
Loading…
Reference in New Issue