Skip to content

Commit de9760d

Browse files
committed
format
1 parent 0fbfd9d commit de9760d

File tree

14 files changed

+82
-74
lines changed

14 files changed

+82
-74
lines changed

src/Tiny_httpd.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ open struct
2727
slice.len <- 0
2828
end
2929

30-
let create ?(masksigpipe = not (Sys.win32)) ?max_connections ?(timeout = 0.0) ?buf_size
31-
?(get_time_s = Unix.gettimeofday)
30+
let create ?(masksigpipe = not Sys.win32) ?max_connections ?(timeout = 0.0)
31+
?buf_size ?(get_time_s = Unix.gettimeofday)
3232
?(new_thread = fun f -> ignore (Thread.create f () : Thread.t))
3333
?(addr = "127.0.0.1") ?(port = 8080) ?sock ?middlewares () : t =
3434
let max_connections = get_max_connection_ ?max_connections () in

src/camlzip/dune

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
(public_name tiny_httpd_camlzip)
44
(synopsis "A wrapper around camlzip to bring compression to Tiny_httpd")
55
(flags :standard -open Tiny_httpd_core -safe-string -warn-error -a+8)
6-
(libraries (re_export tiny_httpd.core)
7-
(re_export iostream-camlzip)
8-
camlzip))
6+
(libraries
7+
(re_export tiny_httpd.core)
8+
(re_export iostream-camlzip)
9+
camlzip))

src/core/dune

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
21
(library
3-
(name tiny_httpd_core)
4-
(public_name tiny_httpd.core)
5-
(private_modules parse_ common_)
6-
(libraries threads seq hmap iostream
7-
(select log.ml from
8-
(logs -> log.logs.ml)
9-
(-> log.default.ml))))
2+
(name tiny_httpd_core)
3+
(public_name tiny_httpd.core)
4+
(private_modules parse_ common_)
5+
(libraries
6+
threads
7+
seq
8+
hmap
9+
iostream
10+
(select
11+
log.ml
12+
from
13+
(logs -> log.logs.ml)
14+
(-> log.default.ml))))
1015

1116
(rule
1217
(targets Atomic_.ml)

src/dune

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
(library
2-
(name tiny_httpd)
3-
(public_name tiny_httpd)
4-
(flags :standard -open Tiny_httpd_core)
5-
(libraries threads seq unix hmap
6-
(re_export tiny_httpd.core)
7-
(re_export tiny_httpd.html)
8-
(re_export tiny_httpd.unix)))
2+
(name tiny_httpd)
3+
(public_name tiny_httpd)
4+
(flags :standard -open Tiny_httpd_core)
5+
(libraries
6+
threads
7+
seq
8+
unix
9+
hmap
10+
(re_export tiny_httpd.core)
11+
(re_export tiny_httpd.html)
12+
(re_export tiny_httpd.unix)))

src/html/dune

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
2-
31
(library
4-
(name tiny_httpd_html)
5-
(public_name tiny_httpd.html)
6-
(flags :standard -open Tiny_httpd_core)
7-
(libraries seq tiny_httpd.core))
2+
(name tiny_httpd_html)
3+
(public_name tiny_httpd.html)
4+
(flags :standard -open Tiny_httpd_core)
5+
(libraries seq tiny_httpd.core))
86

