Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## dev

* Use Ipaddr 3.0.0+ interfaces (#284 by @avsm).
* Update opam metadata files to the opam 2.0 format (#284 by @avsm)
* Hook in an introduction ocamldoc page to the `conduit` odoc (#284 by @avsm)

## v1.3.0 (2018-10-19)

* Mark `ppx_sexp_conv` as not just a build dependency.
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build clean test
.PHONY: build clean test doc

build:
dune build
Expand All @@ -8,3 +8,6 @@ test:

clean:
dune clean

doc:
dune build @doc
6 changes: 3 additions & 3 deletions async/v1.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ module Conduit_async = struct
type 'a io = 'a Deferred.t

type addr = [
| `OpenSSL of string * Ipaddr.t * int
| `OpenSSL_with_config of string * Ipaddr.t * int * Ssl.config
| `TCP of Ipaddr.t * int
| `OpenSSL of string * Ipaddr_sexp.t * int
| `OpenSSL_with_config of string * Ipaddr_sexp.t * int * Ssl.config
| `TCP of Ipaddr_sexp.t * int
| `Unix_domain_socket of string
] [@@deriving sexp]

Expand Down
4 changes: 2 additions & 2 deletions async/v2.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ open Async
open Private_ssl.V2

type addr = [
| `OpenSSL of Ipaddr.t * int * Ssl.Config.t
| `TCP of Ipaddr.t * int
| `OpenSSL of Ipaddr_sexp.t * int * Ssl.Config.t
| `TCP of Ipaddr_sexp.t * int
| `Unix_domain_socket of string
] [@@deriving sexp_of]

Expand Down
32 changes: 17 additions & 15 deletions conduit-async.opam
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
opam-version: "1.2"
maintainer: "anil@recoil.org"
authors: ["Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire" "Rudi Grinberg"]
homepage: "https://github.com/mirage/ocaml-conduit"
dev-repo: "https://github.com/mirage/ocaml-conduit.git"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
tags: "org:mirage"
license: "ISC"

build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
opam-version: "2.0"
maintainer: "anil@recoil.org"
authors: [
"Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire" "Rudi Grinberg"
]
license: "ISC"
tags: "org:mirage"
homepage: "https://github.com/mirage/ocaml-conduit"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
depends: [
"ocaml" {>= "4.03.0"}
"dune" {build}
"core"
"ppx_sexp_conv"
"sexplib"
"conduit"
"async" {>= "v0.10.0"}
]
depopts: [ "async_ssl" ]
depopts: ["async_ssl"]
conflicts: [
"async_ssl" {<"v0.9.0" }
"async_ssl" {< "v0.9.0"}
]
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
available: [ocaml-version >= "4.03.0"]
dev-repo: "git+https://github.com/mirage/ocaml-conduit.git"
synopsis: "A network connection establishment library for Async"
40 changes: 19 additions & 21 deletions conduit-lwt-unix.opam
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
opam-version: "1.2"
maintainer: "anil@recoil.org"
authors: ["Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire" "Rudi Grinberg"]
homepage: "https://github.com/mirage/ocaml-conduit"
dev-repo: "https://github.com/mirage/ocaml-conduit.git"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
tags: "org:mirage"
license: "ISC"

build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
opam-version: "2.0"
maintainer: "anil@recoil.org"
authors: [
"Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire" "Rudi Grinberg"
]
license: "ISC"
tags: "org:mirage"
homepage: "https://github.com/mirage/ocaml-conduit"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
depends: [
"ocaml" {>= "4.03.0"}
"dune" {build}
"base-unix"
"ppx_sexp_conv"
"conduit-lwt"
"lwt" {>= "3.0.0"}
"uri" {>="1.9.4"}
"ipaddr" {>="2.8.0"}
]
depopts: [
"tls"
"lwt_ssl"
"launchd"
"uri" {>= "1.9.4"}
"ipaddr" {>= "3.0.0"}
]
depopts: ["tls" "lwt_ssl" "launchd"]
conflicts: [
"tls" {<"0.8.0" }
"tls" {< "0.8.0"}
]
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
available: [ocaml-version >= "4.03.0"]
dev-repo: "git+https://github.com/mirage/ocaml-conduit.git"
synopsis: "A network connection establishment library for Lwt_unix"
30 changes: 16 additions & 14 deletions conduit-lwt.opam
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
opam-version: "1.2"
maintainer: "anil@recoil.org"
authors: ["Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire" "Rudi Grinberg"]
homepage: "https://github.com/mirage/ocaml-conduit"
dev-repo: "https://github.com/mirage/ocaml-conduit.git"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
tags: "org:mirage"
license: "ISC"

build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
opam-version: "2.0"
maintainer: "anil@recoil.org"
authors: [
"Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire" "Rudi Grinberg"
]
license: "ISC"
tags: "org:mirage"
homepage: "https://github.com/mirage/ocaml-conduit"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
depends: [
"ocaml" {>= "4.03.0"}
"dune" {build}
"base-unix"
"ppx_sexp_conv"
"sexplib"
"conduit"
"lwt" {>="3.0.0"}
"lwt" {>= "3.0.0"}
]
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
available: [ocaml-version >= "4.03.0"]
dev-repo: "git+https://github.com/mirage/ocaml-conduit.git"
synopsis: "A portable network connection establishment library using Lwt"
55 changes: 39 additions & 16 deletions conduit.opam
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
opam-version: "1.2"
maintainer: "anil@recoil.org"
authors: ["Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire" "Rudi Grinberg"]
homepage: "https://github.com/mirage/ocaml-conduit"
dev-repo: "https://github.com/mirage/ocaml-conduit.git"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
tags: "org:mirage"
license: "ISC"
doc: "https://mirage.github.io/ocaml-conduit/"

build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
opam-version: "2.0"
maintainer: "anil@recoil.org"
authors: [
"Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire" "Rudi Grinberg"
]
license: "ISC"
tags: "org:mirage"
homepage: "https://github.com/mirage/ocaml-conduit"
doc: "https://mirage.github.io/ocaml-conduit/"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
depends: [
"ocaml" {>= "4.03.0"}
"dune" {build}
"ppx_sexp_conv"
"sexplib"
"astring"
"uri"
"result"
"logs" {>="0.5.0"}
"ipaddr" {>="2.5.0"}
"logs" {>= "0.5.0"}
"ipaddr" {>= "3.0.0"}
]
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
available: [ocaml-version >= "4.03.0"]
dev-repo: "git+https://github.com/mirage/ocaml-conduit.git"
synopsis: "A network connection establishment library"
description: """
The `conduit` library takes care of establishing and listening for
TCP and SSL/TLS connections for the Lwt and Async libraries.

The reason this library exists is to provide a degree of abstraction
from the precise SSL library used, since there are a variety of ways
to bind to a library (e.g. the C FFI, or the Ctypes library), as well
as well as which library is used (just OpenSSL for now).

By default, OpenSSL is used as the preferred connection library, but
you can force the use of the pure OCaml TLS stack by setting the
environment variable `CONDUIT_TLS=native` when starting your program.

The useful opam packages available that extend this library are:

- `conduit`: the main `Conduit` module
- `conduit-lwt`: the portable Lwt implementation
- `conduit-lwt-unix`: the Lwt/Unix implementation
- `conduit-async` the Jane Street Async implementation
- `mirage-conduit`: the MirageOS compatible implementation
"""
5 changes: 0 additions & 5 deletions jbuild-workspace.dev

This file was deleted.

2 changes: 1 addition & 1 deletion lib/conduit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ open Sexplib.Std
(** The resolver will return an [endp], which the Conduit
backend must interpret to make a connection. *)
type endp = [
| `TCP of Ipaddr.t * int (** ipaddr and dst port *)
| `TCP of Ipaddr_sexp.t * int (** ipaddr and dst port *)
| `Unix_domain_socket of string (** unix file path *)
| `Vchan_direct of int * string (** domain id, port *)
| `Vchan_domain_socket of string * string
Expand Down
5 changes: 4 additions & 1 deletion lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
(wrapped false)
(preprocess (pps ppx_sexp_conv))
(modules conduit conduit_trie resolver)
(libraries ipaddr uri astring))
(libraries sexplib ipaddr ipaddr.sexp uri astring))

(documentation
(package conduit))
2 changes: 2 additions & 0 deletions lib/intro.html → lib/index.mld
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{1 Introduction}

The {!Conduit} library abstracts the concerns of establishing connections to
peers that may be running within the same host (e.g. in another virtual
machine) or on a remote host via TCP. It consists of:
Expand Down
6 changes: 3 additions & 3 deletions lwt-unix/conduit_lwt_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ type oc = Lwt_io.output_channel

type client_tls_config =
[ `Hostname of string ] *
[ `IP of Ipaddr.t ] *
[ `IP of Ipaddr_sexp.t ] *
[ `Port of int ]
[@@deriving sexp]

type client = [
| `TLS of client_tls_config
| `TLS_native of client_tls_config
| `OpenSSL of client_tls_config
| `TCP of [ `IP of Ipaddr.t ] * [`Port of int ]
| `TCP of [ `IP of Ipaddr_sexp.t ] * [`Port of int ]
| `Unix_domain_socket of [ `File of string ]
| `Vchan_direct of [ `Domid of int ] * [ `Port of string ]
| `Vchan_domain_socket of [ `Domain_name of string ] * [ `Port of string ]
Expand Down Expand Up @@ -121,7 +121,7 @@ let sexp_of_ctx ctx =

type tcp_flow = {
fd: Lwt_unix.file_descr sexp_opaque;
ip: Ipaddr.t;
ip: Ipaddr_sexp.t;
port: int;
} [@@deriving sexp]

Expand Down
2 changes: 1 addition & 1 deletion lwt-unix/dune
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let v ~launchd ~ssl ~tls () =
(wrapped false)
(modules resolver_lwt_unix conduit_lwt_unix conduit_lwt_server
conduit_lwt_tls conduit_lwt_unix_ssl conduit_lwt_launchd)
(libraries conduit-lwt lwt.unix uri.services ipaddr.unix logs %s%s%s))
(libraries conduit-lwt lwt.unix uri.services ipaddr.sexp ipaddr.unix logs %s%s%s))
|} launchd ssl tls ssl tls launchd_d ssl_d tls_d

