ignore (Unix.system (
sprintf "make PID=%s clean_tmp; rm -f prova0.%s.dot" pid pid))
| invalid_request ->
- Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan)
+ Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request))
+ outchan)
with
| Http_types.Param_not_found attr_name ->
- Http_daemon.respond_error
- ~status:(`Client_error `Bad_request)
+ Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request))
~body:(sprintf "Parameter '%s' is missing" attr_name)
outchan
in
| invalid_request ->
debug_print ("Invalid request received");
- Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan);
+ Http_daemon.respond_error
+ ~code:(`Status (`Client_error `Bad_request)) outchan);
prerr_endline "Request done!\n"
with
| Http_types.Param_not_found attr_name ->
- Http_daemon.respond_error
- ~status:(`Client_error `Bad_request)
+ Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request))
~body:(sprintf "Parameter '%s' is missing" attr_name)
outchan
| Failure "int_of_string" -> (* error in converting some paramters *)
- Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan
- | Queue_not_found queue_name ->
Http_daemon.respond_error
- ~status:(`Client_error `Bad_request)
+ ~code:(`Status (`Client_error `Bad_request)) outchan
+ | Queue_not_found queue_name ->
+ Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request))
~body:(sprintf "Queue '%d' is not defined" queue_name)
outchan
in
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;
* 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 "<html><body>\n"; flush 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 ->
let bad_request outchan =
printf "INVALID REQUEST !!!!!\n\n";
flush stdout;
- Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan;
+ Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request))
+ outchan;
flush outchan
;;
outchan := outchan' ;
try
let uri = req#param "uri" in
- 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' ;
printf "Request to proof-check \"%s\"..." uri;