From 1a459614439827b49004814d9d9b7b39a3781289 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 5 Feb 2024 10:36:55 -0500 Subject: [PATCH] chore: turn `tiny_httpd_ws` into `tiny_httpd.ws`, a sub-lib now that there's no additional dep it's not a problem! --- dune-project | 8 -------- examples/dune | 2 +- src/ws/common_.ml | 3 ++- src/ws/dune | 2 +- src/ws/tiny_httpd_ws.ml | 5 +---- src/ws/tiny_httpd_ws.mli | 1 - tiny_httpd_ws.opam | 32 -------------------------------- 7 files changed, 5 insertions(+), 48 deletions(-) delete mode 100644 tiny_httpd_ws.opam diff --git a/dune-project b/dune-project index eadd997d..9ccb6023 100644 --- a/dune-project +++ b/dune-project @@ -27,14 +27,6 @@ (ptime :with-test) (qcheck-core (and (>= 0.9) :with-test)))) -(package - (name tiny_httpd_ws) - (synopsis "Websockets for tiny_httpd") - (depends - (tiny_httpd (= :version)) - (logs :with-test) - (odoc :with-doc))) - (package (name tiny_httpd_camlzip) (synopsis "Interface to camlzip for tiny_httpd") diff --git a/examples/dune b/examples/dune index 99b175ba..d2c19915 100644 --- a/examples/dune +++ b/examples/dune @@ -24,7 +24,7 @@ (name echo_ws) (flags :standard -warn-error -a+8) (modules echo_ws) - (libraries tiny_httpd tiny_httpd_ws logs)) + (libraries tiny_httpd tiny_httpd.ws logs)) (rule (targets test_output.txt) diff --git a/src/ws/common_.ml b/src/ws/common_.ml index 7dac5a41..699d6c9f 100644 --- a/src/ws/common_.ml +++ b/src/ws/common_.ml @@ -1 +1,2 @@ -module IO = Tiny_httpd_io +let spf = Printf.sprintf +let ( let@ ) = ( @@ ) diff --git a/src/ws/dune b/src/ws/dune index 2ac87ea4..f2aab877 100644 --- a/src/ws/dune +++ b/src/ws/dune @@ -1,7 +1,7 @@ (library (name tiny_httpd_ws) - (public_name tiny_httpd_ws) + (public_name tiny_httpd.ws) (synopsis "Websockets for tiny_httpd") (private_modules common_ utils_) (foreign_stubs diff --git a/src/ws/tiny_httpd_ws.ml b/src/ws/tiny_httpd_ws.ml index c0cd7b2e..0c247c6c 100644 --- a/src/ws/tiny_httpd_ws.ml +++ b/src/ws/tiny_httpd_ws.ml @@ -3,9 +3,6 @@ open Tiny_httpd_server module Log = Tiny_httpd_log module IO = Tiny_httpd_io -let spf = Printf.sprintf -let ( let@ ) = ( @@ ) - type handler = Unix.sockaddr -> IO.Input.t -> IO.Output.t -> unit module Frame_type = struct @@ -34,7 +31,7 @@ module Header = struct mutable ty: Frame_type.t; mutable payload_len: int; mutable mask: bool; - mutable mask_key: bytes; (** len = 4 *) + mask_key: bytes; (** len = 4 *) } let create () : t = diff --git a/src/ws/tiny_httpd_ws.mli b/src/ws/tiny_httpd_ws.mli index 8ad8cd0f..0a44803b 100644 --- a/src/ws/tiny_httpd_ws.mli +++ b/src/ws/tiny_httpd_ws.mli @@ -1,4 +1,3 @@ -open Common_ open Tiny_httpd_server module IO = Tiny_httpd_io diff --git a/tiny_httpd_ws.opam b/tiny_httpd_ws.opam deleted file mode 100644 index 5f5fac96..00000000 --- a/tiny_httpd_ws.opam +++ /dev/null @@ -1,32 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -version: "0.16" -synopsis: "Websockets for tiny_httpd" -maintainer: ["c-cube"] -authors: ["c-cube"] -license: "MIT" -homepage: "https://github.com/c-cube/tiny_httpd/" -bug-reports: "https://github.com/c-cube/tiny_httpd/issues" -depends: [ - "dune" {>= "2.9"} - "tiny_httpd" {= version} - "logs" {with-test} - "odoc" {with-doc} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "--promote-install-files=false" - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] - ["dune" "install" "-p" name "--create-install-files" name] -] -dev-repo: "git+https://github.com/c-cube/tiny_httpd.git"