* Stefano Zacchiroli <zack@cs.unibo.it>
* for the HELM Team http://helm.cs.unibo.it/
*
- * This file is part of HELM, an Hypertextual, Electronic
- * Library of Mathematics, developed at the Computer Science
+ * This file is part of HELM, an Hypertextual, Electronic * Library of Mathematics, developed at the Computer Science
* Department, University of Bologna, Italy.
*
* HELM is free software; you can redistribute it and/or
| v -> return_value var v)))
let servers_file = safe_getenv "HTTP_GETTER_SERVERS_FILE"
+
+ (* TODO BUG HERE: is commented lines are included in the servers file the
+ server index (used for example by the remove_server method) gets out of sync!
+ *)
let parse_servers () =
- (let cons hd tl = hd @ [ tl ] in
- Http_getter_misc.fold_file cons [] servers_file)
+ List.rev (Http_getter_misc.fold_file
+ (fun servers line ->
+ if Http_getter_misc.is_blank_line line then servers else line::servers)
+ []
+ servers_file)
+;;
let servers = ref (parse_servers ())
let reload_servers () = servers := parse_servers ()