http: drop "local" member from request struct
This is a FILE pointer in the case that we are sending our output to a file. We originally used it to run ftell() to determine whether data had been written to our file during our last call to curl. However, as of the last patch, we no longer care about that flag anymore. All uses of this struct member are now just book-keeping that can go away. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Nov 4, 2011 at 13:53 UTC
093c44a3600323c3ca7a8d28a0d2ba2bc145dd47
2 files changed
-7
http.c
-6
@@ -523,7 +523,6 @@ struct active_request_slot *get_active_slot(void)
523
524
active_requests++;
525
slot->in_use = 1;
526
- slot->local = NULL;
526
slot->results = NULL;
527
slot->finished = NULL;
528
slot->callback_data = NULL;
@@ -814,7 +813,6 @@ static int http_request(const char *url, void *result, int target, int options)
813
headers = curl_slist_append(headers, buf.buf);
814
strbuf_reset(&buf);
815
}
817
- slot->local = result;
816
} else
817
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION,
818
fwrite_buffer);
@@ -856,7 +854,6 @@ static int http_request(const char *url, void *result, int target, int options)
854
ret = HTTP_START_FAILED;
855
}
856
859
- slot->local = NULL;
857
curl_slist_free_all(headers);
858
strbuf_release(&buf);
859
@@ -1046,7 +1043,6 @@ void release_http_pack_request(struct http_pack_request *preq)
1043
if (preq->packfile != NULL) {
1044
fclose(preq->packfile);
1045
preq->packfile = NULL;
1049
- preq->slot->local = NULL;
1046
}
1047
if (preq->range_header != NULL) {
1048
curl_slist_free_all(preq->range_header);
@@ -1068,7 +1064,6 @@ int finish_http_pack_request(struct http_pack_request *preq)
1064
1065
fclose(preq->packfile);
1066
preq->packfile = NULL;
1071
- preq->slot->local = NULL;
1067
1068
lst = preq->lst;
1069
while (*lst != p)
@@ -1138,7 +1133,6 @@ struct http_pack_request *new_http_pack_request(
1133
}
1134
1135
preq->slot = get_active_slot();
1141
- preq->slot->local = preq->packfile;
1136
curl_easy_setopt(preq->slot->curl, CURLOPT_FILE, preq->packfile);
1137
curl_easy_setopt(preq->slot->curl, CURLOPT_WRITEFUNCTION, fwrite);
1138
curl_easy_setopt(preq->slot->curl, CURLOPT_URL, preq->url);
http.h
-1
@@ -49,7 +49,6 @@ struct slot_results {
49
50
struct active_request_slot {
51
CURL *curl;
52
- FILE *local;
52
int in_use;
53
CURLcode curl_result;
54
long http_code;