Skip to content

Commit

Permalink
chore: apply ocamlformat
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Mar 10, 2023
1 parent c74ef86 commit fcc0838
Show file tree
Hide file tree
Showing 26 changed files with 164 additions and 413 deletions.
12 changes: 6 additions & 6 deletions async/h2_async.mli
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module Server : sig
H2_async_intf.Server
with type 'a socket := 'a Gluten_async.Server.SSL.socket

val create_connection_handler_with_default
: certfile:string
val create_connection_handler_with_default :
certfile:string
-> keyfile:string
-> ?config:Config.t
-> request_handler:('a -> Server_connection.request_handler)
Expand All @@ -69,8 +69,8 @@ module Client : sig
H2_async_intf.Client
with type 'a socket = 'a Gluten_async.Client.SSL.socket

val create_connection_with_default
: ?config:Config.t
val create_connection_with_default :
?config:Config.t
-> ?push_handler:
(Request.t -> (Client_connection.response_handler, unit) result)
-> error_handler:Client_connection.error_handler
Expand All @@ -83,8 +83,8 @@ module Client : sig
H2_async_intf.Client
with type 'a socket = 'a Gluten_async.Client.TLS.socket

val create_connection_with_default
: ?config:Config.t
val create_connection_with_default :
?config:Config.t
-> ?push_handler:
(Request.t -> (Client_connection.response_handler, unit) result)
-> error_handler:Client_connection.error_handler
Expand Down
16 changes: 8 additions & 8 deletions async/h2_async_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ open H2
module type Server = sig
type 'a socket constraint 'a = [< Socket.Address.t ]

val create_connection_handler
: ?config:Config.t
val create_connection_handler :
?config:Config.t
-> request_handler:('a -> Server_connection.request_handler)
-> error_handler:('a -> Server_connection.error_handler)
-> 'a
Expand All @@ -54,25 +54,25 @@ module type Client = sig
; runtime : 'a runtime
}

val create_connection
: ?config:Config.t
val create_connection :
?config:Config.t
-> ?push_handler:
(Request.t -> (Client_connection.response_handler, unit) result)
-> error_handler:Client_connection.error_handler
-> 'a socket
-> 'a t Deferred.t

val request
: 'a t
val request :
'a t
-> ?flush_headers_immediately:bool
-> ?trailers_handler:Client_connection.trailers_handler
-> Request.t
-> error_handler:Client_connection.error_handler
-> response_handler:Client_connection.response_handler
-> Body.Writer.t

val ping
: _ t
val ping :
_ t
-> ?payload:Bigstringaf.t
-> ?off:int
-> ((unit, [ `EOF ]) result -> unit)
Expand Down
16 changes: 8 additions & 8 deletions eio/h2_eio.mli
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
*---------------------------------------------------------------------------*)

module Server : sig
val create_connection_handler
: ?config:H2.Config.t
val create_connection_handler :
?config:H2.Config.t
-> request_handler:(Eio.Net.Sockaddr.stream -> H2.Reqd.t -> unit)
-> error_handler:
(Eio.Net.Sockaddr.stream -> H2.Server_connection.error_handler)
Expand All @@ -47,26 +47,26 @@ module Client : sig
; runtime : Gluten_eio.Client.t
}

val create_connection
: ?config:H2.Config.t
val create_connection :
?config:H2.Config.t
-> ?push_handler:
(H2.Request.t -> (H2.Client_connection.response_handler, unit) result)
-> sw:Eio.Switch.t
-> error_handler:H2.Client_connection.error_handler
-> Eio.Flow.two_way
-> t

val request
: t
val request :
t
-> ?flush_headers_immediately:bool
-> ?trailers_handler:H2.Client_connection.trailers_handler
-> H2.Request.t
-> error_handler:H2.Client_connection.error_handler
-> response_handler:H2.Client_connection.response_handler
-> H2.Body.Writer.t

val ping
: ?payload:Bigstringaf.t
val ping :
?payload:Bigstringaf.t
-> ?off:int
-> t
-> (unit, [ `EOF ]) result Eio.Promise.t
Expand Down
9 changes: 6 additions & 3 deletions examples/alpn/lib/h2_handler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ let request_handler : Unix.sockaddr -> Reqd.t -> unit =
response
"Welcome to an ALPN-negotiated HTTP/2 connection"

let error_handler
: Unix.sockaddr -> ?request:H2.Request.t -> _
-> (Headers.t -> Body.Writer.t) -> unit
let error_handler :
Unix.sockaddr
-> ?request:H2.Request.t
-> _
-> (Headers.t -> Body.Writer.t)
-> unit
=
fun _client_address ?request:_ _error start_response ->
let response_body = start_response Headers.empty in
Expand Down
14 changes: 10 additions & 4 deletions examples/alpn/lib/http1_handler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ let redirect_handler : Unix.sockaddr -> Reqd.t Gluten.reqd -> unit =
in
Reqd.respond_with_string reqd response ""

let redirect_error_handler
: Unix.sockaddr -> ?request:Request.t -> _ -> (Headers.t -> Body.Writer.t)
let redirect_error_handler :
Unix.sockaddr
-> ?request:Request.t
-> _
-> (Headers.t -> Body.Writer.t)
-> unit
=
fun _client_address ?request:_ _error start_response ->
Expand All @@ -39,8 +42,11 @@ let request_handler : Unix.sockaddr -> Reqd.t Gluten.reqd -> unit =
in
Reqd.respond_with_string reqd response response_body

let error_handler
: Unix.sockaddr -> ?request:Request.t -> _ -> (Headers.t -> Body.Writer.t)
let error_handler :
Unix.sockaddr
-> ?request:Request.t
-> _
-> (Headers.t -> Body.Writer.t)
-> unit
=
fun _client_address ?request:_ _error start_response ->
Expand Down
4 changes: 2 additions & 2 deletions examples/alpn/mirage/h2_handler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ let request_handler : Reqd.t -> unit =
response
"Welcome to an ALPN-negotiated HTTP/2 connection"

let error_handler
: ?request:H2.Request.t -> _ -> (Headers.t -> Body.Writer.t) -> unit
let error_handler :
?request:H2.Request.t -> _ -> (Headers.t -> Body.Writer.t) -> unit
=
fun ?request:_ _error start_response ->
let response_body = start_response Headers.empty in
Expand Down
8 changes: 4 additions & 4 deletions examples/alpn/mirage/http1_handler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ let redirect_handler : Reqd.t Gluten.reqd -> unit =
in
Reqd.respond_with_string reqd response ""

let redirect_error_handler
: ?request:Request.t -> _ -> (Headers.t -> Body.Writer.t) -> unit
let redirect_error_handler :
?request:Request.t -> _ -> (Headers.t -> Body.Writer.t) -> unit
=
fun ?request:_ _error start_response ->
let response_body = start_response Headers.empty in
Expand All @@ -38,8 +38,8 @@ let request_handler : Reqd.t Gluten.reqd -> unit =
in
Reqd.respond_with_string reqd response response_body

let error_handler
: ?request:Request.t -> _ -> (Headers.t -> Body.Writer.t) -> unit
let error_handler :
?request:Request.t -> _ -> (Headers.t -> Body.Writer.t) -> unit
=
fun ?request:_ _error start_response ->
let response_body = start_response Headers.empty in
Expand Down
9 changes: 6 additions & 3 deletions examples/lwt/lwt_echo_server2.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ let connection_handler : Unix.sockaddr -> Lwt_unix.file_descr -> unit Lwt.t =
(Response.create `Method_not_allowed)
"Hello, Sean."
in
let error_handler
: Unix.sockaddr -> ?request:H2.Request.t -> _
-> (Headers.t -> Body.Writer.t) -> unit
let error_handler :
Unix.sockaddr
-> ?request:H2.Request.t
-> _
-> (Headers.t -> Body.Writer.t)
-> unit
=
fun _client_address ?request:_ error start_response ->
let response_body = start_response Headers.empty in
Expand Down
5 changes: 3 additions & 2 deletions examples/lwt/lwt_h2c.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ open Lwt.Infix
module Http2 = struct
open H2

let connection_handler
: Httpaf.Request.t -> Bigstringaf.t H2.IOVec.t list
let connection_handler :
Httpaf.Request.t
-> Bigstringaf.t H2.IOVec.t list
-> (Server_connection.t, string) result
=
let request_handler : H2.Server_connection.request_handler =
Expand Down
9 changes: 6 additions & 3 deletions examples/lwt/lwt_https_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ let connection_handler : Unix.sockaddr -> Lwt_unix.file_descr -> unit Lwt.t =
(Response.create `Method_not_allowed)
""
in
let error_handler
: Unix.sockaddr -> ?request:H2.Request.t -> _
-> (Headers.t -> Body.Writer.t) -> unit
let error_handler :
Unix.sockaddr
-> ?request:H2.Request.t
-> _
-> (Headers.t -> Body.Writer.t)
-> unit
=
fun _client_address ?request:_ _error start_response ->
let response_body = start_response Headers.empty in
Expand Down
154 changes: 0 additions & 154 deletions examples/mirage/key_gen.ml

This file was deleted.

0 comments on commit fcc0838

Please sign in to comment.