From ffdcc1139c90110c8326fcf9bdeb593199b3a8ca Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 15 Feb 2026 16:13:24 -0500 Subject: [PATCH] format --- src/eio/tiny_httpd_eio.ml | 25 ++++++++++++++++--------- src/ws/dune | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/eio/tiny_httpd_eio.ml b/src/eio/tiny_httpd_eio.ml index 61060a97..85a2c68d 100644 --- a/src/eio/tiny_httpd_eio.ml +++ b/src/eio/tiny_httpd_eio.ml @@ -56,10 +56,12 @@ let ic_of_flow ~closed ~buf_pool:ic_pool (flow : _ Eio.Net.stream_socket) : method close () = if not !closed then ( closed := true; - Pool.Raw.release ic_pool cstruct); + Pool.Raw.release ic_pool cstruct + ); if not !sent_shutdown then ( sent_shutdown := true; - Eio.Flow.shutdown flow `Receive) + Eio.Flow.shutdown flow `Receive + ) end let oc_of_flow ~closed ~buf_pool:oc_pool (flow : _ Eio.Net.stream_socket) : @@ -100,10 +102,12 @@ let oc_of_flow ~closed ~buf_pool:oc_pool (flow : _ Eio.Net.stream_socket) : method close () = if not !closed then ( closed := true; - Pool.Raw.release oc_pool wbuf); + Pool.Raw.release oc_pool wbuf + ); if not !sent_shutdown then ( sent_shutdown := true; - Eio.Flow.shutdown flow `Send) + Eio.Flow.shutdown flow `Send + ) end let io_backend ?addr ?port ?unix_sock ?max_connections ?max_buf_pool_size @@ -189,9 +193,8 @@ let io_backend ?addr ?port ?unix_sock ?max_connections ?max_buf_pool_size sock (fun flow client_addr -> Eio.Semaphore.acquire sem; - Eio_unix.Fd.use_exn "setsockopt" - (Eio_unix.Net.fd flow) (fun fd -> - Unix.setsockopt fd Unix.TCP_NODELAY true); + Eio_unix.Fd.use_exn "setsockopt" (Eio_unix.Net.fd flow) + (fun fd -> Unix.setsockopt fd Unix.TCP_NODELAY true); Atomic.incr active_conns; let@ () = Fun.protect ~finally:(fun () -> @@ -202,8 +205,12 @@ let io_backend ?addr ?port ?unix_sock ?max_connections ?max_buf_pool_size in let ic_closed = ref false in let oc_closed = ref false in - let ic = ic_of_flow ~closed:ic_closed ~buf_pool:cstruct_pool flow in - let oc = oc_of_flow ~closed:oc_closed ~buf_pool:cstruct_pool flow in + let ic = + ic_of_flow ~closed:ic_closed ~buf_pool:cstruct_pool flow + in + let oc = + oc_of_flow ~closed:oc_closed ~buf_pool:cstruct_pool flow + in Log.debug (fun k -> k "handling client on %a…" Eio.Net.Sockaddr.pp client_addr); diff --git a/src/ws/dune b/src/ws/dune index 12ef15ff..5fee1aaa 100644 --- a/src/ws/dune +++ b/src/ws/dune @@ -51,7 +51,7 @@ (public_name tiny_httpd.ws) (synopsis "Websockets for tiny_httpd") (private_modules common_ws_ utils_) - (flags :standard -w -32 -open Tiny_httpd_core) + (flags :standard -w -32 -open Tiny_httpd_core) (foreign_stubs (language c) (names tiny_httpd_ws_stubs)