]> matita.cs.unibo.it Git - helm.git/commitdiff
Dependency on ocaml_http replaced by ocaml_http_stubs stubs
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 5 Jan 2023 20:56:17 +0000 (21:56 +0100)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 5 Jan 2023 20:56:17 +0000 (21:56 +0100)
- the stubs always fail with an assert false
- the code is still live in Matita, but currently unused in practice
- ocaml_http depends on ocamlnet, that is way too hard to port completely
  to ocaml 5.0.0. A better path to restore the lost functionalities is
  to reimplement ocaml_http_stubs on modern libraries (e.g. lwt-cohttp)

matita/components/ocaml_http_stubs/README [new file with mode: 0644]
matita/components/ocaml_http_stubs/dune [new file with mode: 0644]
matita/components/ocaml_http_stubs/http_daemon.ml [new file with mode: 0644]
matita/components/ocaml_http_stubs/http_daemon.mli [new file with mode: 0644]
matita/components/ocaml_http_stubs/http_types.mli [new file with mode: 0644]
matita/components/ocaml_http_stubs/http_user_agent.ml [new file with mode: 0644]
matita/components/ocaml_http_stubs/http_user_agent.mli [new file with mode: 0644]
matita/dune-project
matita/matita.opam

diff --git a/matita/components/ocaml_http_stubs/README b/matita/components/ocaml_http_stubs/README
new file mode 100644 (file)
index 0000000..7c9b604
--- /dev/null
@@ -0,0 +1,7 @@
+This is a stub library for Zacchiroli's ocaml-http library.
+All the stubs, if called, just abort the program.
+The interface files are a minimal, proper subset of the ones of ocaml-http
+that only list the values used by matita.
+
+ocaml-http is copyrighted under the GNU Library General Public License as
+published by the Free Software Foundation, version 2.
diff --git a/matita/components/ocaml_http_stubs/dune b/matita/components/ocaml_http_stubs/dune
new file mode 100644 (file)
index 0000000..34c1e99
--- /dev/null
@@ -0,0 +1,12 @@
+(library
+ (name http)
+ ;(libraries)
+ ;(modules (:standard \ componentsConf))
+ (modules_without_implementation http_types)
+ (wrapped false))
+(env
+ (_
+  (flags (:standard -w -27))))
+;(env
+  ;(_
+    ;(flags (:standard -w @A-52-4-34-37-45-9-44-48-6-32-20-58-7-57-3-68-69-70-50))))
diff --git a/matita/components/ocaml_http_stubs/http_daemon.ml b/matita/components/ocaml_http_stubs/http_daemon.ml
new file mode 100644 (file)
index 0000000..9e046cd
--- /dev/null
@@ -0,0 +1,5 @@
+let send_basic_headers ?version ~code _ = assert false
+
+let send_headers ~headers _ = assert false
+
+let send_CRLF _ = assert false
diff --git a/matita/components/ocaml_http_stubs/http_daemon.mli b/matita/components/ocaml_http_stubs/http_daemon.mli
new file mode 100644 (file)
index 0000000..e30f398
--- /dev/null
@@ -0,0 +1,13 @@
+(* The interface of this stub file is taken from the equally named module
+   of the ocaml-http library *)
+
+val send_basic_headers:
+ ?version: Http_types.version -> code:Http_types.status_code ->
+  out_channel ->
+    unit
+
+val send_headers:
+ headers:(string * string) list -> out_channel -> unit
+
+val send_CRLF:
+  out_channel -> unit
diff --git a/matita/components/ocaml_http_stubs/http_types.mli b/matita/components/ocaml_http_stubs/http_types.mli
new file mode 100644 (file)
index 0000000..356d2d9
--- /dev/null
@@ -0,0 +1,6 @@
+(* The interface of this stub file is taken from the equally named module
+   of the ocaml-http library *)
+
+type version
+type status
+type status_code = [ `Code of int | `Status of status ]
diff --git a/matita/components/ocaml_http_stubs/http_user_agent.ml b/matita/components/ocaml_http_stubs/http_user_agent.ml
new file mode 100644 (file)
index 0000000..90c6dee
--- /dev/null
@@ -0,0 +1,7 @@
+exception Http_error of (int * string)
+
+let get ?head_callback _ = assert false
+
+let get_iter ?head_callback _ _ = assert false
+
+let head _ = assert false
diff --git a/matita/components/ocaml_http_stubs/http_user_agent.mli b/matita/components/ocaml_http_stubs/http_user_agent.mli
new file mode 100644 (file)
index 0000000..af818b1
--- /dev/null
@@ -0,0 +1,16 @@
+(* The interface of this stub file is taken from the equally named module
+   of the ocaml-http library *)
+
+exception Http_error of (int * string)
+
+val get:
+ ?head_callback:(Http_types.status -> (string * string) list -> unit) ->
+  string ->
+    string
+
+val get_iter:
+ ?head_callback:(Http_types.status -> (string * string) list -> unit) ->
+  (bytes -> unit) -> string ->
+    unit
+
+val head: string -> string
index 1efcd6a16d5233b7029617f8afa2c3ca8bb6c435..160e70a8aa6d21b58300df74f7f8e9bb7212e9f4 100644 (file)
@@ -33,8 +33,9 @@
    (ulex-camlp5 (>= 1.3))
    (ocaml-expat (>= 1.1.0))
    (pcre (>= 7.5.0))
-   (ocamlnet (>= 4.1.9.git)) ; used only by ocaml-http
-   (ocaml-http (>= 0.1.6))
+   ;(ocamlnet (>= 4.1.9.git)) ; used only by ocaml-http
+   ;(ocaml-http (>= 0.1.6))   ; no longer really used, replaced by failing stubs
+                              ; in components/ocaml_http_stubs
    (camlzip (>= 1.11))
    (lablgtk3-sourceview3 (>= 3.1.3))
    dune-build-info
index a16eb59e912c67a60dae712937d4d1bfa3465b4c..37cccbb14e2eaa8853c65c4cc9233d95fb919df1 100644 (file)
@@ -19,8 +19,6 @@ depends: [
   "ulex-camlp5" {>= "1.3"}
   "ocaml-expat" {>= "1.1.0"}
   "pcre" {>= "7.5.0"}
-  "ocamlnet" {>= "4.1.9.git"}
-  "ocaml-http" {>= "0.1.6"}
   "camlzip" {>= "1.11"}
   "lablgtk3-sourceview3" {>= "3.1.3"}
   "dune-build-info"