[PATCH 04/22] http.h: make fill_active_slots a function pointer

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: skimo
Date: Wednesday, May 23, 2007 - 3:22 pm

From: Sven Verdoolaege <skimo@kotnet.org>

This allows us to use the methods provided by http.c
from within libgit, in particular config.c.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
 http-fetch.c |    5 ++++-
 http-push.c  |    5 ++++-
 http.h       |    2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/http-fetch.c b/http-fetch.c
index 09baedc..53fb2a9 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -317,7 +317,7 @@ static void release_object_request(struct object_request *obj_req)
 }
 
 #ifdef USE_CURL_MULTI
-void fill_active_slots(void)
+static void fetch_fill_active_slots(void)
 {
 	struct object_request *obj_req = object_queue_head;
 	struct active_request_slot *slot = active_queue_head;
@@ -1031,6 +1031,9 @@ int main(int argc, const char **argv)
 	}
 	url = argv[arg];
 
+#ifdef USE_CURL_MULTI
+	fill_active_slots = fetch_fill_active_slots;
+#endif
 	http_init();
 
 	no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
diff --git a/http-push.c b/http-push.c
index 79d2c38..8f253fd 100644
--- a/http-push.c
+++ b/http-push.c
@@ -795,7 +795,7 @@ static void finish_request(struct transfer_request *request)
 }
 
 #ifdef USE_CURL_MULTI
-void fill_active_slots(void)
+static void push_fill_active_slots(void)
 {
 	struct transfer_request *request = request_queue_head;
 	struct transfer_request *next;
@@ -2356,6 +2356,9 @@ int main(int argc, char **argv)
 
 	memset(remote_dir_exists, -1, 256);
 
+#ifdef USE_CURL_MULTI
+	fill_active_slots = push_fill_active_slots;
+#endif
 	http_init();
 
 	no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
diff --git a/http.h b/http.h
index 69b6b66..7a41cde 100644
--- a/http.h
+++ b/http.h
@@ -69,7 +69,7 @@ extern void finish_all_active_slots(void);
 extern void release_active_slot(struct active_request_slot *slot);
 
 #ifdef USE_CURL_MULTI
-extern void fill_active_slots(void);
+extern void (*fill_active_slots)(void);
 extern void step_active_slots(void);
 #endif
 
-- 
1.5.2.784.g5532e

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 02/22] Add dump-config, skimo, (Wed May 23, 3:22 pm)
[PATCH 04/22] http.h: make fill_active_slots a function po ..., skimo, (Wed May 23, 3:22 pm)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Wed May 23, 4:40 pm)
Re: [RFC] Fourth round of support for cloning submodules, Junio C Hamano, (Wed May 23, 5:50 pm)
Re: [PATCH 11/22] entry.c: optionally checkout submodules, Shawn O. Pearce, (Thu May 24, 12:18 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 12:22 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 12:24 am)
Re: [PATCH 11/22] entry.c: optionally checkout submodules, Sven Verdoolaege, (Thu May 24, 12:27 am)
Re: [RFC] Fourth round of support for cloning submodules, Shawn O. Pearce, (Thu May 24, 12:29 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 12:36 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 2:35 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 2:41 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 3:51 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 3:54 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 4:02 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 4:16 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 4:31 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 4:43 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 5:16 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 5:39 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 6:11 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 6:13 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 6:17 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 6:24 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 6:52 am)
Re: [RFC] Fourth round of support for cloning submodules, Junio C Hamano, (Thu May 24, 10:13 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 10:38 am)
Re: [RFC] Fourth round of support for cloning submodules, Linus Torvalds, (Thu May 24, 10:40 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 10:42 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Thu May 24, 10:55 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 11:07 am)
Re: [RFC] Fourth round of support for cloning submodules, Linus Torvalds, (Thu May 24, 11:09 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 11:11 am)
Re: [RFC] Fourth round of support for cloning submodules, Junio C Hamano, (Thu May 24, 11:38 am)
Re: [RFC] Fourth round of support for cloning submodules, Junio C Hamano, (Thu May 24, 11:45 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Thu May 24, 12:25 pm)
Re: [PATCH 11/22] entry.c: optionally checkout submodules, Shawn O. Pearce, (Thu May 24, 5:49 pm)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Fri May 25, 3:00 am)
Re: [RFC] Fourth round of support for cloning submodules, Josef Weidendorfer, (Fri May 25, 5:27 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Fri May 25, 5:44 am)
Re: [RFC] Fourth round of support for cloning submodules, Josef Weidendorfer, (Fri May 25, 6:59 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Fri May 25, 7:16 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Fri May 25, 7:38 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Fri May 25, 7:51 am)
Re: [RFC] Fourth round of support for cloning submodules, Josef Weidendorfer, (Fri May 25, 7:51 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Fri May 25, 7:54 am)
Re: [RFC] Fourth round of support for cloning submodules, Linus Torvalds, (Fri May 25, 8:35 am)
Re: [RFC] Fourth round of support for cloning submodules, Junio C Hamano, (Fri May 25, 9:16 am)
Re: [RFC] Fourth round of support for cloning submodules, Josef Weidendorfer, (Fri May 25, 9:23 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Fri May 25, 9:28 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Fri May 25, 9:37 am)
Re: [RFC] Fourth round of support for cloning submodules, Johannes Schindelin, (Fri May 25, 9:43 am)
Re: [RFC] Fourth round of support for cloning submodules, Josef Weidendorfer, (Fri May 25, 10:09 am)
Re: [RFC] Fourth round of support for cloning submodules, Sven Verdoolaege, (Sun May 27, 1:40 pm)