Skip to content

Commit ffdcc11

Browse files
committed
format
1 parent 32421a2 commit ffdcc11

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

src/eio/tiny_httpd_eio.ml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ let ic_of_flow ~closed ~buf_pool:ic_pool (flow : _ Eio.Net.stream_socket) :
5656
method close () =
5757
if not !closed then (
5858
closed := true;
59-
Pool.Raw.release ic_pool cstruct);
59+
Pool.Raw.release ic_pool cstruct
60+
);
6061
if not !sent_shutdown then (
6162
sent_shutdown := true;
62-
Eio.Flow.shutdown flow `Receive)
63+
Eio.Flow.shutdown flow `Receive
64+
)
6365
end
6466

6567
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) :
100102
method close () =
101103
if not !closed then (
102104
closed := true;
103-
Pool.Raw.release oc_pool wbuf);
105+
Pool.Raw.release oc_pool wbuf
106+
);
104107
if not !sent_shutdown then (
105108
sent_shutdown := true;
106-
Eio.Flow.shutdown flow `Send)
109+
Eio.Flow.shutdown flow `Send
110+
)
107111
end
108112

109113
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
189193
sock
190194
(fun flow client_addr ->
191195
Eio.Semaphore.acquire sem;
192-
Eio_unix.Fd.use_exn "setsockopt"
193-
(Eio_unix.Net.fd flow) (fun fd ->
194-
Unix.setsockopt fd Unix.TCP_NODELAY true);
196+
Eio_unix.Fd.use_exn "setsockopt" (Eio_unix.Net.fd flow)
197+
(fun fd -> Unix.setsockopt fd Unix.TCP_NODELAY true);
195198
Atomic.incr active_conns;
196199
let@ () =
197200
Fun.protect ~finally:(fun () ->
@@ -202,8 +205,12 @@ let io_backend ?addr ?port ?unix_sock ?max_connections ?max_buf_pool_size
202205
in
203206
let ic_closed = ref false in
204207
let oc_closed = ref false in
205-
let ic = ic_of_flow ~closed:ic_closed ~buf_pool:cstruct_pool flow in
206-
let oc = oc_of_flow ~closed:oc_closed ~buf_pool:cstruct_pool flow in
208+
let ic =
209+
ic_of_flow ~closed:ic_closed ~buf_pool:cstruct_pool flow
210+
in
211+
let oc =
212+
oc_of_flow ~closed:oc_closed ~buf_pool:cstruct_pool flow
213+
in
207214

208215
Log.debug (fun k ->
209216
k "handling client on %a…" Eio.Net.Sockaddr.pp client_addr);

src/ws/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
(public_name tiny_httpd.ws)
5252
(synopsis "Websockets for tiny_httpd")
5353
(private_modules common_ws_ utils_)
54-
(flags :standard -w -32 -open Tiny_httpd_core)
54+
(flags :standard -w -32 -open Tiny_httpd_core)
5555
(foreign_stubs
5656
(language c)
5757
(names tiny_httpd_ws_stubs)

0 commit comments

Comments
 (0)