From dfa2ac7a7c291b58e445d005438ea7f535d466bf Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Thu, 6 Mar 2003 15:07:17 +0000 Subject: [PATCH] minimal changes: - added a TODO comment - factorized some code - removed old useless debugging prints --- helm/searchEngine/searchEngine.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/helm/searchEngine/searchEngine.ml b/helm/searchEngine/searchEngine.ml index 7b5635704..7e859775a 100644 --- a/helm/searchEngine/searchEngine.ml +++ b/helm/searchEngine/searchEngine.ml @@ -1,4 +1,3 @@ - (* Copyright (C) 2002, HELM Team. * * This file is part of HELM, an Hypertextual, Electronic @@ -113,12 +112,14 @@ let callback (req: Http_types.request) outchan = let result = MQueryGenerator.locate id in Http_daemon.respond ~headers:[contype] ~body:(pp_result result) outchan | "/getpage" -> + (* TODO implement "is_permitted" *) (let is_permitted _ = true in let remove_fragment uri = Pcre.replace ~pat:"#.*" uri in - match req#param "url" with - | page when is_permitted (remove_fragment page) -> + let page = remove_fragment (req#param "url") in + match page with + | page when is_permitted page -> Http_daemon.respond_file - ~fname:(sprintf "%s/%s" pages_dir (remove_fragment page)) outchan + ~fname:(sprintf "%s/%s" pages_dir page) outchan | page -> Http_daemon.respond_forbidden ~url:page outchan) | "/searchPattern" -> let term_string = req#param "term" in @@ -258,7 +259,6 @@ let callback (req: Http_types.request) outchan = let must = MQueryLevels2.get_constraints term' in let must',only = refine_constraints must in let results = MQueryGenerator.searchPattern must' only in - debug_print "FASE 3"; iter_file (fun line -> let new_aliases = @@ -300,7 +300,7 @@ let callback (req: Http_types.request) outchan = | exc -> Http_daemon.respond ~body:(pp_error ("Uncaught exception: " ^ (Printexc.to_string exc))) - outchan + outchan in printf "%s started and listening on port %d\n" daemon_name port; printf "current directory is %s\n" (Sys.getcwd ()); -- 2.39.2