X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fgetter%2FclientHTTP.ml;h=a7b36982c7d55a5d5edfc4ca8a52dde282a77ce0;hb=0c6a5aadb1a7746681a8e26fc0b009f847c10557;hp=7d57c0b575ef3669ac260a707311defb257f2156;hpb=208414d8939d67857f2a01218f2695f45172f118;p=helm.git diff --git a/helm/ocaml/getter/clientHTTP.ml b/helm/ocaml/getter/clientHTTP.ml index 7d57c0b57..a7b36982c 100644 --- a/helm/ocaml/getter/clientHTTP.ml +++ b/helm/ocaml/getter/clientHTTP.ml @@ -23,20 +23,20 @@ * http://cs.unibo.it/helm/. *) -exception HttpClientError of exn * string;; +exception HttpClientError of string * string;; (* reason, uri *) let send cmd = try - ignore (Http_client.Convenience.http_get cmd) + ignore (Http_client.http_get cmd) with - e -> raise (HttpClientError (e,cmd)) + e -> raise (HttpClientError (Printexc.to_string e, cmd)) ;; let get uri = try - Http_client.Convenience.http_get uri + Http_client.http_get uri with - e -> raise (HttpClientError (e,uri)) + e -> raise (HttpClientError (Printexc.to_string e, uri)) ;; let get_and_save uri dest_filename = @@ -54,9 +54,11 @@ let get_and_save_to_tmp uri = done ; cs in - let user = try Sys.getenv "USER" ^ "_" with Not_found -> "" in - (* FG: Unix.getlogin () should be used instead of the above *) - let tmp_file = Configuration.tmp_dir ^ "/" ^ user ^ (flat_string uri ".-=:;!?/&" '_') in + let user = try Unix.getlogin () with _ -> "" in + let tmp_file = + Filename.temp_file (user ^ flat_string uri ".-=:;!?/&" '_') "" + in get_and_save uri tmp_file ; tmp_file ;; +