let main () =
Expand Down
4 changes: 2 additions & 2 deletions lwt-unix/resolver_lwt_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ let get_host uri =
| None -> "localhost"
| Some host ->
match Ipaddr.of_string host with
| Some ip -> Ipaddr.to_string ip
| None -> host
| Ok ip -> Ipaddr.to_string ip
| Error _ -> host

let get_port service uri =
match Uri.port uri with
Expand Down
42 changes: 20 additions & 22 deletions mirage-conduit.opam
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
opam-version: "1.2"
maintainer: "anil@recoil.org"
authors: ["Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire"]
homepage: "https://github.com/mirage/ocaml-conduit"
dev-repo: "https://github.com/mirage/ocaml-conduit.git"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
tags: "org:mirage"
license: "ISC"

build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
build-test: ["dune" "runtest" "-p" name]

opam-version: "2.0"
maintainer: "anil@recoil.org"
authors: ["Anil Madhavapeddy" "Thomas Leonard" "Thomas Gazagnaire"]
license: "ISC"
tags: "org:mirage"
homepage: "https://github.com/mirage/ocaml-conduit"
bug-reports: "https://github.com/mirage/ocaml-conduit/issues"
depends: [
"ocaml" {>= "4.03.0"}
"dune" {build}
"ppx_sexp_conv"
"sexplib"
"cstruct" {>= "3.0.0"}
"cstruct" {>= "3.0.0"}
"mirage-stack-lwt" {>= "1.3.0"}
"mirage-time-lwt" {>= "1.1.0"}
"mirage-flow-lwt" {>= "1.2.0"}
"mirage-dns" {>= "3.0.0"}
"mirage-time-lwt" {>= "1.1.0"}
"mirage-flow-lwt" {>= "1.2.0"}
"mirage-dns" {>= "3.0.0"}
"conduit-lwt"
"vchan" {>= "3.0.0"}
"vchan" {>= "3.0.0"}
"xenstore"
"tls" {>="0.8.0"}
"tls" {>= "0.8.0"}
]
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name] {with-test}
]
available: [ocaml-version >="4.03.0"]
dev-repo: "git+https://github.com/mirage/ocaml-conduit.git"
2 changes: 1 addition & 1 deletion mirage/conduit_mirage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module type Handler = sig
val listen: t -> server -> callback -> unit Lwt.t
end

type tcp_client = [ `TCP of Ipaddr.t * int ] [@@deriving sexp]
type tcp_client = [ `TCP of Ipaddr_sexp.t * int ] [@@deriving sexp]
type tcp_server = [ `TCP of int ] [@@deriving sexp]

type 'a stackv4 = (module Mirage_stack_lwt.V4 with type t = 'a)
Expand Down
2 changes: 1 addition & 1 deletion mirage/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
(modules conduit_mirage resolver_mirage conduit_xenstore)
(wrapped false)
(libraries conduit conduit-lwt mirage-stack-lwt mirage-time-lwt
mirage-flow-lwt mirage-dns
mirage-flow-lwt mirage-dns ipaddr.sexp
vchan tls tls.mirage xenstore.client))
Loading