From e917674597cc0b345ad2d6e29fd1a03e1039615a Mon Sep 17 00:00:00 2001 From: Tay Ray Chuan Date: Sat, 6 Jun 2009 16:43:41 +0800 Subject: http*: move common variables and macros to http.[ch] Move RANGE_HEADER_SIZE to http.h. Create no_pragma_header, the curl header list containing the header "Pragma:" in http.[ch]. It is allocated in http_init, and freed in http_cleanup. This replaces the no_pragma_header in http-push.c, and the no_pragma_header member in walker_data in http-walker.c. Create http_is_verbose. It is to be used by methods in http.c, and is modified at the entry points of http.c's users, namely http-push.c (when parsing options) and http-walker.c (in get_http_walker). Signed-off-by: Tay Ray Chuan Signed-off-by: Junio C Hamano --- http-push.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'http-push.c') diff --git a/http-push.c b/http-push.c index 281e153eb3..f18da2a263 100644 --- a/http-push.c +++ b/http-push.c @@ -27,7 +27,6 @@ enum XML_Status { #endif #define PREV_BUF_SIZE 4096 -#define RANGE_HEADER_SIZE 30 /* DAV methods */ #define DAV_LOCK "LOCK" @@ -76,8 +75,6 @@ static int pushing; static int aborted; static signed char remote_dir_exists[256]; -static struct curl_slist *no_pragma_header; - static int push_verbosely; static int push_all = MATCH_REFS_NONE; static int force_all; @@ -2250,6 +2247,7 @@ int main(int argc, char **argv) } if (!strcmp(arg, "--verbose")) { push_verbosely = 1; + http_is_verbose = 1; continue; } if (!strcmp(arg, "-d")) { @@ -2299,8 +2297,6 @@ int main(int argc, char **argv) remote->url[remote->url_nr++] = repo->url; http_init(remote); - no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:"); - if (repo->url && repo->url[strlen(repo->url)-1] != '/') { rewritten_url = xmalloc(strlen(repo->url)+2); strcpy(rewritten_url, repo->url); @@ -2503,8 +2499,6 @@ int main(int argc, char **argv) unlock_remote(info_ref_lock); free(repo); - curl_slist_free_all(no_pragma_header); - http_cleanup(); request = request_queue_head; -- cgit v1.2.3