X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fhttp_getter%2Fmain.ml;h=8fa671ab9febd8ae04b44c687cca723f40505aee;hb=e76b78d1d80796de1b8f6a469741cbd26cd4d822;hp=6a3ec6a0d2c2aec9f83b4efeb62003a3961c3d34;hpb=281b71a8467b8643386a07211f18864b2b71bdec;p=helm.git diff --git a/helm/http_getter/main.ml b/helm/http_getter/main.ml index 6a3ec6a0d..8fa671ab9 100644 --- a/helm/http_getter/main.ml +++ b/helm/http_getter/main.ml @@ -34,8 +34,7 @@ open Http_getter_types (* constants *) -(* let configuration_file = "/projects/helm/etc/http_getter.conf.xml" *) -let configuration_file = "http_getter.conf.xml" +let configuration_file = BuildTimeOpts.conffile let common_headers = [ "Cache-Control", "no-cache"; @@ -124,10 +123,11 @@ let return_html_internal_error = mk_return_fun pp_internal_error "text/html" let return_html_msg = mk_return_fun pp_msg "text/html" let return_html_raw = mk_return_fun null_pp "text/html" let return_xml_raw = mk_return_fun null_pp "text/xml" -let return_400 body outchan = Http_daemon.respond_error ~code:400 ~body outchan +let return_400 body outchan = + Http_daemon.respond_error ~code:(`Code 400) ~body outchan let return_all_foo_uris doctype uris outchan = - Http_daemon.send_basic_headers ~code:200 outchan; + Http_daemon.send_basic_headers ~code:(`Code 200) outchan; Http_daemon.send_header "Content-Type" "text/xml" outchan; Http_daemon.send_headers common_headers outchan; Http_daemon.send_CRLF outchan; @@ -234,7 +234,7 @@ let log_failure msg = Http_getter_logger.log ("Request not fulfilled: " ^ msg) * given output channel. Response is sent embedded in an HTML document. * Channel is closed afterwards. *) let send_log_to ?prepend action outchan = - Http_daemon.send_basic_headers ~code:200 outchan; + Http_daemon.send_basic_headers ~code:(`Code 200) outchan; Http_daemon.send_header "Content-Type" "text/html" outchan; Http_daemon.send_CRLF outchan; output_string outchan "\n"; flush outchan; @@ -307,7 +307,8 @@ let callback (req: Http_types.request) outchan = | "/getempty" -> Http_daemon.respond ~body:Http_getter_const.empty_xml outchan | invalid_request -> - Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan); + Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request)) + outchan); Http_getter_logger.log "Done!\n" with | Http_types.Param_not_found attr_name ->