diff --git a/miou/dune b/miou/dune index e277a776..d3588467 100644 --- a/miou/dune +++ b/miou/dune @@ -1,6 +1,4 @@ (library - (name tls_miou) - (public_name tls-miou) - (libraries miou.unix tls) - (instrumentation - (backend bisect_ppx))) + (name tls_miou_unix) + (public_name tls-miou-unix) + (libraries miou.unix tls)) diff --git a/miou/tests/dune b/miou/tests/dune index 25781b2d..18f04bab 100644 --- a/miou/tests/dune +++ b/miou/tests/dune @@ -7,6 +7,6 @@ ptime ptime.clock.os crowbar - tls-miou) + tls-miou-unix) (instrumentation (backend bisect_ppx))) diff --git a/miou/tests/fuzz.ml b/miou/tests/fuzz.ml index 2cb91690..a5fe42fe 100644 --- a/miou/tests/fuzz.ml +++ b/miou/tests/fuzz.ml @@ -131,28 +131,28 @@ let run ~role:_ actions tls = Miou.yield (); go buf tls actions | Send str :: actions -> - Tls_miou.write tls str; + Tls_miou_unix.write tls str; go buf tls actions | Close :: actions -> - Tls_miou.close tls; + Tls_miou_unix.close tls; go buf tls actions | Shutdown cmd :: actions -> - Tls_miou.shutdown tls (cmd :> [ `read | `write | `read_write ]); + Tls_miou_unix.shutdown tls (cmd :> [ `read | `write | `read_write ]); go buf tls actions | Recv len :: actions -> let tmp = Bytes.make len '\000' in - Tls_miou.really_read tls tmp; + Tls_miou_unix.really_read tls tmp; Buffer.add_subbytes buf tmp 0 len; go buf tls actions in let buf = Buffer.create 0x100 in try go buf tls actions with - | End_of_file | Tls_miou.Closed_by_peer | Tls_miou.Tls_alert _ - | Tls_miou.Tls_failure _ -> - inhibit (fun () -> Miou_unix.close (Tls_miou.file_descr tls)); + | End_of_file | Tls_miou_unix.Closed_by_peer | Tls_miou_unix.Tls_alert _ + | Tls_miou_unix.Tls_failure _ -> + inhibit (fun () -> Miou_unix.close (Tls_miou_unix.file_descr tls)); Buffer.contents buf | exn -> - inhibit (fun () -> Miou_unix.close (Tls_miou.file_descr tls)); + inhibit (fun () -> Miou_unix.close (Tls_miou_unix.file_descr tls)); raise exn let run_client ~to_client:actions cfg addr = @@ -160,9 +160,9 @@ let run_client ~to_client:actions cfg addr = let socket = Unix.socket ~cloexec:true domain Unix.SOCK_STREAM 0 in Unix.connect socket addr; let fd = Miou_unix.of_file_descr ~non_blocking:true socket in - let tls = Tls_miou.client_of_fd cfg fd in + let tls = Tls_miou_unix.client_of_fd cfg fd in let finally () = - inhibit (fun () -> Miou_unix.close (Tls_miou.file_descr tls)) + inhibit (fun () -> Miou_unix.close (Tls_miou_unix.file_descr tls)) in Fun.protect ~finally @@ fun () -> run ~role:"client" actions tls @@ -201,7 +201,7 @@ let run_server ~to_server:actions ~stop fd cfg = | Ok (fd, _) -> ignore ( Miou.call_cc ~orphans @@ fun () -> - match Tls_miou.server_of_fd cfg fd with + match Tls_miou_unix.server_of_fd cfg fd with | tls -> run ~role:"server" actions tls | exception _ -> Miou_unix.close fd; diff --git a/miou/tls_miou.ml b/miou/tls_miou_unix.ml similarity index 100% rename from miou/tls_miou.ml rename to miou/tls_miou_unix.ml diff --git a/miou/tls_miou.mli b/miou/tls_miou_unix.mli similarity index 100% rename from miou/tls_miou.mli rename to miou/tls_miou_unix.mli diff --git a/tls-miou.opam b/tls-miou-unix.opam similarity index 92% rename from tls-miou.opam rename to tls-miou-unix.opam index c4a616d2..be07f181 100644 --- a/tls-miou.opam +++ b/tls-miou-unix.opam @@ -26,9 +26,9 @@ depends: [ "ptime" {with-test} ] tags: [ "org:mirage"] -synopsis: "Transport Layer Security purely in OCaml, Miou layer" +synopsis: "Transport Layer Security purely in OCaml, Miou+Unix layer" description: """ -Tls-miou provides an effectful Tls_miou module to be used with Miou. +Tls-miou provides an effectful Tls_miou module to be used with Miou and Unix. """ pin-depends: [