+- ignore comments and blank lines in servers file
- added "list_servers", "add_server", "remove_server" methods
- bugfix: multiple definition of URI by different servers are now permitted
let servers_file = safe_getenv "HTTP_GETTER_SERVERS_FILE"
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 ()