http: init and cleanup separately from http-walker

Previously, all our http operations were done with http-walker. With the
new remote-curl helper, we find ourselves using http methods outside of
http-walker - for example, fetching info/refs.

Accomodate this by separating http_init() and http_cleanup() invocations
from http-walker.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Tay Ray Chuan
2010-03-02 18:49:29 +08:00
committed by Junio C Hamano
parent 09ae9aca14
commit 888692b733
4 changed files with 12 additions and 8 deletions

View File

@ -559,18 +559,14 @@ static void cleanup(struct walker *walker)
free(data);
walker->data = NULL;
}
http_cleanup();
}
struct walker *get_http_walker(const char *url, struct remote *remote)
struct walker *get_http_walker(const char *url)
{
char *s;
struct walker_data *data = xmalloc(sizeof(struct walker_data));
struct walker *walker = xmalloc(sizeof(struct walker));
http_init(remote);
data->alt = xmalloc(sizeof(*data->alt));
data->alt->base = xmalloc(strlen(url) + 1);
strcpy(data->alt->base, url);