diff --git a/ocsigenserver.opam b/ocsigenserver.opam index 2b4cae87b..9426ac9f1 100644 --- a/ocsigenserver.opam +++ b/ocsigenserver.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "ocsigenserver" -version: "5.0.1" +version: "5.0.2" maintainer: "dev@ocsigen.org" synopsis: "A full-featured and extensible Web server" description: "Ocsigen Server implements most features of the HTTP protocol, and has a very powerful extension mechanism that makes it very easy to plug your own OCaml modules for generating pages. Many extensions are already implemented, like a reverse proxy, content compression, access control, authentication, etc." diff --git a/src/server/ocsigen_server.ml b/src/server/ocsigen_server.ml index bf35eb965..564ad6a06 100644 --- a/src/server/ocsigen_server.ml +++ b/src/server/ocsigen_server.ml @@ -326,6 +326,18 @@ let start ?config () = | l, Some (crt, key) -> List.map (fun (a, p) -> a, p, (crt, key)) l | _ -> [] in + let listeners = + List.map + (fun (address, port) -> + Ocsigen_cohttp.service ~address ~port + ~connector:extensions_connector ()) + connection + @ (List.map (fun (address, port, (crt, key)) -> + Ocsigen_cohttp.service + ~ssl:(crt, key, Some (ask_for_passwd [address, port])) + ~address ~port ~connector:extensions_connector ())) + ssl_connection + in let current_uid = Unix.getuid () in let gid = match group with @@ -438,18 +450,7 @@ let start ?config () = >>= f in ignore (f ()); - Lwt_main.run - @@ Lwt.join - (List.map - (fun (address, port) -> - Ocsigen_cohttp.service ~address ~port - ~connector:extensions_connector ()) - connection - @ (List.map (fun (address, port, (crt, key)) -> - Ocsigen_cohttp.service - ~ssl:(crt, key, Some (ask_for_passwd [address, port])) - ~address ~port ~connector:extensions_connector ())) - ssl_connection) + Lwt_main.run @@ Lwt.join listeners (* Ocsigen_messages.warning "Ocsigen has been launched (initialisations ok)";