| v -> return_value var v)))
let servers_file = safe_getenv "HTTP_GETTER_SERVERS_FILE"
-let servers =
- let cons hd tl = hd @ [ tl ] in
- Http_getter_misc.fold_file cons [] servers_file
+let parse_servers () =
+ (let cons hd tl = hd @ [ tl ] in
+ Http_getter_misc.fold_file cons [] servers_file)
+let servers = ref (parse_servers ())
+let reload_servers () = servers := parse_servers ()
let xml_dbm = safe_getenv "HTTP_GETTER_XML_DBM"
let rdf_dbm = safe_getenv "HTTP_GETTER_RDF_DBM"
| "gz" -> Enc_gzipped
| mode -> failwith ("Invalid cache mode: " ^ mode)
+let reload () =
+ reload_servers ()
+
let dump_env () =
printf
"xml_dbm:\t%s
xml_dir rdf_dir dtd_dir servers_file host port
my_own_url dtd_base_url
(match cache_mode with Enc_normal -> "Normal" | Enc_gzipped -> "GZipped")
- conf_file conf_dir (String.concat "\n\t" servers);
+ conf_file conf_dir (String.concat "\n\t" !servers);
flush stdout
(* derived data *)
- val host : string (* host on which getter listens *)
- val my_own_url : string (* URL at which contact getter *)
- val servers : string list (* servers list (i.e. servers_file lines) *)
+ val host : string (* host on which getter listens *)
+ val my_own_url : string (* URL at which contact getter *)
+ val servers : string list ref (* servers list *)
val cache_mode : http_getter_encoding (* cached files encoding *)
- val conf_file : string (* configuration file's full path *)
- val conf_dir : string (* directory where conf_file resides *)
+ val conf_file : string (* configuration file's full path *)
+ val conf_dir : string (* directory where conf_file resides *)
(* misc *)
+val reload: unit -> unit (* reload servers list *)
val dump_env : unit -> unit (* dump a textual representation of the
current http_getter settings *)