Skip to content

Commit

Permalink
http: drop "local" member from request struct
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Nov 4, 2011
1 parent df26c47 commit 093c44a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
6 changes: 0 additions & 6 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ struct active_request_slot *get_active_slot(void)

active_requests++;
slot->in_use = 1;
slot->local = NULL;
slot->results = NULL;
slot->finished = NULL;
slot->callback_data = NULL;
Expand Down Expand Up @@ -814,7 +813,6 @@ static int http_request(const char *url, void *result, int target, int options)
headers = curl_slist_append(headers, buf.buf);
strbuf_reset(&buf);
}
slot->local = result;
} else
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION,
fwrite_buffer);
Expand Down Expand Up @@ -856,7 +854,6 @@ static int http_request(const char *url, void *result, int target, int options)
ret = HTTP_START_FAILED;
}

slot->local = NULL;
curl_slist_free_all(headers);
strbuf_release(&buf);

Expand Down Expand Up @@ -1046,7 +1043,6 @@ void release_http_pack_request(struct http_pack_request *preq)
if (preq->packfile != NULL) {
fclose(preq->packfile);
preq->packfile = NULL;
preq->slot->local = NULL;
}
if (preq->range_header != NULL) {
curl_slist_free_all(preq->range_header);
Expand All @@ -1068,7 +1064,6 @@ int finish_http_pack_request(struct http_pack_request *preq)

fclose(preq->packfile);
preq->packfile = NULL;
preq->slot->local = NULL;

lst = preq->lst;
while (*lst != p)
Expand Down Expand Up @@ -1138,7 +1133,6 @@ struct http_pack_request *new_http_pack_request(
}

preq->slot = get_active_slot();
preq->slot->local = preq->packfile;
curl_easy_setopt(preq->slot->curl, CURLOPT_FILE, preq->packfile);
curl_easy_setopt(preq->slot->curl, CURLOPT_WRITEFUNCTION, fwrite);
curl_easy_setopt(preq->slot->curl, CURLOPT_URL, preq->url);
Expand Down
1 change: 0 additions & 1 deletion http.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ struct slot_results {

struct active_request_slot {
CURL *curl;
FILE *local;
int in_use;
CURLcode curl_result;
long http_code;
Expand Down

0 comments on commit 093c44a

Please sign in to comment.