[Pkg-ocaml-maint-commits] [SCM] approx upstream and debian packaging branch, upstream, updated. upstream/3.5-26-g8610af2

Eric Cooper ecc at cmu.edu
Thu Jun 11 22:24:30 UTC 2009


The following commit has been merged in the upstream branch:
commit 4403363e2f10e8dddbbc9adb4ce11b9a8b8abc9f
Author: Eric Cooper <ecc at cmu.edu>
Date:   Mon Jun 1 16:48:51 2009 -0400

    support https in URLs
    
    patch from Andres Salomon <dilinger at collabora.co.uk>
    closes: #531218

diff --git a/approx.ml b/approx.ml
index 58c1f1c..f7fc677 100644
--- a/approx.ml
+++ b/approx.ml
@@ -294,7 +294,7 @@ let process_body resp cgi str pos len =
       cgi#output#really_output str pos len
   end
 
-(* Download a file from an HTTP repository *)
+(* Download a file from an HTTP or HTTPS repository *)
 
 let download_http resp url name ims cgi =
   let headers =
@@ -336,7 +336,7 @@ let download_ftp resp url name ims cgi =
 let download_url url name ims cgi =
   let dl =
     match Url.protocol url with
-    | Url.HTTP -> download_http
+    | Url.HTTP | Url.HTTPS -> download_http
     | Url.FTP | Url.FILE -> download_ftp
   in
   let resp = new_response url name in
diff --git a/url.ml b/url.ml
index 88376ab..bdf15d0 100644
--- a/url.ml
+++ b/url.ml
@@ -24,12 +24,13 @@ let translate_file file =
   let dist, path = split_cache_path file in
   Config_file.get dist ^/ path
 
-type protocol = HTTP | FTP | FILE
+type protocol = HTTP | HTTPS | FTP | FILE
 
 let protocol url =
   try
     match String.lowercase (substring url ~until: (String.index url ':')) with
     | "http" -> HTTP
+    | "https" -> HTTPS
     | "ftp" -> FTP
     | "file" -> FILE
     | proto -> invalid_arg ("unsupported URL protocol " ^ proto)
diff --git a/url.mli b/url.mli
index 6e4834c..a8188cd 100644
--- a/url.mli
+++ b/url.mli
@@ -12,7 +12,7 @@ val translate_request : string -> string * string
 
 val translate_file : string -> string
 
-type protocol = HTTP | FTP | FILE
+type protocol = HTTP | HTTPS | FTP | FILE
 
 val protocol : string -> protocol
 

-- 
approx upstream and debian packaging



More information about the Pkg-ocaml-maint-commits mailing list