Skip to content

Commit

Permalink
Static linking: add Ocsigen_config.has_configuration_file
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed May 22, 2024
1 parent fe217ee commit 7f164a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/server/ocsigen_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,6 @@ let display_version () =
print_string version_number;
print_newline ();
exit 0

let has_config_file = ref false
let has_configuration_file () = !has_config_file
4 changes: 4 additions & 0 deletions src/server/ocsigen_config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ val get_max_number_of_connections : unit -> int
val get_client_timeout : unit -> int
val get_server_timeout : unit -> int

val has_configuration_file : unit -> bool
(** returns true if Ocsigen Server is running with a configuration file, *)

(*val get_keepalive_timeout : unit -> int
val get_keepopen_timeout : unit -> int*)
val get_filebuffersize : unit -> int
Expand Down Expand Up @@ -138,3 +141,4 @@ val get_uploaddir : unit -> string option
(* Same thing for upload size *)
val set_maxuploadfilesize : int64 option -> unit
val get_maxuploadfilesize : unit -> int64 option
val has_config_file : bool ref
4 changes: 3 additions & 1 deletion src/server/ocsigen_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@ let main config =
Ocsigen_messages.errlog msg;
exit errno

let exec = function
let exec config =
Ocsigen_config.has_config_file := true;
match config with
| [] -> ()
| [h] ->
(try Ocsigen_parseconfig.first_pass h
Expand Down

0 comments on commit 7f164a0

Please sign in to comment.