File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1119,6 +1119,20 @@ let setup_lwt config answer =
1119
1119
let server_lwt config answer =
1120
1120
Lwt_main. run @@ setup_lwt config answer
1121
1121
1122
+ let setup_bind_lwt addr http_config =
1123
+ match addr, Systemd.Daemon. listen_fds_lwt () with
1124
+ | None , [] ->
1125
+ Exn. fail " bind not provided and no systemd socket available"
1126
+ | None , fd :: fds ->
1127
+ log#info " starting httpev in systemd mode" ;
1128
+ if fds <> [] then
1129
+ log#warn " more than one fd is provided by systemd, only the first one is used and the other ones are ignored" ;
1130
+ setup_fd_lwt fd http_config, " systemd socket"
1131
+ | Some bind , _ ->
1132
+ let connection = Nix. sockaddr_of_string bind in
1133
+ let signature = sprintf " listen %s" (Nix. show_addr connection) in
1134
+ setup_lwt { http_config with connection }, signature
1135
+
1122
1136
module Answer = struct
1123
1137
1124
1138
let return ?(status =`Ok ) ?(extra =[] ) ~typ data : [> `Body of reply_status reply' ] Lwt.t =
You can’t perform that action at this time.
0 commit comments