summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorLibravatar Tay Ray Chuan <rctay89@gmail.com>2009-06-06 16:43:41 +0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-06-06 10:56:27 -0700
commite917674597cc0b345ad2d6e29fd1a03e1039615a (patch)
tree26e4286aff1bf9b6364e56d21314dde48f45b56d /http-push.c
parenttransport.c::get_refs_via_curl(): do not leak refs_url (diff)
downloadtgif-e917674597cc0b345ad2d6e29fd1a03e1039615a.tar.xz
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 <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c8
1 files changed, 1 insertions, 7 deletions
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;