prepare for 0.11

This commit is contained in:
Simon Cruanes 2021-12-31 20:44:42 -05:00
parent 4aaa61f622
commit 3a7019c7cb
No known key found for this signature in database
GPG key ID: 4AC01D0849AA62B6
6 changed files with 22 additions and 14 deletions

View file

@ -230,7 +230,7 @@ module Request : sig
body: 'body;
start_time: float;
(** Obtained via [get_time_s] in {!create}
@since NEXT_RELEASE *)
@since 0.11 *)
}
(** A request with method, path, host, headers, and a body, sent by a client.
@ -241,8 +241,8 @@ module Request : sig
@since 0.6 The field [query] was added and contains the query parameters in ["?foo=bar,x=y"]
@since 0.6 The field [path_components] is the part of the path that precedes [query] and is split on ["/"].
@since NEXT_RELEASE the type is a private alias
@since NEXT_RELEASE the field [start_time] was added
@since 0.11 the type is a private alias
@since 0.11 the field [start_time] was added
*)
val pp : Format.formatter -> string t -> unit
@ -287,7 +287,7 @@ module Request : sig
val start_time : _ t -> float
(** time stamp (from {!Unix.gettimeofday}) after parsing the first line of the request
@since NEXT_RELEASE *)
@since 0.11 *)
val limit_body_size : max_size:int -> byte_stream t -> byte_stream t
(** Limit the body size to [max_size] bytes, or return
@ -298,7 +298,7 @@ module Request : sig
val read_body_full : ?buf_size:int -> byte_stream t -> string t
(** Read the whole body into a string. Potentially blocking.
@param buf_size initial size of underlying buffer (since NEXT_RELEASE) *)
@param buf_size initial size of underlying buffer (since 0.11) *)
(**/**)
(* for testing purpose, do not use *)
@ -460,7 +460,7 @@ module Route : sig
val exact_path : string -> ('a,'b) t -> ('a,'b) t
(** [exact_path "foo/bar/..." r] is equivalent to
[exact "foo" @/ exact "bar" @/ ... @/ r]
@since NEXT_RELEASE **)
@since 0.11 **)
val pp : Format.formatter -> _ t -> unit
(** Print the route.
@ -476,7 +476,7 @@ end
A middleware can be inserted in a handler to modify or observe
its behavior.
@since NEXT_RELEASE
@since 0.11
*)
module Middleware : sig
type handler = byte_stream Request.t -> resp:(Response.t -> unit) -> unit
@ -523,7 +523,7 @@ val create :
@param masksigpipe if true, block the signal {!Sys.sigpipe} which otherwise
tends to kill client threads when they try to write on broken sockets. Default: [true].
@param buf_size size for buffers (since NEXT_RELEASE)
@param buf_size size for buffers (since 0.11)
@param new_thread a function used to spawn a new thread to handle a
new client connection. By default it is {!Thread.create} but one
@ -543,7 +543,7 @@ val create :
used. This parameter exists since 0.10.
@param get_time_s obtain the current timestamp in seconds.
This parameter exists since NEXT_RELEASE.
This parameter exists since 0.11.
*)
val addr : t -> string
@ -591,7 +591,7 @@ val add_middleware :
@param stage specify when middleware applies.
Encoding comes first (outermost layer), then stages in increasing order.
@raise Invalid_argument if stage is [`Stage n] where [n < 1]
@since NEXT_RELEASE
@since 0.11
*)
(** {2 Request handlers} *)

View file

@ -5,7 +5,7 @@
It exposes a directory (and its subdirectories), with the optional ability
to delete or upload files.
@since NEXT_RELEASE *)
@since 0.11 *)
(** behavior of static directory.

View file

@ -4,7 +4,7 @@ val middleware :
?buf_size:int -> unit ->
Tiny_httpd.Middleware.t
(** Middleware responsible for deflate compression/decompression.
@since NEXT_RELEASE *)
@since 0.11 *)
val setup :
?compress_above:int ->

View file

@ -4,10 +4,12 @@
(deps (:bin ../examples/echo.exe))
(locks /port)
(enabled_if (= %{system} "linux"))
(package tiny_httpd_camlzip)
(action (with-stdout-to %{targets} (run ./echo1.sh %{bin}))))
(rule
(alias runtest)
(package tiny_httpd_camlzip)
(action (diff echo1.expect echo1.out)))
(rule
@ -15,34 +17,40 @@
(deps (:bin ../examples/sse_server.exe))
(locks /port)
(enabled_if (= %{system} "linux"))
(package tiny_httpd)
(action (with-stdout-to %{targets} (run ./sse_count.sh %{bin}))))
(rule
(alias runtest)
(package tiny_httpd)
(action (diff sse_count.expect sse_count.out)))
(rule
(targets upload-out)
(deps (:bin ../src/bin/http_of_dir.exe) foo_50)
(locks /port)
(package tiny_httpd)
(enabled_if (= %{system} "linux"))
(action (with-stdout-to %{targets}
(run ./upload_chunked.sh %{bin}))))
(rule
(alias runtest)
(package tiny_httpd)
(action (diff upload-out.expect upload-out)))
(rule
(targets dl-out)
(deps (:bin ../src/bin/http_of_dir.exe) foo_50)
(locks /port)
(package tiny_httpd)
(enabled_if (= %{system} "linux"))
(action (with-stdout-to %{targets}
(run ./download_chunked.sh %{bin}))))
(rule
(alias runtest)
(package tiny_httpd)
(action (diff dl-out.expect dl-out)))

View file

@ -1,5 +1,5 @@
opam-version: "2.0"
version: "0.10"
version: "0.11"
authors: ["Simon Cruanes"]
maintainer: "simon.cruanes.2007@m4x.org"
license: "MIT"

View file

@ -1,5 +1,5 @@
opam-version: "2.0"
version: "0.10"
version: "0.11"
authors: ["Simon Cruanes"]
maintainer: "simon.cruanes.2007@m4x.org"
license: "MIT"