From ac7687ce66526f905874ed99a845223c853c558a Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Tue, 2 Nov 2004 11:46:34 +0000 Subject: [PATCH] renamed Http_client to Http_user_agent to avoid clashes with Gerd's netclient since both Netclient and ocaml-http are used, believe it or not, by xmlrpc --- helm/DEVEL/ocaml-http/.depend | 8 ++++---- helm/DEVEL/ocaml-http/Makefile | 4 ++-- helm/DEVEL/ocaml-http/debian/changelog | 6 +++++- .../ocaml-http/{http_client.ml => http_user_agent.ml} | 8 ++++---- .../ocaml-http/{http_client.mli => http_user_agent.mli} | 6 +++--- 5 files changed, 18 insertions(+), 14 deletions(-) rename helm/DEVEL/ocaml-http/{http_client.ml => http_user_agent.ml} (96%) rename helm/DEVEL/ocaml-http/{http_client.mli => http_user_agent.mli} (93%) diff --git a/helm/DEVEL/ocaml-http/.depend b/helm/DEVEL/ocaml-http/.depend index ab21af903..db4ea67e1 100644 --- a/helm/DEVEL/ocaml-http/.depend +++ b/helm/DEVEL/ocaml-http/.depend @@ -1,7 +1,3 @@ -http_client.cmo: http_common.cmi http_misc.cmi http_parser.cmi \ - http_client.cmi -http_client.cmx: http_common.cmx http_misc.cmx http_parser.cmx \ - http_client.cmi http_common.cmo: http_constants.cmi http_types.cmo http_common.cmi http_common.cmx: http_constants.cmx http_types.cmx http_common.cmi http_constants.cmo: http_constants.cmi @@ -36,6 +32,10 @@ http_response.cmx: http_common.cmx http_constants.cmx http_daemon.cmx \ http_message.cmx http_misc.cmx http_types.cmx http_response.cmi http_tcp_server.cmo: http_threaded_tcp_server.cmi http_tcp_server.cmi http_tcp_server.cmx: http_threaded_tcp_server.cmi http_tcp_server.cmi +http_user_agent.cmo: http_common.cmi http_misc.cmi http_parser.cmi \ + http_user_agent.cmi +http_user_agent.cmx: http_common.cmx http_misc.cmx http_parser.cmx \ + http_user_agent.cmi http_common.cmi: http_types.cmo http_constants.cmi: http_types.cmo http_daemon.cmi: http_types.cmo diff --git a/helm/DEVEL/ocaml-http/Makefile b/helm/DEVEL/ocaml-http/Makefile index 943174225..adc4627d8 100644 --- a/helm/DEVEL/ocaml-http/Makefile +++ b/helm/DEVEL/ocaml-http/Makefile @@ -3,14 +3,14 @@ include Makefile.defs MODULES = \ http_types http_constants http_parser_sanity http_misc http_common \ http_tcp_server http_parser http_message http_request http_daemon \ - http_response http_client + http_response http_user_agent THREADED_SRV = http_threaded_tcp_server MODULES_MT = $(patsubst http_tcp_server, mt/$(THREADED_SRV) http_tcp_server, $(MODULES)) MODULES_NON_MT = $(patsubst http_tcp_server, non_mt/$(THREADED_SRV) http_tcp_server, $(MODULES)) PUBLIC_MODULES = \ http_common http_message http_request http_daemon http_response \ - http_client + http_user_agent PUBLIC_IMPL = http_types OCAMLDOC_STUFF = *.mli $(patsubst %, %.ml, $(PUBLIC_IMPL)) DOCDIR = doc/html diff --git a/helm/DEVEL/ocaml-http/debian/changelog b/helm/DEVEL/ocaml-http/debian/changelog index 626ce1dc6..811a71b02 100644 --- a/helm/DEVEL/ocaml-http/debian/changelog +++ b/helm/DEVEL/ocaml-http/debian/changelog @@ -1,6 +1,10 @@ ocaml-http (0.0.10) unstable; urgency=low - * rebuilt for ocaml 3.08 + * renamed Http_client module to Http_user_agent to avoid compatibility + issues with Netclient. Renamed that module functions removing + "http_" prefix (e.g., summarizing, Http_client.http_get -> + Http_user_agent.get) + * ported to ocaml 3.08 * debian/control - bumped standards version to 3.6.1.1 - changed deps to ocaml 3.08 and -nox diff --git a/helm/DEVEL/ocaml-http/http_client.ml b/helm/DEVEL/ocaml-http/http_user_agent.ml similarity index 96% rename from helm/DEVEL/ocaml-http/http_client.ml rename to helm/DEVEL/ocaml-http/http_user_agent.ml index 1a89bba8a..5e74fbfaf 100644 --- a/helm/DEVEL/ocaml-http/http_client.ml +++ b/helm/DEVEL/ocaml-http/http_user_agent.ml @@ -61,7 +61,7 @@ let submit_request kind url = flush outchan; (inchan, outchan) -let http_head url = +let head url = let (inchan, outchan) = submit_request `HEAD url in let (_, status) = Http_parser.parse_response_fst_line inchan in (match code_of_status status with @@ -71,7 +71,7 @@ let http_head url = close_in inchan; (* close also outchan, same fd *) Buffer.contents buf -let http_get_iter callback url = +let get_iter callback url = let (inchan, outchan) = submit_request `GET url in let buf = String.create tcp_bufsiz in let (_, status) = Http_parser.parse_response_fst_line inchan in @@ -93,8 +93,8 @@ let http_get_iter callback url = with End_of_file -> ()); close_in inchan (* close also outchan, same fd *) -let http_get url = +let get url = let buf = Buffer.create 10240 in - http_get_iter (Buffer.add_string buf) url; + get_iter (Buffer.add_string buf) url; Buffer.contents buf diff --git a/helm/DEVEL/ocaml-http/http_client.mli b/helm/DEVEL/ocaml-http/http_user_agent.mli similarity index 93% rename from helm/DEVEL/ocaml-http/http_client.mli rename to helm/DEVEL/ocaml-http/http_user_agent.mli index 3b66f2ebf..580324677 100644 --- a/helm/DEVEL/ocaml-http/http_client.mli +++ b/helm/DEVEL/ocaml-http/http_user_agent.mli @@ -30,14 +30,14 @@ exception Http_error of (int * string) (* code, body *) (** @param url an HTTP url * @return HTTP response's body * @raise Http_error when response code <> 200 *) -val http_get: string -> string +val get: string -> string (** as above but iter callback function on HTTP response's body instead of * returning it as a string *) -val http_get_iter: (string -> unit) -> string -> unit +val get_iter: (string -> unit) -> string -> unit (** @param url an HTTP url * @return HTTP HEAD raw response * @raise Http_error when response code <> 200 *) -val http_head: string -> string +val head: string -> string -- 2.39.2