search for: args_of_proxy

Displaying 12 results from an estimated 12 matches for "args_of_proxy".

2016 Jul 07
0
[PATCH v2 2/8] curl: Change the API to use an abstract data type.
Change the Curl module to use an ADT to store the name of the curl binary and the arguments. Also add Curl.safe_args, a list of arguments that control redirects etc. The callers in virt-v2v are changed accordingly. There is also a (currently unused) args_of_proxy function allowing proxy parameters to be set. --- mllib/curl.ml | 48 ++++++++++++++++++++++++++++++----------- mllib/curl.mli | 60 ++++++++++++++++++++++++++++++++++++++++++++-------- v2v/copy_to_local.ml | 14 ++++++------ v2v/vCenter.ml | 16 ++++++++------ 4 files changed,...
2019 Jan 16
0
[PATCH 4/5] mltools: curl: turn Curl.run to raise exceptions
...or (f_"curl error: failed to download ā€˜%sā€™, error code %d") url code + in + run_main_and_handle_errors main_wrap diff --git a/common/mltools/curl.ml b/common/mltools/curl.ml index 6dba97534..eb32a4748 100644 --- a/common/mltools/curl.ml +++ b/common/mltools/curl.ml @@ -40,6 +40,8 @@ let args_of_proxy = function | SystemProxy -> [] | ForcedProxy url -> [ "proxy", Some url; "noproxy", Some "" ] +exception Curl_failed of (int * string) (* exit code, URL *) + let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args = let args = sa...
2016 Jul 07
0
[PATCH v3 2/8] curl: Change the API to use an abstract data type.
...+type t = { + curl : string; + args : args; +} +and args = (string * string option) list + +let safe_args = [ + "max-redirs", Some "5"; + "globoff", None; (* Don't glob URLs. *) +] + +type proxy = UnsetProxy | SystemProxy | ForcedProxy of string + +let args_of_proxy = function + | UnsetProxy -> [ "proxy", Some "" ; "noproxy", Some "*" ] + | SystemProxy -> [] + | ForcedProxy url -> [ "proxy", Some url; "noproxy", Some "" ] + +let create ?(curl = "curl") ?(proxy...
2016 Oct 25
2
[PATCH v2 1/2] mllib: curl: add optional tmpdir parameter
...ff --git a/mllib/curl.ml b/mllib/curl.ml index 376406e..baa75ec 100644 --- a/mllib/curl.ml +++ b/mllib/curl.ml @@ -25,6 +25,7 @@ let quote = Filename.quote type t = { curl : string; args : args; + tmpdir : string option; } and args = (string * string option) list @@ -40,12 +41,13 @@ let args_of_proxy = function | SystemProxy -> [] | ForcedProxy url -> [ "proxy", Some url; "noproxy", Some "" ] -let create ?(curl = "curl") ?(proxy = SystemProxy) args = +let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args = let args...
2016 Jul 07
4
[PATCH 0/3] Move Curl wrapper to mllib and use it for virt-builder.
Move the Curl wrapper module from virt-v2v to mllib. Use the module when virt-builder issues curl calls. Rich.
2016 Oct 24
2
[PATCH 1/2] mllib: curl: add optional tmpdir parameter
...ff --git a/mllib/curl.ml b/mllib/curl.ml index 376406e..7d07125 100644 --- a/mllib/curl.ml +++ b/mllib/curl.ml @@ -25,6 +25,7 @@ let quote = Filename.quote type t = { curl : string; args : args; + tmpdir : string option; } and args = (string * string option) list @@ -40,12 +41,13 @@ let args_of_proxy = function | SystemProxy -> [] | ForcedProxy url -> [ "proxy", Some url; "noproxy", Some "" ] -let create ?(curl = "curl") ?(proxy = SystemProxy) args = +let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args = let args...
2019 Jan 16
10
[PATCH 0/5] [RFC] builder: handle unavailable repos
In case a repository of virt-builder references files (e.g. the index) that cannot be downloaded (network issues, 404, etc) then virt-builder errors out on this situation. This is not a nice situation, from an user POV. This series does some refactoring to allow to better handle downloading failures, and handle the failures gracefully in virt-builder. RFC because I'm not yet too convinced
2016 Jul 07
9
[PATCH v2 0/8] v2v: Move Curl wrapper to mllib and use it for virt-builder (and more).
v1 -> v2: - Fixed the bug with precedence of if / @. - Add some imperative list operators inspired by Perl, and use those for constructing the Curl arguments, and more. Rich.
2016 Jul 07
0
[PATCH 3/3] builder: Use the new Curl module for passing parameters to curl.
...v = proxy_envvar protocol proxy in + + (* Any other protocol. *) + | _ -> + let common_args = + Curl.safe_args @ + [ "location", None ] @ (* Follow 3XX redirects. *) + match proxy with + | None (* system proxy settings *) -> [] + | Some proxy -> Curl.args_of_proxy proxy in + + let quiet_args = [ "silent", None; "show-error", None ] in + (* Get the status code first to ensure the file exists. *) - let cmd = sprintf "%s%s%s -L --max-redirs 5 -g -o /dev/null -I -w '%%{http_code}' %s" - outenv - t.curl -...
2016 Jul 07
12
[PATCH v3 0/8] v2v: Move Curl wrapper to mllib and more.
v2 -> v3: - Changes to the Curl API suggested by Pino.
2017 Oct 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...re_trailing_slash uri in diff --git a/common/mltools/curl.ml b/common/mltools/curl.ml index 85fe1a8b2..e2bd0c283 100644 --- a/common/mltools/curl.ml +++ b/common/mltools/curl.ml @@ -44,7 +44,7 @@ let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args = let args = safe_args @ args_of_proxy proxy @ args in { curl = curl; args = args; tmpdir = tmpdir } -let run { curl = curl; args = args; tmpdir = tmpdir } = +let run { curl; args; tmpdir } = let config_file, chan = Filename.open_temp_file ?temp_dir:tmpdir "guestfscurl" ".conf" in List.iter ( @@ -75,7...
2017 Oct 04
11
[PATCH 0/9] build: Require OCaml >= 4.02.
Per my previous email: https://www.redhat.com/archives/libguestfs/2017-September/msg00203.html I'd like to talk about requiring a more modern version of the OCaml compiler. These commits show some of the code changes which would be possible with OCaml >= 3.12 [which it turns out we already require by accident] and also with OCaml >= 4.02. The latter is my favoured option. Rich.