Permalink
Browse files

Remove `Cohttp_mirage` libraries, which have now moved to

mirage/mirage-http-unix and mirage/mirage-http-xen.

The previous libraries were being inconsistently compiled across
Unix and Xen, and this split is required is disambiguate them.
See mirage/mirage#161 for more information.
  • Loading branch information...
1 parent 8400e38 commit 56a4d3bac1e50ec7c33fc303c030c6b2218d0380 @avsm committed Dec 18, 2013
View
@@ -1,3 +1,6 @@
+0.9.15 (trunk):
+* Remove `Cohttp_mirage` libraries, which have now moved to `mirage/mirage-http-*` on GitHub.
+
0.9.14 (2013-12-15):
* Install a `cohttp-server` binary that serves local directory contents via a web server (#54).
* Add a `flush` function to the `IO` module type and implement in Lwt/Async/Mirage.
View
@@ -3,11 +3,13 @@ HTTP parser, and implementations using various asynchronous programming
libraries:
* `Cohttp_lwt_unix` uses the [Lwt](http://ocsigen.org/lwt) library, and
-specifically the UNIX bindings.
+ specifically the UNIX bindings.
* `Cohttp_async` uses the [Async](https://realworldocaml.org/v1/en/html/concurrent-programming-with-async.html)
-library.
-* `Cohttp_mirage` uses the [Mirage](http://www.openmirage.org) interface
-to generate standalone microkernels.
+ library.
+* `Cohttp_lwt` exposes an OS-independent Lwt interface, which is used
+ by the the [Mirage](http://www.openmirage.org) interface
+ to generate standalone microkernels (see the [xen](https://github.com/mirage/mirage-http-xen)
+ and [unix](https://github.com/mirage/mirage-http-unix) respectively).
You can implement other targets using the parser very easily. Look at the
`lib/IO.mli` signature and implement that in the desired backend.
View
@@ -1,6 +1,6 @@
OASISFormat: 0.3
Name: cohttp
-Version: 0.9.14
+Version: 0.9.15
Synopsis: HTTP library for Lwt, Async and Mirage
Authors: Anil Madhavapeddy, Stefano Zacchiroli, David Sheets, Thomas Gazagnaire, David Scott
License: ISC
@@ -53,24 +53,6 @@ Library cohttp_lwt_unix
BuildDepends: cohttp.lwt-core, unix, lwt.unix, lwt.ssl
Modules: Cohttp_lwt_unix_io, Cohttp_lwt_unix, Cohttp_lwt_unix_net
-Library cohttp_mirage_unix
- Build$: flag(mirage_unix)
- Install$: flag(mirage_unix)
- Path: mirage
- Findlibname: mirage-unix
- FindlibParent: cohttp
- BuildDepends: cohttp.lwt-core, mirage-types, cstruct, mirage-tcpip-unix
- Modules: Cohttp_mirage_io, Cohttp_mirage
-
-Library cohttp_mirage_xen
- Build$: flag(mirage_xen)
- Install$: flag(mirage_xen)
- Path: mirage
- Findlibname: mirage-xen
- FindlibParent: cohttp
- BuildDepends: cohttp.lwt-core, mirage-types, cstruct, mirage-tcpip-xen
- Modules: Cohttp_mirage_io, Cohttp_mirage
-
Library cohttp_async
Build$: flag(async)
Install$: flag(async)
@@ -106,24 +88,6 @@ Document cohttp_async
XOCamlbuildPath: async
XOCamlbuildLibraries: cohttp.async
-Document cohttp_mirage_unix
- Title: Cohttp Mirage docs
- Type: ocamlbuild (0.3)
- BuildTools+: ocamldoc
- Build$: flag(mirage_unix)
- Install: true
- XOCamlbuildPath: mirage
- XOCamlbuildLibraries: cohttp.mirage-unix
-
-Document cohttp_mirage_xen
- Title: Cohttp Mirage docs
- Type: ocamlbuild (0.3)
- BuildTools+: ocamldoc
- Build$: flag(mirage_xen)
- Install: true
- XOCamlbuildPath: mirage
- XOCamlbuildLibraries: cohttp.mirage-xen
-
Executable test_parser
Path: lib_test
MainIs: test_parser.ml
View
@@ -1,5 +1,5 @@
# OASIS_START
-# DO NOT EDIT (digest: 34cfc630efe139056434de798589c0f0)
+# DO NOT EDIT (digest: c6f085d0be63f5d9d1a9cf1fb4ebdfa6)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
@@ -53,23 +53,6 @@
<lwt/*.ml{,i}>: pkg_uri.services
<lwt/*.ml{,i}>: pkg_fieldslib
<lwt/*.ml{,i}>: pkg_fieldslib.syntax
-# Library cohttp_mirage_unix
-"mirage/cohttp_mirage_unix.cmxs": use_cohttp_mirage_unix
-<mirage/*.ml{,i}>: pkg_mirage-tcpip-unix
-# Library cohttp_mirage_xen
-"mirage/cohttp_mirage_xen.cmxs": use_cohttp_mirage_xen
-<mirage/*.ml{,i}>: use_cohttp_lwt
-<mirage/*.ml{,i}>: use_cohttp
-<mirage/*.ml{,i}>: pkg_uri
-<mirage/*.ml{,i}>: pkg_mirage-types
-<mirage/*.ml{,i}>: pkg_cstruct
-<mirage/*.ml{,i}>: pkg_mirage-tcpip-xen
-<mirage/*.ml{,i}>: pkg_lwt
-<mirage/*.ml{,i}>: pkg_lwt.syntax
-<mirage/*.ml{,i}>: pkg_re
-<mirage/*.ml{,i}>: pkg_uri.services
-<mirage/*.ml{,i}>: pkg_fieldslib
-<mirage/*.ml{,i}>: pkg_fieldslib.syntax
# Library cohttp_async
"async/cohttp_async.cmxs": use_cohttp_async
<async/*.ml{,i}>: use_cohttp
View
@@ -1,37 +1,15 @@
# OASIS_START
-# DO NOT EDIT (digest: c094b1d1abaf3376efc541edae3ee304)
-version = "0.9.14"
+# DO NOT EDIT (digest: c014569304636ddc501c196b7bc4da21)
+version = "0.9.15"
description = "HTTP library for Lwt, Async and Mirage"
requires = "re uri uri.services fieldslib fieldslib.syntax"
archive(byte) = "cohttp.cma"
archive(byte, plugin) = "cohttp.cma"
archive(native) = "cohttp.cmxa"
archive(native, plugin) = "cohttp.cmxs"
exists_if = "cohttp.cma"
-package "mirage-xen" (
- version = "0.9.14"
- description = "HTTP library for Lwt, Async and Mirage"
- requires = "cohttp.lwt-core mirage-types cstruct mirage-tcpip-xen"
- archive(byte) = "cohttp_mirage_xen.cma"
- archive(byte, plugin) = "cohttp_mirage_xen.cma"
- archive(native) = "cohttp_mirage_xen.cmxa"
- archive(native, plugin) = "cohttp_mirage_xen.cmxs"
- exists_if = "cohttp_mirage_xen.cma"
-)
-
-package "mirage-unix" (
- version = "0.9.14"
- description = "HTTP library for Lwt, Async and Mirage"
- requires = "cohttp.lwt-core mirage-types cstruct mirage-tcpip-unix"
- archive(byte) = "cohttp_mirage_unix.cma"
- archive(byte, plugin) = "cohttp_mirage_unix.cma"
- archive(native) = "cohttp_mirage_unix.cmxa"
- archive(native, plugin) = "cohttp_mirage_unix.cmxs"
- exists_if = "cohttp_mirage_unix.cma"
-)
-
package "lwt-core" (
- version = "0.9.14"
+ version = "0.9.15"
description = "HTTP library for Lwt, Async and Mirage"
requires = "lwt uri cohttp lwt.syntax"
archive(byte) = "cohttp_lwt.cma"
@@ -42,7 +20,7 @@ package "lwt-core" (
)
package "lwt" (
- version = "0.9.14"
+ version = "0.9.15"
description = "HTTP library for Lwt, Async and Mirage"
requires = "cohttp.lwt-core unix lwt.unix lwt.ssl"
archive(byte) = "cohttp_lwt_unix.cma"
@@ -53,7 +31,7 @@ package "lwt" (
)
package "async" (
- version = "0.9.14"
+ version = "0.9.15"
description = "HTTP library for Lwt, Async and Mirage"
requires = "uri cohttp async_core async_unix threads async"
archive(byte) = "cohttp_async.cma"
@@ -1,69 +0,0 @@
-(*
- * Copyright (c) 2012-2013 Anil Madhavapeddy <anil@recoil.org>
- * Copyright (c) 2013 Thomas Gazagnaire <thomas@gazazagnaire.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *)
-
-open Lwt
-
-open Net
-
-module Net_IO = struct
-
- module IO = Cohttp_mirage_io
-
- let connect_uri uri =
- fail (Failure "not implemented")
-
- let connect ?ssl ~host ~service () =
- fail (Failure "not implemented")
-
- let close_in ic = ()
- let close_out ic = ()
- let close ic oc = ignore_result (Channel.close ic)
-
-end
-
-(* Build all the core modules from the [Cohttp_lwt] functors *)
-module Request = Cohttp_lwt.Make_request(Cohttp_mirage_io)
-module Response = Cohttp_lwt.Make_response(Cohttp_mirage_io)
-module Client = Cohttp_lwt.Make_client(Cohttp_mirage_io)(Request)(Response)(Net_IO)
-module Server_core = Cohttp_lwt.Make_server(Cohttp_mirage_io)(Request)(Response)(Net_IO)
-
-module type S = sig
- include Cohttp_lwt.Server with module IO = Cohttp_mirage_io
- val listen : ?timeout:float -> Net.Manager.t -> Net.Nettypes.ipv4_src -> t -> unit Lwt.t
-end
-
-(* Extend the [Server_core] module with the Mirage-specific
- functions *)
-module Server = struct
- include Server_core
- let listen ?timeout mgr src spec =
- (* TODO XXX the cancel-based timeout is almost certainly broken as the
- * thread won't issue a Response *)
- let cb =
- match timeout with
- | None -> fun dst ch -> callback spec ch ch
- |Some tm ->
- fun dst ch ->
- let tmout = OS.Time.sleep tm in
- let cb_t = callback spec ch ch in
- tmout <?> cb_t
- in
- Net.Channel.listen mgr (`TCPv4 (src, cb))
-end
-
-let listen = Server.listen
@@ -1,52 +0,0 @@
-(*
- * Copyright (c) 2012 Anil Madhavapeddy <anil@recoil.org>
- * Copyright (c) 2013 Thomas Gazagnaire <thomas@gazazagnaire.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *)
-
-(** HTTP client and server using the [mirage-tcpip] interfaces. *)
-
-open Net
-
-(** The [Request] module holds the information about a HTTP request,
- and also includes the {! Cohttp_mirage_io} functions to handle
- large message bodies. *)
-module Request : Cohttp_lwt.Request with module IO = Cohttp_mirage_io
-
-(** The [Response] module holds the information about a HTTP response,
- and also includes the {! Cohttp_mirage_io} functions to handle
- large message bodies. *)
-module Response : Cohttp_lwt.Response with module IO = Cohttp_mirage_io
-
-(** The [Client] module implements an HTTP client interface. *)
-module Client : Cohttp_lwt.Client with module IO = Cohttp_mirage_io
-
-(** The Mirage [S] module type defines the additional Mirage-specific
- functions that are exposed by the {! Cohttp_lwt.Server}
- interface. This is primarily the {! listen} function to actually
- create the server instance and response to incoming requests. *)
-module type S = sig
- include Cohttp_lwt.Server with module IO = Cohttp_mirage_io
- val listen : ?timeout:float -> Manager.t -> Nettypes.ipv4_src -> t -> unit Lwt.t
-end
-
-(** The [Server] module implement the full Mirage HTTP server
- interface, including the Mirage-specific functions defined in {!
- S }. *)
-module Server : S
-
-(** This [listen] call is the same as {! Server.listen}, but here for
- compatibility with the Mirari build tool. *)
-val listen : ?timeout:float -> Manager.t -> Nettypes.ipv4_src -> Server.t -> unit Lwt.t
@@ -1,74 +0,0 @@
-(*
- * Copyright (c) 2012 Anil Madhavapeddy <anil@recoil.org>
- * Copyright (c) 2013 Thomas Gazagnaire <thomas@gazazagnaire.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *)
-
-(* open Cohttp *)
-
-open Net
-
-type 'a t = 'a Lwt.t
-let (>>=) = Lwt.bind
-let (>>) m n = m >>= fun _ -> n
-let return = Lwt.return
-
-type ic = Channel.t
-type oc = Channel.t
-
-let iter fn x = Lwt_list.iter_s fn x
-
-let read_line ic =
- match_lwt Channel.read_line ic with
- | [] -> return None
- | bufs -> return (Some (Cstruct.copyv bufs))
-
-let read ic len =
- try_lwt
- lwt iop = Channel.read_some ~len ic in
- return (Cstruct.to_string iop)
- with End_of_file -> return ""
-
-let read_exactly ic buf off len =
- let rec read acc left =
- match left with
- | 0 -> return (List.rev acc)
- | len ->
- lwt iop = Channel.read_some ~len ic in
- read (iop::acc) (left - (Cstruct.len iop))
- in
- lwt iov = read [] len in
- (* XXX TODO this is hyper slow! *)
- let srcbuf = Cstruct.copyv iov in
- String.blit srcbuf 0 buf off (String.length srcbuf);
- return true
-
-let read_exactly ic len =
- let buf = String.create len in
- read_exactly ic buf 0 len >>= function
- | true -> return (Some buf)
- | false -> return None
-
-let write oc buf =
- Channel.write_string oc buf 0 (String.length buf);
- Channel.flush oc
-
-let write_line oc buf =
- Channel.write_line oc buf;
- Channel.flush oc
-
-let flush oc =
- (* NOOP since we flush in the normal writer functions above *)
- return ()
@@ -1,21 +0,0 @@
-(*
- * Copyright (c) 2013 Anil Madhavapeddy <anil@recoil.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- *)
-
-include Cohttp.IO.S
- with type 'a t = 'a Lwt.t
- and type ic = Net.Channel.t
- and type oc = Net.Channel.t
@@ -1,5 +0,0 @@
-# OASIS_START
-# DO NOT EDIT (digest: d0f6996201bbf62f60a9db112ef4a615)
-Cohttp_mirage_io
-Cohttp_mirage
-# OASIS_STOP
Oops, something went wrong.

0 comments on commit 56a4d3b

Please sign in to comment.