Skip to content

Commit 093c44a

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent df26c47 commit 093c44a

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

http.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ struct active_request_slot *get_active_slot(void)
523523

524524
active_requests++;
525525
slot->in_use = 1;
526-
slot->local = NULL;
527526
slot->results = NULL;
528527
slot->finished = NULL;
529528
slot->callback_data = NULL;
@@ -814,7 +813,6 @@ static int http_request(const char *url, void *result, int target, int options)
814813
headers = curl_slist_append(headers, buf.buf);
815814
strbuf_reset(&buf);
816815
}
817-
slot->local = result;
818816
} else
819817
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION,
820818
fwrite_buffer);
@@ -856,7 +854,6 @@ static int http_request(const char *url, void *result, int target, int options)
856854
ret = HTTP_START_FAILED;
857855
}
858856

859-
slot->local = NULL;
860857
curl_slist_free_all(headers);
861858
strbuf_release(&buf);
862859

@@ -1046,7 +1043,6 @@ void release_http_pack_request(struct http_pack_request *preq)
10461043
if (preq->packfile != NULL) {
10471044
fclose(preq->packfile);
10481045
preq->packfile = NULL;
1049-
preq->slot->local = NULL;
10501046
}
10511047
if (preq->range_header != NULL) {
10521048
curl_slist_free_all(preq->range_header);
@@ -1068,7 +1064,6 @@ int finish_http_pack_request(struct http_pack_request *preq)
10681064

10691065
fclose(preq->packfile);
10701066
preq->packfile = NULL;
1071-
preq->slot->local = NULL;
10721067

10731068
lst = preq->lst;
10741069
while (*lst != p)
@@ -1138,7 +1133,6 @@ struct http_pack_request *new_http_pack_request(
11381133
}
11391134

11401135
preq->slot = get_active_slot();
1141-
preq->slot->local = preq->packfile;
11421136
curl_easy_setopt(preq->slot->curl, CURLOPT_FILE, preq->packfile);
11431137
curl_easy_setopt(preq->slot->curl, CURLOPT_WRITEFUNCTION, fwrite);
11441138
curl_easy_setopt(preq->slot->curl, CURLOPT_URL, preq->url);

http.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ struct slot_results {
4949

5050
struct active_request_slot {
5151
CURL *curl;
52-
FILE *local;
5352
int in_use;
5453
CURLcode curl_result;
5554
long http_code;

0 commit comments

Comments
 (0)