From: Stefano Zacchiroli Date: Wed, 17 Dec 2003 14:04:28 +0000 (+0000) Subject: use ocaml-http instead of netclient for http requests X-Git-Tag: V_0_5_1_3~58 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=c6eb317ba149b744e63a20b5f93ce64fec254cb4;p=helm.git use ocaml-http instead of netclient for http requests --- diff --git a/helm/uwobo/Makefile b/helm/uwobo/Makefile index b3a989e7e..c2a97d7c5 100644 --- a/helm/uwobo/Makefile +++ b/helm/uwobo/Makefile @@ -1,7 +1,7 @@ VERSION = 0.2.1 DISTDIR = uwobo-$(VERSION) DISTTARBALL = $(DISTDIR).tar.gz -REQUIRES = http gdome2 gdome2-xslt pcre unix netclient +REQUIRES = http gdome2 gdome2-xslt pcre unix COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o OCAMLFIND = ocamlfind OCAMLC = $(OCAMLFIND) ocamlc $(COMMONOPTS) diff --git a/helm/uwobo/uwobo.ml b/helm/uwobo/uwobo.ml index 5d67eacfa..a9755885d 100644 --- a/helm/uwobo/uwobo.ml +++ b/helm/uwobo/uwobo.ml @@ -225,11 +225,11 @@ let start_new_session cmd_pipe res_pipe outchan port logfile = (* Let's check that the port is free *) (try ignore - (Http_client.Convenience.http_head_message + (Http_client.http_get ("http://127.0.0.1:" ^ string_of_int port ^ "/help")) ; raise (Failure "Port already in use") with - Failure "Connection refused" -> () + Unix.Unix_error (Unix.ECONNREFUSED, _, _) -> () ) ; match Unix.fork () with 0 -> @@ -258,9 +258,12 @@ let start_new_session cmd_pipe res_pipe outchan port logfile = (* let's check if the new UWOBO started correctly *) Unix.sleep 5 ; (* It can raise Failure "Connection refused" *) - ignore - (Http_client.Convenience.http_head_message - ("http://127.0.0.1:" ^ string_of_int port ^ "/help")) + (try + ignore + (Http_client.http_get + ("http://127.0.0.1:" ^ string_of_int port ^ "/help")) + with Unix.Unix_error (Unix.ECONNREFUSED, _, _) -> + raise (Failure "Connection refused")) | _ -> failwith "Can't fork :-(" ;;