97
(rule
108
(targets html_.ml)

src/prometheus/dune

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
2-
31
(library
42
(name tiny_httpd_prometheus)
53
(public_name tiny_httpd.prometheus)
64
(synopsis "Metrics using prometheus")
75
(private_modules common_p_ time_)
86
(flags :standard -open Tiny_httpd_core)
97
(libraries
10-
(re_export tiny_httpd.core) unix
11-
(select time_.ml from
8+
(re_export tiny_httpd.core)
9+
unix
10+
(select
11+
time_.ml
12+
from
1213
(mtime mtime.clock.os -> time_.mtime.ml)
1314
(-> time_.default.ml))))

src/unix/dune

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
21
(library
3-
(name tiny_httpd_unix)
4-
(public_name tiny_httpd.unix)
5-
(synopsis "Backend based on Unix and blocking IOs for Tiny_httpd")
6-
(flags :standard -open Tiny_httpd_core)
7-
(private_modules mime_)
8-
(libraries tiny_httpd.core tiny_httpd.html unix
9-
(select mime_.ml from
10-
(magic-mime -> mime_.magic.ml)
11-
( -> mime_.dummy.ml))
12-
))
2+
(name tiny_httpd_unix)
3+
(public_name tiny_httpd.unix)
4+
(synopsis "Backend based on Unix and blocking IOs for Tiny_httpd")
5+
(flags :standard -open Tiny_httpd_core)
6+
(private_modules mime_)
7+
(libraries
8+
tiny_httpd.core
9+
tiny_httpd.html
10+
unix
11+
(select
12+
mime_.ml
13+
from
14+
(magic-mime -> mime_.magic.ml)
15+
(-> mime_.dummy.ml))))

src/unix/mime_.mli

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
val mime_of_path : string -> string
1+
val mime_of_path : string -> string

src/unix/tiny_httpd_unix.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module Unix_tcp_server_ = struct
3131
{
3232
IO.TCP_server.serve =
3333
(fun ~after_init ~handle () : unit ->
34-
if self.masksigpipe && not (Sys.win32) then
34+
if self.masksigpipe && not Sys.win32 then
3535
ignore (Unix.sigprocmask Unix.SIG_BLOCK [ Sys.sigpipe ] : _ list);
3636
let sock, should_bind =
3737
match self.sock with
@@ -83,7 +83,7 @@ module Unix_tcp_server_ = struct
8383
(Thread.id @@ Thread.self ())
8484
(Util.show_sockaddr client_addr));
8585

86-
if self.masksigpipe && not (Sys.win32) then
86+
if self.masksigpipe && not Sys.win32 then
8787
ignore (Unix.sigprocmask Unix.SIG_BLOCK [ Sys.sigpipe ] : _ list);
8888
Unix.set_nonblock client_sock;
8989
Unix.setsockopt client_sock Unix.TCP_NODELAY true;
@@ -113,7 +113,7 @@ module Unix_tcp_server_ = struct
113113
Sem.acquire 1 self.sem_max_connections;
114114
(* Block INT/HUP while cloning to avoid children handling them.
115115
When thread gets them, our Unix.accept raises neatly. *)
116-
if not (Sys.win32) then
116+
if not Sys.win32 then
117117
ignore Unix.(sigprocmask SIG_BLOCK Sys.[ sigint; sighup ]);
118118
self.new_thread (fun () ->
119119
try
@@ -137,7 +137,7 @@ module Unix_tcp_server_ = struct
137137
(Util.show_sockaddr client_addr)
138138
(Printexc.to_string e)
139139
(Printexc.raw_backtrace_to_string bt)));
140-
if not (Sys.win32) then
140+
if not Sys.win32 then
141141
ignore Unix.(sigprocmask SIG_UNBLOCK Sys.[ sigint; sighup ])
142142
| exception Unix.Unix_error ((Unix.EAGAIN | Unix.EWOULDBLOCK), _, _)
143143
->

src/ws/dune

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
21
(library
3-
(name tiny_httpd_ws)
4-
(public_name tiny_httpd.ws)
5-
(synopsis "Websockets for tiny_httpd")
6-
(private_modules common_ws_ utils_)
7-
(flags :standard -open Tiny_httpd_core)
8-
(foreign_stubs
9-
(language c)
10-
(names tiny_httpd_ws_stubs)
11-
(flags :standard -std=c99 -fPIC -O2))
12-
(libraries (re_export tiny_httpd.core) threads))
2+
(name tiny_httpd_ws)
3+
(public_name tiny_httpd.ws)
4+
(synopsis "Websockets for tiny_httpd")
5+
(private_modules common_ws_ utils_)
6+
(flags :standard -open Tiny_httpd_core)
7+
(foreign_stubs
8+
(language c)
9+
(names tiny_httpd_ws_stubs)
10+
(flags :standard -std=c99 -fPIC -O2))
11+
(libraries
12+
(re_export tiny_httpd.core)
13+
threads))

0 commit comments

Comments
 (0)