summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e0306a)
raw | patch | inline | side by side (parent: 5e0306a)
author | Nick Hengeveld <nickh@reactrix.com> | |
Mon, 7 Nov 2005 19:39:37 +0000 (11:39 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 7 Nov 2005 21:29:39 +0000 (13:29 -0800) |
Remember object directories known to exist in the remote repo and don't
bother trying to create them.
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
bother trying to create them.
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
http-push.c | patch | blob | history |
diff --git a/http-push.c b/http-push.c
index 89fda42efb678d2f9f9e802454fe561b4452a167..8e953a67596cf0f5c12f2d8c66055759a7d2201c 100644 (file)
--- a/http-push.c
+++ b/http-push.c
static int data_received;
static int pushing = 0;
static int aborted = 0;
+static char remote_dir_exists[256];
#ifdef USE_CURL_MULTI
static int max_requests = -1;
if (request->http_code == 404) {
request->state = NEED_PUSH;
} else if (request->curl_result == CURLE_OK) {
+ remote_dir_exists[request->sha1[0]] = 1;
request->state = COMPLETE;
} else {
fprintf(stderr, "HEAD %s failed, aborting (%d/%ld)\n",
} else if (request->state == RUN_MKCOL) {
if (request->curl_result == CURLE_OK ||
request->http_code == 405) {
+ remote_dir_exists[request->sha1[0]] = 1;
start_put(request);
} else {
fprintf(stderr, "MKCOL %s failed, aborting (%d/%ld)\n",
start_check(request);
curl_multi_perform(curlm, &num_transfers);
} else if (pushing && request->state == NEED_PUSH) {
- start_mkcol(request);
+ if (remote_dir_exists[request->sha1[0]])
+ start_put(request);
+ else
+ start_mkcol(request);
curl_multi_perform(curlm, &num_transfers);
}
request = request->next;
break;
}
+ memset(remote_dir_exists, 0, 256);
+
curl_global_init(CURL_GLOBAL_ALL);
#ifdef USE_CURL_MULTI