X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Frdfly%2Frdfly.ml;h=b9a79d1397da4941f444b678bc6d62d04322e995;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=da06477dc652a7e1d8cfe5f4788c7b0f3fab482f;hpb=a3026b5d06a07baa98da0e9ac841975232a8a60b;p=helm.git diff --git a/helm/DEVEL/rdfly/rdfly.ml b/helm/DEVEL/rdfly/rdfly.ml index da06477dc..b9a79d139 100644 --- a/helm/DEVEL/rdfly/rdfly.ml +++ b/helm/DEVEL/rdfly/rdfly.ml @@ -24,7 +24,7 @@ let mk_new_msg () = ref [] let msg_output_string msg s = msg := s::!msg let msg_serialize msg = - List.fold_left (fun acc s -> s ^ acc) "" !msg + String.concat "" (List.rev !msg) let msg_output_header msg obj = msg_output_string msg "\n\n" ; @@ -131,7 +131,8 @@ let mk_return_fun contype msg outchan = let return_html = mk_return_fun "text/html" let return_xml = mk_return_fun "text/xml" -let return_400 body ch = Http_daemon.respond_error ~code:400 ~body ch +let return_400 body ch = + Http_daemon.respond_error ~code:(`Code 400) ~body ch let return_html_error s = return_html ("" ^ s ^ "") let get_option key = @@ -170,7 +171,9 @@ let callback (req: Http_types.request) ch = | s -> return_html_error ("unsupported kind: " ^ s) ch end ; M.disconnect db - | invalid_request -> Http_daemon.respond_error ~status:(`Client_error `Bad_request) ch) + | invalid_request -> + Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request)) + ch) with | Http_types.Param_not_found attr_name -> return_400 (Printf.sprintf "Parameter '%s' is missing" attr_name) ch