Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions lwt/cohttp_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ module type Server = sig
module Request : Request
module Response : Response

type ctx with sexp_of
val default_ctx : ctx

type conn = IO.conn * Cohttp.Connection.t

type t
Expand Down Expand Up @@ -268,14 +265,11 @@ end
module Make_server(IO:IO)
(Request:Request with module IO=IO)
(Response:Response with module IO=IO)
(Net:Net with module IO=IO) = struct
= struct
module IO = IO
module Request = Request
module Response = Response

type ctx = Net.ctx with sexp_of
let default_ctx = Net.default_ctx

type conn = IO.conn * Cohttp.Connection.t

type t = {
Expand Down
7 changes: 1 addition & 6 deletions lwt/cohttp_lwt.mli
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ module type Server = sig
module Request : Request
module Response : Response

type ctx with sexp_of
val default_ctx : ctx

type conn = IO.conn * Cohttp.Connection.t

type t
Expand Down Expand Up @@ -225,8 +222,6 @@ module Make_server
(IO:IO)
(Request:Request with module IO=IO)
(Response:Response with module IO=IO)
(Net:Net with module IO = IO) :
Server with module IO = IO
: Server with module IO = IO
and module Request = Request
and module Response = Response
and type ctx = Net.ctx
7 changes: 3 additions & 4 deletions lwt/cohttp_lwt_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ module Client = struct
let custom_ctx = Cohttp_lwt_unix_net.custom_ctx
end

module Server_core = Cohttp_lwt.Make_server
(Cohttp_lwt_unix_io)(Request)(Response)(Cohttp_lwt_unix_net)
module Server_core =
Cohttp_lwt.Make_server (Cohttp_lwt_unix_io)(Request)(Response)

module Server = struct
include Server_core
Expand Down Expand Up @@ -86,7 +86,7 @@ module Server = struct
let body = Printexc.to_string exn in
respond_error ~status:`Internal_server_error ~body ()

let create ?timeout ?stop ?(ctx=default_ctx) ?(mode=`TCP (`Port 8080)) spec =
let create ?timeout ?stop ?(ctx=Cohttp_lwt_unix_net.default_ctx) ?(mode=`TCP (`Port 8080)) spec =
Conduit_lwt_unix.serve ?timeout ?stop ~ctx:ctx.Cohttp_lwt_unix_net.ctx ~mode
(fun conn ic oc -> (callback spec) conn ic oc)
end
Expand All @@ -96,7 +96,6 @@ module type S = sig
include Cohttp_lwt.Server with module IO = Cohttp_lwt_unix_io
and module Request = Request
and module Response = Response
and type ctx = Cohttp_lwt_unix_net.ctx

val resolve_file :
docroot:string -> uri:Uri.t -> string
Expand Down
1 change: 0 additions & 1 deletion lwt/cohttp_lwt_unix.mli
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ module type S = sig
include Cohttp_lwt.Server with module IO = Cohttp_lwt_unix_io
and module Request = Request
and module Response = Response
and type ctx = Cohttp_lwt_unix_net.ctx

val resolve_file : docroot:string -> uri:Uri.t -> string

Expand Down