diff --git a/src/lib/client/common/dune b/src/lib/client/common/dune index 30c8ec4159..5b319ff68b 100644 --- a/src/lib/client/common/dune +++ b/src/lib/client/common/dune @@ -4,10 +4,8 @@ (public_name eliom.client.common) (libraries eliom.common - js_of_ocaml js_of_ocaml.tyxml js_of_ocaml-lwt.logger - ocsigenserver react reactiveData) (preprocess diff --git a/src/lib/client/common/eliom_content_core.ml b/src/lib/client/common/eliom_content_core.ml index a0fbb729b5..592d0f1356 100644 --- a/src/lib/client/common/eliom_content_core.ml +++ b/src/lib/client/common/eliom_content_core.ml @@ -72,7 +72,7 @@ module Xml = struct Lazy.force elt.elt in { node_id = id; elt = Lazy.from_fun f } - let force_lazy { elt; _ } = ignore (Lazy.force elt) + let force_lazy { elt } = ignore (Lazy.force elt) let make_react ?(id = NoId) signal = {elt = Lazy.from_val (ReactNode signal); node_id = id; } diff --git a/src/lib/client/common/eliom_lib.ml b/src/lib/client/common/eliom_lib.ml index 12b15ce4eb..382fff5c7c 100644 --- a/src/lib/client/common/eliom_lib.ml +++ b/src/lib/client/common/eliom_lib.ml @@ -67,9 +67,9 @@ module Url = struct String.concat "/" l let path_of_url = function - | Url.Http {Url.hu_path = path; _} - | Url.Https {Url.hu_path = path; _} - | Url.File {Url.fu_path = path; _} -> + | Url.Http {Url.hu_path = path} + | Url.Https {Url.hu_path = path} + | Url.File {Url.fu_path = path} -> path let path_of_url_string s = @@ -148,8 +148,8 @@ end (* We do not use the deriving (un)marshaling even if typ is available because direct jsn (un)marshaling is very fast client side *) -let to_json ?typ:_ s = Js.to_string (Json.output s) -let of_json ?typ:_ v = Json.unsafe_input (Js.string v) +let to_json ?typ s = Js.to_string (Json.output s) +let of_json ?typ v = Json.unsafe_input (Js.string v) (* to marshal data and put it in a form *) let encode_form_value x = to_json x @@ -166,5 +166,5 @@ let unmarshal_js var = type file_info = File.file Js.t -let make_cryptographic_safe_string ?len:_ () = +let make_cryptographic_safe_string ?len () = failwith "make_cryptographic_safe_string not implemented client-side" diff --git a/src/lib/client/common/eliom_unwrap.ml b/src/lib/client/common/eliom_unwrap.ml index 1363a52103..ee8821a7ea 100644 --- a/src/lib/client/common/eliom_unwrap.ml +++ b/src/lib/client/common/eliom_unwrap.ml @@ -34,7 +34,7 @@ let map : (Obj.t,Obj.t) weakMap Js.t = jsnew weakMap () open Js_of_ocaml open Eliom_lib -let _section = Lwt_log.Section.make "eliom:unwrap" +let section = Lwt_log.Section.make "eliom:unwrap" module Mark : sig type t diff --git a/src/lib/client/dune b/src/lib/client/dune index 399901ec7f..d7dadd3e3a 100644 --- a/src/lib/client/dune +++ b/src/lib/client/dune @@ -5,22 +5,9 @@ (libraries eliom.common eliom.client.common - ipaddr lwt - js_of_ocaml js_of_ocaml-lwt - js_of_ocaml-lwt.logger - js_of_ocaml.tyxml - lwt_log - lwt_log.core - lwt_react - netstring-pcre - ocsigenserver - ocsigenserver.cookies - ocsigenserver.ext - react - reactiveData - tyxml) + lwt_react) (preprocess (pps js_of_ocaml-ppx diff --git a/src/lib/client/eliom_bus.ml b/src/lib/client/eliom_bus.ml index 099c6ee7d4..6465e3a61a 100644 --- a/src/lib/client/eliom_bus.ml +++ b/src/lib/client/eliom_bus.ml @@ -46,7 +46,6 @@ let consume (t,u) s = | Lwt.Sleep -> Lwt.wakeup_exn u e; | _ -> ()); [%lwt raise ( e)] - [@ocaml.warning "-22"] in Lwt.choose [Lwt.bind t (fun _ -> Lwt.return_unit);t'] @@ -58,8 +57,7 @@ let clone_exn (t,u) s = (match Lwt.state t with | Lwt.Sleep -> Lwt.wakeup_exn u e; | _ -> ()); - [%lwt raise ( e)] - [@ocaml.warning "-22"]) + [%lwt raise ( e)]) type ('a, 'att, 'co, 'ext, 'reg) callable_bus_service = (unit, 'a list, Eliom_service.post, @@ -80,7 +78,7 @@ let create service channel waiter = in let error_h = let t,u = Lwt.wait () in - (try%lwt let%lwt _ = t in assert false with e -> [%lwt raise ( e)][@ocaml.warning "-22"]), u in + (try%lwt let%lwt _ = t in assert false with e -> [%lwt raise ( e)]), u in let stream = lazy ( let stream = Eliom_comet.register channel in @@ -110,7 +108,7 @@ let create service channel waiter = in t -let internal_unwrap ((wrapped_bus:('a, 'b) Ecb.wrapped_bus),_unwrapper) = +let internal_unwrap ((wrapped_bus:('a, 'b) Ecb.wrapped_bus),unwrapper) = let waiter () = Lwt_js.sleep 0.05 in let channel, Eliom_comet_base.Bus_send_service service = wrapped_bus in create service channel waiter @@ -143,7 +141,7 @@ let write t v = Queue.add v t.queue; try_flush t -let close {channel; _} = Eliom_comet.close channel +let close {channel} = Eliom_comet.close channel let set_queue_size b s = b.max_size <- s diff --git a/src/lib/client/eliom_client.ml b/src/lib/client/eliom_client.ml index b2533cd652..8253250f45 100644 --- a/src/lib/client/eliom_client.ml +++ b/src/lib/client/eliom_client.ml @@ -59,7 +59,7 @@ let get_global_data () = match Eliom_unwrap.unwrap (Url.decode (Js.to_string v)) 0 with - | {Eliom_runtime.ecs_data = `Success v; _} -> + | {Eliom_runtime.ecs_data = `Success v} -> Lwt_log.ign_debug_f "Unwrap __global_data success"; Some v | _ -> @@ -153,12 +153,12 @@ let init () = match Url.url_of_string (Js.to_string (Js.Unsafe.global##.___eliom_server_)) with - | Some (Http { hu_host; hu_port; hu_path = _; _ }) -> + | Some (Http { hu_host; hu_port; hu_path; _ }) -> init_client_app ~app_name ~ssl:false ~hostname:hu_host ~port:hu_port ~site_dir () - | Some (Https { hu_host; hu_port; hu_path = _; _ }) -> + | Some (Https { hu_host; hu_port; hu_path; _ }) -> init_client_app ~app_name ~ssl:true ~hostname:hu_host ~port:hu_port ~site_dir () @@ -196,7 +196,7 @@ let init () = let onload_handler = ref None in - let onload _ev = + let onload ev = let js_data = Lazy.force js_data in Lwt_log.ign_debug ~section "onload (client main)"; begin match !onload_handler with @@ -361,7 +361,7 @@ let raw_call_service ?progress ?upload_progress ?override_mime_type uri post_params Eliom_request.string_result in match content with - | None -> [%lwt raise ( (Eliom_request.Failed_request 204))][@ocaml.warning "-22"] + | None -> [%lwt raise ( (Eliom_request.Failed_request 204))] | Some content -> Lwt.return (uri, content) let call_service @@ -507,13 +507,11 @@ let garbage_collect_cached_doms () = in let rec accum_past = function | Some idx when !size < n -> - begin try let dom = HistCache.find idx !history_doms in add idx dom; accum_past dom.page.previous_page with Not_found -> () - end | _ -> () in let _, _, future = HistCache.split cur_index !history_doms in @@ -699,7 +697,8 @@ let set_template_content ~replace ~uri ?fragment = (match fragment with | None -> change_url_string ~replace uri | Some fragment -> - change_url_string ~replace (uri ^ "#" ^ fragment)); + change_url_string ~replace (uri ^ "#" ^ fragment) + | _ -> ()); let%lwt () = Lwt_mutex.lock load_mutex in let%lwt (), request_data = unwrap_caml_content content in do_request_data request_data; @@ -783,7 +782,6 @@ let set_content_local ?offset ?fragment new_page = recover (); Lwt_log.ign_debug ~section ~exn "set_content_local"; [%lwt raise ( exn)] - [@@ocaml.warning "-22"] (* Function to be called for server side services: *) let set_content ~replace ~uri ?offset ?fragment content = @@ -887,7 +885,6 @@ let set_content ~replace ~uri ?offset ?fragment content = recover (); Lwt_log.ign_debug ~section ~exn "set_content"; [%lwt raise ( exn)] - [@@ocaml.warning "-22"] let ocamlify_params = List.map @@ -942,7 +939,7 @@ let make_uri subpath params = Eliom_uri.make_string_uri_from_components (base, params, None) let route ~replace ?(keep_url = false) - ({ Eliom_route.i_subpath ; i_get_params ; i_post_params; _ } as info) = + ({ Eliom_route.i_subpath ; i_get_params ; i_post_params } as info) = Lwt_log.ign_debug ~section:section_page "Route"; let r = !Eliom_request_info.get_sess_info and info, i_subpath = @@ -969,7 +966,7 @@ let perform_reload () = Lwt_log.ign_debug ~section:section_page "Perform reload"; let uri = !current_uri in let - ({ Eliom_common.si_all_get_params ; si_all_post_params = _; _ } + ({ Eliom_common.si_all_get_params ; si_all_post_params } as i_sess_info) = !Eliom_request_info.get_sess_info () and i_subpath = Url.path_of_url_string uri in @@ -1114,7 +1111,7 @@ type _ redirection = 'a redirection let change_page_unknown - ?meth ?hostname:_ ?(replace = false) i_subpath i_get_params i_post_params = + ?meth ?hostname ?(replace = false) i_subpath i_get_params i_post_params = Lwt_log.ign_debug ~section:section_page "Change page unknown"; let i_sess_info = !Eliom_request_info.get_sess_info () and i_meth = diff --git a/src/lib/client/eliom_client_core.ml b/src/lib/client/eliom_client_core.ml index ebe2812cab..0b15f11da2 100644 --- a/src/lib/client/eliom_client_core.ml +++ b/src/lib/client/eliom_client_core.ml @@ -193,7 +193,7 @@ end = struct Lwt_log.raise_error_f "Did not find injection %s" name)) let initialize ~compilation_unit_id - { Eliom_runtime.injection_id; injection_value; _ } = + { Eliom_runtime.injection_id; injection_value } = Lwt_log.ign_debug_f ~section "Initialize injection %d" injection_id; (* BBB One should assert that injection_value doesn't contain any value marked for late unwrapping. How to do this efficiently? *) @@ -269,7 +269,7 @@ let check_global_data global_data = "Code generating the following client values is not linked on the client:\n%s" (String.concat "\n" (List.rev_map - (fun {Eliom_runtime.closure_id; value; _} -> + (fun {Eliom_runtime.closure_id; value} -> let instance_id = Eliom_runtime.Client_value_server_repr.instance_id value in @@ -404,14 +404,14 @@ let in_onload, broadcast_load_end, wait_load_end, set_loading_phase = (* forward declaration... *) let change_page_uri_ : (?cookies_info:bool * string list -> ?tmpl:string -> string -> unit) ref - = ref (fun ?cookies_info:_ ?tmpl:_ _href -> assert false) + = ref (fun ?cookies_info ?tmpl href -> assert false) let change_page_get_form_ : (?cookies_info:bool * string list -> ?tmpl:string -> Dom_html.formElement Js.t -> string -> unit) ref - = ref (fun ?cookies_info:_ ?tmpl:_ _form _href -> assert false) + = ref (fun ?cookies_info ?tmpl form href -> assert false) let change_page_post_form_ = - ref (fun ?cookies_info:_ ?tmpl:_ _form _href -> assert false) + ref (fun ?cookies_info ?tmpl form href -> assert false) type client_form_handler = Dom_html.event Js.t -> bool Lwt.t @@ -540,7 +540,7 @@ let rebuild_attrib_val = function let class_list_of_racontent = function | Xml.AStr s -> [s] - | Xml.AStrL (_space, l) -> + | Xml.AStrL (space, l) -> l | _ -> failwith "attribute class is not a string" @@ -861,7 +861,7 @@ let form_handler (fun () -> Lwt_log.raise_error_f ~section "not a form element") in let kind = - if String.lowercase_ascii(Js.to_string form##._method) = "get" + if String.lowercase(Js.to_string form##._method) = "get" then `Form_get else `Form_post and f _ = Lwt.return_false in @@ -1008,7 +1008,7 @@ let is_attrib_attrib,get_attrib_id = attr##.name##(substring (0) n_len) = n_prefix_js), (fun attr -> attr##.value##(substring_toEnd v_len)) -let relink_attrib _root table (node:Dom_html.element Js.t) = +let relink_attrib root table (node:Dom_html.element Js.t) = Lwt_log.ign_debug ~section "Relink attribute"; let aux attr = if is_attrib_attrib attr diff --git a/src/lib/client/eliom_comet.ml b/src/lib/client/eliom_comet.ml index 1ec50ccae0..a2e43e31d8 100644 --- a/src/lib/client/eliom_comet.ml +++ b/src/lib/client/eliom_comet.ml @@ -393,14 +393,14 @@ struct let call_service_after_load_end service p1 p2 = let%lwt () = Eliom_client.wait_load_end () in - Eliom_client.call_service ~service p1 p2 + Eliom_client.call_service service p1 p2 let make_request hd = match hd.hd_state with | Stateful_state count -> (Ecb.Stateful (Ecb.Request_data !count)) | Stateless_state map -> let l = Eliom_lib.String.Table.fold - (fun channel { position; _ } l -> (channel,position)::l) !map [] + (fun channel { position } l -> (channel,position)::l) !map [] in Ecb.Stateless (Array.of_list l) @@ -414,8 +414,8 @@ struct | Stateful_state r -> incr r; List.iter (function - | ( _chan_id, Ecb.Data _ ) -> () - | ( _chan_id, Ecb.Closed ) -> + | ( chan_id, Ecb.Data _ ) -> () + | ( chan_id, Ecb.Closed ) -> Eliom_lib.Lwt_log.ign_warning ~section "update_stateful_state: received Closed: should not happen, this is an eliom bug, please report it" | ( chan_id, Ecb.Full ) -> @@ -468,7 +468,7 @@ struct raise (Comet_error ("update_stateless_state on stateful one")) let call_service - ({ hd_activity; hd_service = Ecb.Comet_service srv; _ } as hd) = + ({ hd_activity; hd_service = Ecb.Comet_service srv } as hd) = let%lwt () = Configuration.sleep_before_next_request (fun () -> hd_activity.focused) @@ -554,7 +554,7 @@ struct update_activity hd; aux 0 - let call_commands {hd_service = Ecb.Comet_service srv; _} command = + let call_commands {hd_service = Ecb.Comet_service srv} command = ignore (try%lwt call_service_after_load_end srv () @@ -684,22 +684,22 @@ let get_stateless_hd (service:Ecb.comet_service) : Service_handler.stateless han | Not_found -> init service Service_handler.stateless stateless_handler_table let activate () = - let f _ { hd_service_handler; _ } = + let f _ { hd_service_handler } = Service_handler.activate hd_service_handler in Hashtbl.iter f stateless_handler_table; Hashtbl.iter f stateful_handler_table let restart () = - let f _ { hd_service_handler; _ } = Service_handler.restart hd_service_handler in + let f _ { hd_service_handler } = Service_handler.restart hd_service_handler in Hashtbl.iter f stateless_handler_table; Hashtbl.iter f stateful_handler_table let close = function | Ecb.Stateful_channel (chan_service,chan_id) -> - let { hd_service_handler; _ } = get_stateful_hd chan_service in + let { hd_service_handler } = get_stateful_hd chan_service in Service_handler.close hd_service_handler (Ecb.string_of_chan_id chan_id) - | Ecb.Stateless_channel (chan_service,chan_id,_kind) -> - let { hd_service_handler; _ } = get_stateless_hd chan_service in + | Ecb.Stateless_channel (chan_service,chan_id,kind) -> + let { hd_service_handler } = get_stateless_hd chan_service in Service_handler.close hd_service_handler (Ecb.string_of_chan_id chan_id) let unmarshal s : 'a = Eliom_unwrap.unwrap (Eliom_lib.Url.decode s) 0 @@ -738,7 +738,7 @@ let check_and_update_position position msg_pos data = (* stateless channels are registered with a position: when a channel is registered more than one time, it is possible to receive old messages: the position is used to filter them out. *) -let register' hd position (_chan_service:Ecb.comet_service) (chan_id:'a Ecb.chan_id) = +let register' hd position (chan_service:Ecb.comet_service) (chan_id:'a Ecb.chan_id) = let chan_id = Ecb.string_of_chan_id chan_id in let stream = Lwt_stream.filter_map_s (function @@ -786,7 +786,7 @@ let register ?(wake=true) (wrapped_chan:'a Ecb.wrapped_channel) = | Ecb.Stateless_channel (s,c,kind) -> register_stateless ~wake s c kind -let internal_unwrap ( wrapped_chan, _unwrapper ) = register wrapped_chan +let internal_unwrap ( wrapped_chan, unwrapper ) = register wrapped_chan let () = Eliom_unwrap.register_unwrapper Eliom_common.comet_channel_unwrap_id internal_unwrap diff --git a/src/lib/client/eliom_common.ml b/src/lib/client/eliom_common.ml index dcb3188029..15a661b2ff 100644 --- a/src/lib/client/eliom_common.ml +++ b/src/lib/client/eliom_common.ml @@ -26,7 +26,7 @@ let get_sp_option () = Some () type 'a wrapper = unit -let make_wrapper _f :'a wrapper = () +let make_wrapper f :'a wrapper = () let empty_wrapper () :'a wrapper = () type unwrap_id = Eliom_unwrap.unwrap_id @@ -54,9 +54,9 @@ module To_and_of_shared = struct type 'a t = 'a to_and_of - let of_string {of_string; _} = of_string + let of_string {of_string} = of_string - let to_string {to_string; _} = to_string + let to_string {to_string} = to_string let to_and_of tao = tao diff --git a/src/lib/client/eliom_content_.ml b/src/lib/client/eliom_content_.ml index a69fce189f..d6917362c0 100644 --- a/src/lib/client/eliom_content_.ml +++ b/src/lib/client/eliom_content_.ml @@ -27,9 +27,7 @@ module Xml = Xml module MakeManip (Kind : sig type +'a elt - - val tot: Xml.elt -> 'a elt [@@ocaml.warning "-32"] - + val tot: Xml.elt -> 'a elt val toelt: 'a elt -> Xml.elt end) (To_dom : sig @@ -50,9 +48,9 @@ module MakeManip let get_unique_node context (elt: 'a Kind.elt) : Dom.node Js.t = match Xml.get_node (Kind.toelt elt) with | Xml.DomNode node -> node - | Xml.ReactNode _s -> get_node elt - | Xml.ReactChildren (_node,_rl) -> get_node elt - | Xml.TyXMLNode _desc -> + | Xml.ReactNode s -> get_node elt + | Xml.ReactChildren (node,rl) -> get_node elt + | Xml.TyXMLNode desc -> let elt' = Kind.toelt elt in match Xml.get_node_id elt' with | Xml.NoId -> @@ -323,8 +321,8 @@ module Svg = struct module D = Svg.D module R = Svg.R module C = struct - let node ?init:_ x = x - let attr ?init:_ x = x + let node ?init x = x + let attr ?init x = x end type +'a elt = 'a F.elt @@ -421,8 +419,8 @@ module Html = struct end module C = struct - let node ?init:_ x = x - let attr ?init:_ x = x + let node ?init x = x + let attr ?init x = x end type +'a elt = 'a F.elt diff --git a/src/lib/client/eliom_parameter.ml b/src/lib/client/eliom_parameter.ml index c0abd26497..8e5e60721b 100644 --- a/src/lib/client/eliom_parameter.ml +++ b/src/lib/client/eliom_parameter.ml @@ -110,7 +110,7 @@ and reconstruct_params_form : Some ((x1, x2), m) | TUnit -> Some ((), m) - | TOption (TAtom (_, TString) as y, _b) -> + | TOption (TAtom (_, TString) as y, b) -> (match reconstruct_params_form m y with | Some ("", m) -> Some (None, m) @@ -118,7 +118,7 @@ and reconstruct_params_form : Some (Some s, m) | None -> Some (None, m)) - | TOption (y, _b) -> + | TOption (y, b) -> (match reconstruct_params_form m y with | Some (x, m) -> Some (Some x, m) @@ -141,7 +141,7 @@ and reconstruct_params_form : reconstruct_atom ~f m (name ^ ".x") >>= fun (abscissa, m) -> reconstruct_atom ~f m (name ^ ".y") >>= fun (ordinate, m) -> Some ({abscissa ; ordinate}, m) - | TUserType (name, {of_string = f; _}) -> + | TUserType (name, {of_string = f}) -> reconstruct_atom ~f m name | _ -> None @@ -156,7 +156,7 @@ let reconstruct_params_form l y = reconstruct_params_form (M.of_assoc_list l) y >>= fun (v, _) -> Some v -let get_non_localized_get_parameters { name ; param ; _ } = +let get_non_localized_get_parameters { name ; param } = (* Simplified version of the server-side code that - only deals with GET params - doesn't cache the result diff --git a/src/lib/client/eliom_react.ml b/src/lib/client/eliom_react.ml index deb63c8ea4..ae4030b709 100644 --- a/src/lib/client/eliom_react.ml +++ b/src/lib/client/eliom_react.ml @@ -42,17 +42,17 @@ struct ((fun ?exn () -> !r ?exn ()), (fun f -> r := f)) - let internal_unwrap ( channel, _unwrapper ) = + let internal_unwrap ( channel, unwrapper ) = (* We want to catch more exceptions here than the usual exceptions caught in Eliom_comet. For example Channel_full. *) (* We transform the stream into a stream with exception: *) - let stream = Lwt_stream.wrap_exn channel in + let stream = Lwt_stream.map_exn channel in Lwt.async (fun () -> Lwt_stream.iter_s (function - | Error exn -> + | Lwt_stream.Error exn -> let%lwt () = handle_react_exn ~exn () in Lwt.fail exn - | Ok _ -> Lwt.return_unit) + | Lwt_stream.Value _ -> Lwt.return_unit) stream); E.of_stream channel @@ -67,7 +67,7 @@ struct type 'a t = ('a -> unit Lwt.t) - let internal_unwrap ( service, _unwrapper ) = + let internal_unwrap ( service, unwrapper ) = fun x -> Eliom_client.call_service ~service () x >|= fun _ -> () let () = @@ -82,7 +82,7 @@ struct struct type 'a t = 'a React.S.t - let internal_unwrap ( channel, value, _unwrapper ) = + let internal_unwrap ( channel, value, unwrapper ) = let e = E.of_stream channel in S.hold ~eq:(fun _ _ -> false) value e diff --git a/src/lib/client/eliom_registration.ml b/src/lib/client/eliom_registration.ml index a9cc696392..b78a7d4f69 100644 --- a/src/lib/client/eliom_registration.ml +++ b/src/lib/client/eliom_registration.ml @@ -108,7 +108,7 @@ let wrap service att f _ suffix = let wrap_na (service : (_, _, _, _, _, _, _, _, _, _, _) Eliom_service.t) - _non_att f _ suffix = + non_att f _ suffix = let gp = Eliom_service.get_params_type service and pp = Eliom_service.post_params_type service and si = !Eliom_request_info.get_sess_info () @@ -177,7 +177,7 @@ module Make (P : PARAM) = struct type return = P.return type result = P.result - let send ?options ?charset:_ ?code:_ ?content_type:_ ?headers:_ page = + let send ?options ?charset ?code ?content_type ?headers page = P.send ?options page let register @@ -218,7 +218,7 @@ module Action = Make (struct let reset_reload_fun = true - let send ?options _page = + let send ?options page = match options with | Some `Reload | None -> Eliom_client.perform_reload () @@ -236,7 +236,7 @@ module Unit = Make (struct let reset_reload_fun = true - let send ?options:_ _page = + let send ?options:_ page = Lwt.return_unit end) @@ -319,7 +319,7 @@ module Any = struct Lwt.return page let register - ?app ?scope:_ ?options:_ ?charset:_ ?code:_ ?content_type:_ + ?app ?scope:_ ?options ?charset:_ ?code:_ ?content_type:_ ?headers:_ ?secure_session:_ ~service ?error_handler:_ f = let f g p = let%lwt page = f g p in send page in diff --git a/src/lib/client/eliom_request.ml b/src/lib/client/eliom_request.ml index 023a167003..20a18057a2 100644 --- a/src/lib/client/eliom_request.ml +++ b/src/lib/client/eliom_request.ml @@ -56,9 +56,9 @@ let get_cookie_info_for_uri_js uri_js = (Eliom_request_info.get_csp_ssl (), path) ) ) - | Some (Url.Https { Url.hu_path = path; _ }) -> (true, path) - | Some (Url.Http { Url.hu_path = path; _ }) -> (false, path) - | Some (Url.File { Url.fu_path = path; _ }) -> (false, path) + | Some (Url.Https { Url.hu_path = path }) -> (true, path) + | Some (Url.Http { Url.hu_path = path }) -> (false, path) + | Some (Url.File { Url.fu_path = path }) -> (false, path) let get_cookie_info_for_uri uri = let uri_js = Js.bytestring uri in @@ -89,7 +89,7 @@ let redirect_post url params = in i##.value := v; Dom.appendChild f i - | `File _i -> + | `File i -> Lwt_log.raise_error ~section "redirect_post not implemented for files") params; f##.style##.display := (Js.string "none"); @@ -258,7 +258,7 @@ let send (match r.XmlHttpRequest.headers Eliom_common.half_xhr_redir_header with | None | Some "" -> Lwt.return (r.XmlHttpRequest.url, None) - | Some _uri -> + | Some uri -> redirect_post url (match post_args with | Some post_args -> post_args diff --git a/src/lib/client/eliom_request_info.ml b/src/lib/client/eliom_request_info.ml index 52ce648291..4cb1fd1808 100644 --- a/src/lib/client/eliom_request_info.ml +++ b/src/lib/client/eliom_request_info.ml @@ -84,7 +84,7 @@ let current_path_ = ref (remove_first_slash Url.Current.path) let set_current_path uri = current_path_ := Url.path_of_url_string (if uri = "./" then "" else uri) -let get_original_full_path_sp _sp = +let get_original_full_path_sp sp = (* returns current path, not the one when application started *) if Eliom_process.history_api && not !client_app_initialised then match Url.Current.get () with diff --git a/src/lib/client/eliom_route.ml b/src/lib/client/eliom_route.ml index bcb99ae0f7..3268aaaa59 100644 --- a/src/lib/client/eliom_route.ml +++ b/src/lib/client/eliom_route.ml @@ -21,11 +21,11 @@ module A = struct let site_data _ = () - let sess_info_of_info {i_sess_info; _} = i_sess_info + let sess_info_of_info {i_sess_info} = i_sess_info - let subpath_of_info {i_subpath; _} = i_subpath + let subpath_of_info {i_subpath} = i_subpath - let meth_of_info {i_meth; _} = i_meth + let meth_of_info {i_meth} = i_meth let make_params _ _ suffix _ = suffix @@ -54,15 +54,15 @@ module A = struct type t = table - let add {Eliom_common.key_meth; _} p m = + let add {Eliom_common.key_meth} p m = Raw_table.add key_meth (`Ptc p) m - let find {Eliom_common.key_meth; _} m = + let find {Eliom_common.key_meth} m = let `Ptc v = Raw_table.find key_meth m in v let empty () = Raw_table.empty - let remove {Eliom_common.key_meth; _} = Raw_table.remove key_meth + let remove {Eliom_common.key_meth} = Raw_table.remove key_meth end @@ -71,9 +71,9 @@ module A = struct type t = unit - let up _n = () + let up n = () - let remove _n = () + let remove n = () end @@ -90,7 +90,7 @@ module A = struct ) Hashtbl.t } - let get {t_services; _} = t_services + let get {t_services} = t_services let set_contains_timeout a b = a.t_contains_timeout <- b @@ -98,7 +98,7 @@ module A = struct let set tables l = tables.t_services <- l - let dlist_add ?sp:_ _tables _srv = () + let dlist_add ?sp:_ tables srv = () end @@ -114,19 +114,19 @@ let global_tables = A.Container.{ t_na_services = Hashtbl.create 256 } -let add_naservice {A.Container.t_na_services; _} k f = +let add_naservice {A.Container.t_na_services} k f = Hashtbl.add t_na_services k f -let call_naservice {A.Container.t_na_services; _} k = +let call_naservice {A.Container.t_na_services} k = try (Hashtbl.find t_na_services k) true None with Not_found -> Lwt.fail Eliom_common.Eliom_404 let rec na_key_of_params ~get = function - | (k, v) :: _l when k = Eliom_common.naservice_name -> + | (k, v) :: l when k = Eliom_common.naservice_name -> Some (if get then Eliom_common.SNa_get_ v else Eliom_common.SNa_post_ v) - | (k, v) :: _l when k = Eliom_common.naservice_num -> + | (k, v) :: l when k = Eliom_common.naservice_num -> Some (if get then Eliom_common.SNa_get' v else Eliom_common.SNa_post' v) | _ :: l -> na_key_of_params ~get l @@ -142,7 +142,7 @@ let rec remove_site_dir p p' = | _ -> None -let call_service ({i_get_params ; i_post_params ; i_subpath; _} as info) = +let call_service ({i_get_params ; i_post_params ; i_subpath} as info) = let info = match remove_site_dir diff --git a/src/lib/client/eliom_service.ml b/src/lib/client/eliom_service.ml index 2e819f0ec3..c83b810df3 100644 --- a/src/lib/client/eliom_service.ml +++ b/src/lib/client/eliom_service.ml @@ -53,10 +53,8 @@ let reload_fun : match Eliom_parameter.is_unit (post_params_type service) with | Eliom_parameter.U_yes -> (match service with - | { client_fun = Some {contents = Some f} - ; reload_fun = Rf_client_fun - ; _ - } -> + | { client_fun = Some {contents = Some f} ; + reload_fun = Rf_client_fun } -> Some f | _ -> None) @@ -65,8 +63,8 @@ let reload_fun : let reset_reload_fun service = service.reload_fun <- Rf_keep -let register_delayed_get_or_na_coservice ~sp:_ _s = +let register_delayed_get_or_na_coservice ~sp s = failwith "CSRF coservice not implemented client side for now" -let register_delayed_post_coservice ~sp:_ _s _getname = +let register_delayed_post_coservice ~sp s getname = failwith "CSRF coservice not implemented client side for now" diff --git a/src/lib/client/eliommod_dom.ml b/src/lib/client/eliommod_dom.ml index 86696ff860..05d11bd39e 100644 --- a/src/lib/client/eliommod_dom.ml +++ b/src/lib/client/eliommod_dom.ml @@ -546,7 +546,7 @@ let rewrite_css_url ~prefix css pos = if pos < String.length css then match Regexp.search url_re css pos with | None -> Buffer.add_substring buf css pos (String.length css - pos) - | Some (i, _res) -> + | Some (i, res) -> Buffer.add_substring buf css pos (i - pos); try let i, href = parse_url ~prefix css i in @@ -575,7 +575,7 @@ let rec rewrite_css ~max (media, href, css) = if !Eliom_config.debug_timings then Firebug.console##(timeEnd (Js.string ("rewrite_CSS: "^href))); Lwt.return (imports @ [(media, css)]) - with _e -> + with e -> Lwt.return [(media, Printf.sprintf "@import url(%s);" href)] and rewrite_css_import ?(charset = "") ~max ~prefix ~media css pos = @@ -697,7 +697,7 @@ let _ = ignore (Dom.addEventListener Dom_html.document (Dom.Event.make "scroll") - (Dom_html.handler (fun _event -> + (Dom_html.handler (fun event -> current_position := createDocumentScroll (); Js._false)) Js._true : Dom_html.event_listener_id) diff --git a/src/lib/common/dune b/src/lib/common/dune index b88dcf42d3..f2106e263f 100644 --- a/src/lib/common/dune +++ b/src/lib/common/dune @@ -1,5 +1,5 @@ (library (name common) (public_name eliom.common) - (libraries lwt_log lwt_log.core ocsigenserver) + (libraries lwt_log ocsigenserver) (wrapped false)) \ No newline at end of file diff --git a/src/lib/common/eliom_wrap.ml b/src/lib/common/eliom_wrap.ml index 9f788242fc..0796000601 100644 --- a/src/lib/common/eliom_wrap.ml +++ b/src/lib/common/eliom_wrap.ml @@ -98,7 +98,7 @@ let none = Obj.repr 0 (* Unallocated entry in an array or in a hash-table *) module DynArray = struct type 'a t = 'a array ref - let rec check_size (a:'a t) i = + let rec check_size a i = let len = Array.length !a in if i > len then begin let old_a = !a in @@ -235,8 +235,35 @@ module Tbl = struct slight chance to perform an allocation; in which case, the table will no longer be up to date... *) let was_up_to_date tbl = tbl.gc = gc_count () + + let add_on_resize tbl f = tbl.on_resize <- f :: tbl.on_resize; end +(* Returns whether we should recursively scan the value or should + consider it as opaque. Also check for values that cannot be + serialized. *) +let can_scan v = + Obj.is_block v && + let tag = Obj.tag v in + if tag >= Obj.no_scan_tag then + false + else if + tag <= Obj.last_non_constant_constructor_tag || tag = Obj.forward_tag + then + true + else begin + if tag = Obj.lazy_tag then + failwith "lazy values must be forced before wrapping"; + if tag = Obj.object_tag then failwith "cannot wrap object values"; + if tag = Obj.closure_tag then failwith "cannot wrap functional values"; + if tag = Obj.infix_tag then + failwith "cannot wrap functional values: infix tag"; + (* Should not happen (in case a new kind of value is added) *) + failwith (Printf.sprintf "cannot wrap value (unexpected tag %d)" tag) + end + +type kind = Opaque | Scannable | Forward + let obj_kind v = if not (Obj.is_block v) then `Opaque diff --git a/src/lib/eliom/eliom_form.eliom b/src/lib/eliom/eliom_form.eliom index 0809c3f36c..2ea0674258 100644 --- a/src/lib/eliom/eliom_form.eliom +++ b/src/lib/eliom/eliom_form.eliom @@ -168,7 +168,7 @@ module Make_links (Html : Html) = struct Html.a_src uri :: (a :> Html_types.script_attrib attrib list) in - Html.script ~a (Html.txt "") + Html.script ~a (Html.pcdata "") end @@ -248,7 +248,7 @@ module Make (Html : Html) = struct let make_textarea ?(a = []) ~name ?(value = "") () = let a = a_name name :: (a :> Html_types.textarea_attrib attrib list) in - textarea ~a (txt value) + textarea ~a (pcdata value) let make_select ?(a = []) ~multiple ~name elt elts = let a = if multiple then a_multiple () :: a else a in @@ -327,7 +327,7 @@ module Make (Html : Html) = struct let get_form ?absolute ?absolute_path ?https ?a ~service ?hostname ?port - ?fragment ?keep_nl_params ?nl_params ?xhr:_ f = + ?fragment ?keep_nl_params ?nl_params ?xhr f = get_form_ (fun x f -> f x) (fun x -> x) ?absolute ?absolute_path @@ -375,7 +375,7 @@ module Make (Html : Html) = struct let post_form ?absolute ?absolute_path ?https ?a ~service ?hostname ?port - ?fragment ?keep_nl_params ?keep_get_na_params ?nl_params ?xhr:_ + ?fragment ?keep_nl_params ?keep_get_na_params ?nl_params ?xhr f getparams = post_form_ (fun x f -> f x) (fun x -> x) ?absolute ?absolute_path ?https ?a ~service ?hostname ?port @@ -531,7 +531,7 @@ module Make (Html : Html) = struct let make_opt (a, cv, co, sel) = (match co with | None -> - make_option ~a ~selected:sel (txt (string_of cv)) + make_option ~a ~selected:sel (pcdata (string_of cv)) | Some c -> make_option ~a ~selected:sel ~value:(string_of cv) c) in let make_optg = function diff --git a/src/lib/eliom/eliom_service_base.eliom b/src/lib/eliom/eliom_service_base.eliom index a2c8b159ca..2823c224e3 100644 --- a/src/lib/eliom/eliom_service_base.eliom +++ b/src/lib/eliom/eliom_service_base.eliom @@ -170,7 +170,7 @@ let pre_wrap s = { let service_mark () = Eliom_common.make_wrapper pre_wrap -let info {info; _} = info +let info {info} = info let pre_applied_parameters s = s.pre_applied_parameters let get_params_type s = s.get_params_type @@ -191,11 +191,11 @@ let priority s = s.priority let internal_set_client_fun ~service f = service.client_fun <- Some [%client ref (Some ~%f)] -let is_external = function {kind = `External; _} -> true | _ -> false +let is_external = function {kind = `External} -> true | _ -> false let default_priority = 0 -let meth {meth; _} = meth +let meth {meth} = meth let change_get_num service attser n = { service with @@ -288,7 +288,7 @@ type clvpreapp = { } let preapply_client_fun = { - clvpreapp_f = fun _f _getparams -> failwith "preapply_client_fun" + clvpreapp_f = fun f getparams -> failwith "preapply_client_fun" } (* will be initialized later (in Eliom_content for now), when client @@ -299,7 +299,7 @@ let rec append_suffix l m = match l with | [] -> m - | [_eliom_suffix_internal_name] -> + | [eliom_suffix_internal_name] -> m | a :: ll -> a :: append_suffix ll m @@ -328,7 +328,7 @@ let preapply ~service getparams = | Some suff -> append_suffix k.fullpath suff | _ -> k.fullpath); }; - | _ -> .); + | k -> k); client_fun = Some [%client ref @@ -444,16 +444,16 @@ let default_csrf_scope = function exception Unreachable_exn let attached_info = function - | {info = Attached k; _} -> + | {info = Attached k} -> k | _ -> - . + failwith "attached_info" let non_attached_info = function - | {info = Nonattached k; _} -> + | {info = Nonattached k} -> k | _ -> - . + failwith "non_attached_info" (** Create a main service (not a coservice), internal or external *) let main_service @@ -521,7 +521,7 @@ let extern ~reload_fun:Rf_keep () -let which_meth {meth; _} = meth +let which_meth {meth} = meth let which_meth_untyped (type m) (s : (_, _, m, _, _, _, _, _, _, _, _) t) = diff --git a/src/lib/eliom/eliom_shared.eliom b/src/lib/eliom/eliom_shared.eliom index e44b4a6a9d..98aba9df1f 100644 --- a/src/lib/eliom/eliom_shared.eliom +++ b/src/lib/eliom/eliom_shared.eliom @@ -51,7 +51,7 @@ module Value = struct sh_mark : 'a t Eliom_wrap.wrapper } - let internal_wrap {sh_client; _} = sh_client + let internal_wrap {sh_client} = sh_client let shared_value_mark () : 'a t Eliom_wrap.wrapper = Eliom_wrap.create_wrapper internal_wrap @@ -62,9 +62,9 @@ module Value = struct sh_mark = shared_value_mark () } - let client {sh_client; _} = sh_client + let client {sh_client} = sh_client - let local {sh_server; _} = sh_server + let local {sh_server} = sh_server end ] @@ -72,12 +72,8 @@ end [%%client module React = struct - [@@@ocaml.warning "-34"] - type step = React.step - [@@@ocaml.warning "+34"] - module S = struct include React.S @@ -165,7 +161,7 @@ module ReactiveData = struct let new_waiter = Lwt.wait () in waiter := new_waiter; let%lwt new_msg = map_msg_p_lwt f msg in - let%lwt _rr, rhandle = r_th in + let%lwt rr, rhandle = r_th in let%lwt () = fst waiter1 in (match new_msg with | ReactiveData.RList.Set s -> @@ -202,7 +198,7 @@ module ReactiveData = struct Lwt.return (ReactiveData.RList.create r) in let effectul_event = map_p_aux r_th f l in - let%lwt rr, _rhandle = r_th in + let%lwt rr, rhandle = r_th in (* We keep a reference to the effectul_event in the resulting reactive list in order that the effectul_event is garbage collected only if the resulting list is garbage @@ -276,26 +272,26 @@ module FakeReact = struct type 'a t = 'a * bool let create ?synced:(synced = false) x = ((x, synced), - fun ?step:_ _ -> + fun ?step _ -> failwith "Fact react values cannot be changed on server side") let value (x, _) = x let const ?synced:(synced = false) x = (x, synced) let synced (_, b) = b - let map ?eq:_ (f : 'a -> 'b) ((x, b) : 'a t) : 'b t = f x, b - let fmap ?eq:_ f i (s, b) = + let map ?eq (f : 'a -> 'b) ((x, b) : 'a t) : 'b t = f x, b + let fmap ?eq f i (s, b) = (match f s with Some v -> v | None -> i), b - let merge ?eq:_ f acc l = + let merge ?eq f acc l = let f (acc, acc_b) (x, b) = f acc x, acc_b && b in List.fold_left f (acc, true) l - let l2 ?eq:_ f (x1, b1) (x2, b2) = + let l2 ?eq f (x1, b1) (x2, b2) = f x1 x2, b1 && b2 - let l3 ?eq:_ f (x1, b1) (x2, b2) (x3, b3) = + let l3 ?eq f (x1, b1) (x2, b2) (x3, b3) = f x1 x2 x3, b1 && b2 && b3 - let l4 ?eq:_ f (x1, b1) (x2, b2) (x3, b3) (x4, b4) = + let l4 ?eq f (x1, b1) (x2, b2) (x3, b3) (x4, b4) = f x1 x2 x3 x4, b1 && b2 && b3 && b4 - let l5 ?eq:_ f (x1, b1) (x2, b2) (x3, b3) (x4, b4) (x5, b5) = + let l5 ?eq f (x1, b1) (x2, b2) (x3, b3) (x4, b4) (x5, b5) = f x1 x2 x3 x4 x5, b1 && b2 && b3 && b4 && b5 - let l6 ?eq:_ f (x1, b1) (x2, b2) (x3, b3) (x4, b4) (x5, b5) (x6, b6) = + let l6 ?eq f (x1, b1) (x2, b2) (x3, b3) (x4, b4) (x5, b5) (x6, b6) = f x1 x2 x3 x4 x5 x6, b1 && b2 && b3 && b4 && b5 && b6 end end @@ -322,9 +318,9 @@ module FakeReactiveData = struct let singleton_s s = [FakeReact.S.value s], FakeReact.S.synced s let value (l, _) = l let synced (_, b) = b - let signal ?eq:_ (l, synced) = fst (FakeReact.S.create ~synced l) + let signal ?eq (l, synced) = fst (FakeReact.S.create ~synced l) let map f (l, b) = List.map f l, b - let from_signal ?eq:_ s = FakeReact.S.(value s, synced s) + let from_signal ?eq s = FakeReact.S.(value s, synced s) end end ] @@ -589,7 +585,7 @@ module React = struct let merge_s ?eq (f : ('a -> 'b -> 'a Lwt.t) Value.t) (acc : 'a) (l : 'b t list) : 'a t Lwt.t = let%lwt server_result, synced = - let f (acc, _acc_b) v = + let f (acc, acc_b) v = let v = Value.local v and f = Value.local f in let%lwt acc = f acc (FakeReact.S.value v) in let acc_b = FakeReact.S.synced v in diff --git a/src/lib/eliom/eliom_shared_content.eliom b/src/lib/eliom/eliom_shared_content.eliom index aab10d9351..a1d53820c6 100644 --- a/src/lib/eliom/eliom_shared_content.eliom +++ b/src/lib/eliom/eliom_shared_content.eliom @@ -435,7 +435,7 @@ module Html = struct include Eliom_content_core.Html.Make(Xml)(Wrapped_functions)(Svg.R) - let pcdata x = txt x |> Unsafe.coerce_elt + let pcdata x = pcdata x |> Unsafe.coerce_elt end diff --git a/src/lib/server/common/dune b/src/lib/server/common/dune index ffc628d0c6..cdf5474dd4 100644 --- a/src/lib/server/common/dune +++ b/src/lib/server/common/dune @@ -2,6 +2,10 @@ (name internalserver) (wrapped false) (public_name eliom.server.common) - (libraries eliom.common js_of_ocaml ocsigenserver ocsigenserver.ext react) + (libraries + eliom.common + js_of_ocaml + ocsigenserver.ext + react) (preprocess (pps js_of_ocaml-ppx_deriving_json lwt_ppx))) diff --git a/src/lib/server/common/eliom_common.ml b/src/lib/server/common/eliom_common.ml index 692c860f68..d60e4e708f 100644 --- a/src/lib/server/common/eliom_common.ml +++ b/src/lib/server/common/eliom_common.ml @@ -523,7 +523,7 @@ let make_full_state_name2 site_dir_string) let make_full_state_name ~sp ~secure ~(scope:[< user_scope ]) = - make_full_state_name2 sp.sp_sitedata.site_dir_string secure ~scope + make_full_state_name2 sp.sp_sitedata.site_dir_string secure scope let get_cookie_info sp = function | `Session -> sp.sp_cookie_info @@ -794,7 +794,7 @@ let empty_tables max forsession = then let dlist = Ocsigen_cache.Dlist.create max in Ocsigen_cache.Dlist.set_finaliser_before (dlist_finaliser t2) dlist; - fun ?sp:_ v -> add_dlist_ dlist v + fun ?sp v -> add_dlist_ dlist v else fun ?sp v -> let ip, max, sitedata = @@ -846,7 +846,7 @@ sessionkind|S?|sitedirstring|"ref" ou "comet" ou ""|hiername *) let full_state_name_of_cookie_name cookie_level cookiename = - let _pref, cookiename = Ocsigen_lib.String.sep '|' cookiename in + let pref, cookiename = Ocsigen_lib.String.sep '|' cookiename in let secure, cookiename = Ocsigen_lib.String.sep '|' cookiename in let sitedirstring, cookiename = Ocsigen_lib.String.sep '|' cookiename in let hier1, hiername = Ocsigen_lib.String.sep '|' cookiename in @@ -887,8 +887,6 @@ let eliom_params_after_action = Polytables.make_key () (* After an action, we get tab_cookies info from rc: *) let tab_cookie_action_info_key = Polytables.make_key () -[@@@ocaml.warning "-39-32"] - type cpi = client_process_info = { cpi_ssl : bool; cpi_hostname : string; @@ -896,8 +894,6 @@ type cpi = client_process_info = { cpi_original_full_path : string list; } [@@deriving json] -[@@@ocaml.warning "+39+32"] - let get_session_info req previous_extension_err = let req_whole = req and ri = req.Ocsigen_extensions.request_info @@ -1363,19 +1359,19 @@ module To_and_of_shared = struct let wrapper : wrapper = Obj.magic @@ Eliom_wrap.create_wrapper @@ function - | {client = Some tao; _} -> + | {client = Some tao} -> tao - | {client = None; _} -> + | {client = None} -> failwith "Cannot wrap user type parameter.\n\ Use the ?client_to_and_of parameter of Eliom_parameter.user_type\n\ or (Eliom_parameter.all_suffix_user)" - let to_string {server = {to_string; _}; _} = to_string + let to_string {server = {to_string}} = to_string - let of_string {server = {of_string; _}; _} = of_string + let of_string {server = {of_string}} = of_string - let to_and_of {server; _} = server + let to_and_of {server} = server let create ?client_to_and_of server = { server ; diff --git a/src/lib/server/dune b/src/lib/server/dune index 701101851c..0156828043 100644 --- a/src/lib/server/dune +++ b/src/lib/server/dune @@ -5,17 +5,7 @@ (libraries eliom.common eliom.server.common - ipaddr - lwt - lwt_log - lwt_log.core - lwt_react - netstring-pcre - ocsigenserver - ocsigenserver.cookies - ocsigenserver.ext - react - tyxml) + lwt_react) (preprocess (pps lwt_ppx diff --git a/src/lib/server/eliom_bus.ml b/src/lib/server/eliom_bus.ml index 71b2d6a61f..eadff36b7f 100644 --- a/src/lib/server/eliom_bus.ml +++ b/src/lib/server/eliom_bus.ml @@ -56,7 +56,7 @@ let internal_wrap (bus: ('a, 'b) t) match Eliom_state.get_volatile_data ~table () with | Eliom_state.Data true -> () | _ -> - let {service = Ecb.Bus_send_service srv; _} = bus in + let {service = Ecb.Bus_send_service srv} = bus in register_sender bus.scope (srv :> (_, _ list, _, _, _, Eliom_service.non_ext, _, _, _, _, _) diff --git a/src/lib/server/eliom_comet.ml b/src/lib/server/eliom_comet.ml index c05d323533..f184c95493 100644 --- a/src/lib/server/eliom_comet.ml +++ b/src/lib/server/eliom_comet.ml @@ -150,7 +150,6 @@ struct match Weak.get channel 0 with | None -> [%lwt raise ( Not_found)] - [@warning "-22"] (* terminates the loop: remove reference on the stream, etc ... *) | Some channel -> channel.ch_index <- succ channel.ch_index; @@ -232,17 +231,17 @@ struct | Eliom_lib.Left (channel, position) -> match position with | Eliom_comet_base.Newest i when i > channel.ch_index -> false - | Eliom_comet_base.Newest _i -> true + | Eliom_comet_base.Newest i -> true | Eliom_comet_base.After i when i > channel.ch_index -> false - | Eliom_comet_base.After _i -> true - | Eliom_comet_base.Last _n when (Dlist.size channel.ch_content) > 0 -> true - | Eliom_comet_base.Last _n -> false + | Eliom_comet_base.After i -> true + | Eliom_comet_base.Last n when (Dlist.size channel.ch_content) > 0 -> true + | Eliom_comet_base.Last n -> false let really_wait_data requests = let rec make_list = function | [] -> [] | (Eliom_lib.Left (channel,_))::q -> (Lwt_condition.wait channel.ch_wakeup)::(make_list q) - | Eliom_lib.Right _ :: _q -> + | Eliom_lib.Right _ :: q -> assert false (* closed channels are considered to have data *) in Lwt.pick (make_list requests) @@ -284,9 +283,9 @@ struct Eliom_comet_base.Comet_service (Eliom_common.force_lazy_site_value global_service) - let get_id {ch_id;_} = ch_id + let get_id {ch_id} = ch_id - let get_kind ~newest {ch_index;_} = + let get_kind ~newest {ch_index} = if newest then Eliom_comet_base.Newest_kind (ch_index + 1) else Eliom_comet_base.After_kind (ch_index + 1) @@ -494,7 +493,6 @@ end = struct let ri = Eliom_request_info.get_ri () in let%lwt () = Ocsigen_extensions.Ocsigen_request_info.connection_closed ri in [%lwt raise ( Connection_closed)] - [@ocaml.warning "-22"] (* register the service handler.hd_service *) let run_handler handler = @@ -550,7 +548,7 @@ end = struct Lwt.return (encode_downgoing []) in let - {hd_service = Eliom_comet_base.Internal_comet_service service; _} = + {hd_service = Eliom_comet_base.Internal_comet_service service} = handler in Comet.register ~scope:handler.hd_scope ~service f @@ -669,11 +667,11 @@ end = struct ch_stream = stream; ch_id = name; } - let get_id {ch_id;_} = + let get_id {ch_id} = ch_id - let get_service {ch_handler;_} = - let {hd_service = Ecb.Internal_comet_service srv; _} = ch_handler in + let get_service {ch_handler} = + let {hd_service = Ecb.Internal_comet_service srv} = ch_handler in Ecb.Comet_service srv end @@ -820,7 +818,7 @@ end = struct let create ?scope ?name ?(size=1000) stream = match scope with | None -> create_stateful ?name ~size stream - | Some ((`Client_process _n) as scope) -> create_stateful ~scope ?name ~size stream + | Some ((`Client_process n) as scope) -> create_stateful ~scope ?name ~size stream | Some `Site -> create_stateless ?name ~size stream let external_channel ?(history=1) ?(newest=false) ~prefix ~name () = diff --git a/src/lib/server/eliom_config.ml b/src/lib/server/eliom_config.ml index 2c65c845b5..8d8e31d019 100644 --- a/src/lib/server/eliom_config.ml +++ b/src/lib/server/eliom_config.ml @@ -38,7 +38,7 @@ let get_default_links_xhr () = let sitedata = Eliom_request_info.find_sitedata "get_default_links_xhr" in sitedata.Eliom_common.default_links_xhr#get -let set_default_links_xhr ?override_configfile:_ v = +let set_default_links_xhr ?override_configfile v = let sitedata = Eliom_request_info.find_sitedata "set_default_links_xhr" in sitedata.Eliom_common.default_links_xhr#set v diff --git a/src/lib/server/eliom_content_core.ml b/src/lib/server/eliom_content_core.ml index a1751e6873..e48250eca1 100644 --- a/src/lib/server/eliom_content_core.ml +++ b/src/lib/server/eliom_content_core.ml @@ -56,7 +56,7 @@ module Xml = struct wrapper_mark : elt Eliom_wrap.wrapper } - let content { elt; _ } = match elt.recontent with + let content { elt } = match elt.recontent with | RE e -> e | RELazy e -> Eliom_lazy.force e @@ -64,14 +64,14 @@ module Xml = struct let node_ids_in_content = ref Node_id_set.empty let wrapper_mark = Eliom_wrap.create_wrapper - (fun { elt; _ } -> + (fun { elt } -> if Node_id_set.mem elt.node_id !node_ids_in_content then { elt with recontent = RE Empty } else elt) let wrap page value = let node_ids = ref [] in - let rec collect_node_ids ({elt; _} as elt') = - let {node_id; _} = elt in + let rec collect_node_ids ({elt} as elt') = + let {node_id} = elt in if node_id <> NoId then node_ids := node_id :: !node_ids; match content elt' with @@ -85,7 +85,7 @@ module Xml = struct node_ids_in_content := Node_id_set.empty; res - let get_node_id { elt; _ } = elt.node_id + let get_node_id { elt } = elt.node_id let tyxml_unwrap_id = Eliom_wrap.id_of_int Eliom_runtime.tyxml_unwrap_id_int @@ -242,7 +242,7 @@ module Xml = struct | Node (ename, attribs, sons) -> Node (ename, filter_class_attribs node_id attribs, sons) - let content { elt; _ } = + let content { elt } = let c = match elt.recontent with | RE e -> e | RELazy e -> Eliom_lazy.force e diff --git a/src/lib/server/eliom_error_pages.ml b/src/lib/server/eliom_error_pages.ml index 1380319eaa..31c1f677d1 100644 --- a/src/lib/server/eliom_error_pages.ml +++ b/src/lib/server/eliom_error_pages.ml @@ -22,15 +22,15 @@ open Html.F let page_error_param_type l = let s = match l with - [] -> [txt "Wrong type for parameter"] - | [(n,_)] -> [txt "Wrong type for parameter ";em [txt n];txt "."] + [] -> [pcdata "Wrong type for parameter"] + | [(n,_)] -> [pcdata "Wrong type for parameter ";em [pcdata n];pcdata "."] | (n,_)::ll -> - (txt "Wrong type for parameters "):: - (List.fold_left (fun deb (n,_) -> (em [txt n])::(txt ", ")::deb) - [em [txt n];txt "."] ll) + (pcdata "Wrong type for parameters "):: + (List.fold_left (fun deb (n,_) -> (em [pcdata n])::(pcdata ", ")::deb) + [em [pcdata n];pcdata "."] ll) in html - (head (title (txt "")) []) + (head (title (pcdata "")) []) (body [h1 s] ) @@ -38,36 +38,36 @@ let page_error_param_type l = let page_bad_param after_action gl pl = let s = "Wrong parameters" in html - (head (title (txt s)) []) + (head (title (pcdata s)) []) (body - ((h1 [txt s]):: + ((h1 [pcdata s]):: (if Ocsigen_config.get_debugmode () then - [h2 [txt "Debugging information:"]; + [h2 [pcdata "Debugging information:"]; (if after_action then - (p [txt "An action occurred successfully. But Eliom was unable to find the service for displaying the page."]) + (p [pcdata "An action occurred successfully. But Eliom was unable to find the service for displaying the page."]) else - (p [txt "Eliom was unable to find a service matching these parameters."])); + (p [pcdata "Eliom was unable to find a service matching these parameters."])); (match gl with - | [] -> p [txt "No GET parameters have been given to services."] + | [] -> p [pcdata "No GET parameters have been given to services."] | (n, a)::l -> - p ((txt "GET parameters given to services: "):: + p ((pcdata "GET parameters given to services: "):: [em - ((txt n)::(txt "=")::(txt a):: + ((pcdata n)::(pcdata "=")::(pcdata a):: (List.fold_right (fun (n, a) b -> - (txt "&"):: - (txt n)::(txt "=")::(txt a)::b) - l [txt "."]))])); + (pcdata "&"):: + (pcdata n)::(pcdata "=")::(pcdata a)::b) + l [pcdata "."]))])); (match pl with - | [] -> p [txt "No POST parameters have been given to services."] + | [] -> p [pcdata "No POST parameters have been given to services."] | a::l -> - p ((txt "Names of POST parameters given to services: "):: - (em [txt a]):: + p ((pcdata "Names of POST parameters given to services: "):: + (em [pcdata a]):: (List.fold_right - (fun n b -> (txt ", ")::(em [txt n])::b) - l [txt "."])))] + (fun n b -> (pcdata ", ")::(em [pcdata n])::b) + l [pcdata "."])))] else []) ) ) @@ -75,7 +75,7 @@ let page_bad_param after_action gl pl = let page_session_expired = let s = "Session expired" in html - (head (title (txt s)) []) + (head (title (pcdata s)) []) (body - [h1 [txt s]] + [h1 [pcdata s]] ) diff --git a/src/lib/server/eliom_extension.ml b/src/lib/server/eliom_extension.ml index 31cedadde6..e885c6ab5f 100644 --- a/src/lib/server/eliom_extension.ml +++ b/src/lib/server/eliom_extension.ml @@ -35,6 +35,6 @@ let register_eliom_extension f = let get_eliom_extension () = !module_action -let run_eliom_extension (fext : eliom_extension_sig) _now info sitedata = +let run_eliom_extension (fext : eliom_extension_sig) now info sitedata = let sp = Eliom_common.make_server_params sitedata info None None in Lwt.with_value Eliom_common.sp_key (Some sp) fext diff --git a/src/lib/server/eliom_extension_template.ml b/src/lib/server/eliom_extension_template.ml index 2c9c3870bb..ca4991dafc 100644 --- a/src/lib/server/eliom_extension_template.ml +++ b/src/lib/server/eliom_extension_template.ml @@ -27,7 +27,7 @@ let _ = Eliom_extension.register_eliom_extension - (fun _sp -> + (fun sp -> Lwt.return (Ocsigen_extensions.Ext_found (fun () -> diff --git a/src/lib/server/eliom_mkreg.ml b/src/lib/server/eliom_mkreg.ml index 40ee4838a3..499a8381c9 100644 --- a/src/lib/server/eliom_mkreg.ml +++ b/src/lib/server/eliom_mkreg.ml @@ -120,7 +120,6 @@ let check_process_redir sp f param = (Lazy.force (Ocsigen_extensions.Ocsigen_request_info.get_params ri)) ))))] - [@ocaml.warning "-22"] (* We do not put hostname and port. It is ok with half or full xhr redirections. *) (* If an action occured before, @@ -206,7 +205,7 @@ let register_aux pages | None -> None | Some t -> Some (t, ref (t +. Unix.time ())) in - let f table attsernames = + let f table ((attserget, attserpost) as attsernames) = Eliom_route.add_service priority table @@ -519,7 +518,7 @@ let send pages Lwt.return (pages.result_of_http_result result) let register pages - ?app:_ + ?app ?scope ?options ?charset @@ -557,8 +556,8 @@ let register pages | _ -> raise (Eliom_common.Eliom_site_information_not_available "register")) - | None, Some _sp - | Some `Site, Some _sp -> + | None, Some sp + | Some `Site, Some sp -> register_aux pages ?options ?charset diff --git a/src/lib/server/eliom_notif.ml b/src/lib/server/eliom_notif.ml index 2a9263c88b..978615a815 100644 --- a/src/lib/server/eliom_notif.ml +++ b/src/lib/server/eliom_notif.ml @@ -174,7 +174,7 @@ module Make (A : ARG) : S I.remove identity id module Ext = struct - let unlisten ?sitedata:_ state (key : A.key) = + let unlisten ?sitedata state (key : A.key) = let uc = Eliom_reference.Volatile.Ext.get state identity_r in I.remove uc key end diff --git a/src/lib/server/eliom_parameter.ml b/src/lib/server/eliom_parameter.ml index f172d66ca8..315b6497fc 100644 --- a/src/lib/server/eliom_parameter.ml +++ b/src/lib/server/eliom_parameter.ml @@ -57,7 +57,7 @@ let all_suffix_user let regexp reg dest ~to_string n = user_type - ~of_string:(fun s -> + (fun s -> match Netstring_pcre.string_match reg s 0 with | Some _ -> begin @@ -68,13 +68,13 @@ let regexp reg dest ~to_string n = raise (Failure "User does not exist") end | _ -> raise (Failure "Regexp not matching")) - ~to_string + to_string n let all_suffix_regexp reg dest ~(to_string : 'a -> string) (n : string) : (string, [`Endsuffix], [ `One of string ] param_name) params_type = all_suffix_user - ~of_string:(fun s -> + (fun s -> match Netstring_pcre.string_match reg s 0 with | Some _ -> begin @@ -85,7 +85,7 @@ let all_suffix_regexp reg dest ~(to_string : 'a -> string) (n : string) : raise (Failure "User does not exist") end | _ -> raise (Failure "Regexp not matching")) - ~to_string + to_string n (* Non localized parameters *) @@ -94,8 +94,7 @@ let get_non_localized_parameters params files ~getorpost ~sp {name; get; post; - param = paramtype; - _} = + param = paramtype} = (* non localized parameters are parsed only once, and cached in request_cache *) let key = match getorpost with `Get -> get | `Post -> post in diff --git a/src/lib/server/eliom_react.ml b/src/lib/server/eliom_react.ml index b4587d46ff..cf41ea1461 100644 --- a/src/lib/server/eliom_react.ml +++ b/src/lib/server/eliom_react.ml @@ -59,8 +59,8 @@ struct (channel,Eliom_common.make_unwrapper Eliom_common.react_down_unwrap_id) let internal_wrap = function - | { t = Stateful v ; _} -> wrap_stateful v - | { t = Stateless v ; _} -> wrap_stateless v + | { t = Stateful v } -> wrap_stateful v + | { t = Stateless v } -> wrap_stateless v let react_down_mark () = Eliom_common.make_wrapper internal_wrap @@ -87,7 +87,7 @@ struct match scope with | Some `Site -> stateless ?throttling ?name ?size e | None -> stateful ?throttling ?name ?size e - | Some ((`Client_process _n) as scope) -> + | Some ((`Client_process n) as scope) -> stateful ~scope ?throttling ?name ?size e in { t; react_down_mark=react_down_mark () } @@ -212,8 +212,7 @@ struct let wrap_stateful {throttling=t; signal=s; - name=name; - _} = + name=name} = let s : 'a S.t = (match t with | None -> s @@ -227,14 +226,13 @@ struct let wrap_stateless {sl_signal=s; - channel; - _} = + channel} = let value : 'a = S.value s in (channel,value,Eliom_common.make_unwrapper Eliom_common.signal_down_unwrap_id) let internal_wrap = function - | { t = Stateful v; _ } -> wrap_stateful v - | { t = Stateless v; _ } -> wrap_stateless v + | { t = Stateful v } -> wrap_stateful v + | { t = Stateless v } -> wrap_stateless v let signal_down_mark () = Eliom_common.make_wrapper internal_wrap @@ -266,7 +264,7 @@ struct match scope with | Some `Site -> stateless ?throttling ?name s | None -> stateful ?throttling ?name s - | Some ((`Client_process _n) as scope) -> + | Some ((`Client_process n) as scope) -> stateful ~scope ?throttling ?name s in { t; signal_down_mark=signal_down_mark () } diff --git a/src/lib/server/eliom_reference.ml b/src/lib/server/eliom_reference.ml index 815c81ade1..88f1add3ad 100644 --- a/src/lib/server/eliom_reference.ml +++ b/src/lib/server/eliom_reference.ml @@ -154,7 +154,7 @@ module Volatile = struct let modify state eref f = set state eref (f (get state eref)) - let unset state (_f, _, table : _ eref) = + let unset state (f, _, table : _ eref) = match table with | Vol t -> Eliom_state.Ext.Low_level.remove_volatile_data ~state ~table:(Lazy.force t); @@ -245,7 +245,7 @@ let set (_, _, table as eref) value = let modify eref f = get eref >>= fun x -> set eref (f x) -let unset (_f, _, table as eref) = +let unset (f, _, table as eref) = match table with | Per t -> t >>= fun t -> diff --git a/src/lib/server/eliom_registration.ml b/src/lib/server/eliom_registration.ml index 6fb7e12a1c..e80dcfb76c 100644 --- a/src/lib/server/eliom_registration.ml +++ b/src/lib/server/eliom_registration.ml @@ -94,7 +94,6 @@ module Html_make_reg_base | Some headers -> Http_headers.with_defaults headers (Ocsigen_http_frame.Result.headers r)) ()) - [@@ocaml.warning "-27"] end @@ -159,7 +158,6 @@ module Make_typed_xml_registration Http_headers.with_defaults headers (Ocsigen_http_frame.Result.headers r)) ()) - [@@ocaml.warning "-27"] end @@ -283,7 +281,6 @@ module HtmlText_reg_base = struct | Some headers -> Http_headers.with_defaults headers (Ocsigen_http_frame.Result.headers r)) ()) - [@@ocaml.warning "-27"] end @@ -312,13 +309,11 @@ module Action_reg_base = struct in the configuration file (they have already been taken into account) *) fun ri res -> Polytables.set - ~table:(Ocsigen_extensions.Ocsigen_request_info.request_cache ri) - ~key:Eliom_common.found_stop_key - ~value:(); + (Ocsigen_extensions.Ocsigen_request_info.request_cache ri) Eliom_common.found_stop_key (); res let send - ?(options = `Reload) ?charset:_ ?(code = 204) + ?(options = `Reload) ?charset ?(code = 204) ?content_type ?headers () = let user_cookies = Eliom_request_info.get_user_cookies () in if options = `NoReload @@ -359,7 +354,7 @@ module Action_reg_base = struct *) (* be very careful while re-reading this *) let sp = Eliom_common.get_sp () in - let sitedata = Eliom_request_info.get_sitedata_sp ~sp in + let sitedata = Eliom_request_info.get_sitedata_sp sp in let si = Eliom_request_info.get_si sp in let ri = Eliom_request_info.get_request_sp sp in let open Ocsigen_extensions in @@ -418,9 +413,9 @@ module Action_reg_base = struct (* no post params, GET attached coservice *) -> Polytables.set - ~table:(Ocsigen_extensions.Ocsigen_request_info.request_cache ri.Ocsigen_extensions.request_info) - ~key:Eliom_common.eliom_params_after_action - ~value:(si.Eliom_common.si_all_get_params, + (Ocsigen_extensions.Ocsigen_request_info.request_cache ri.Ocsigen_extensions.request_info) + Eliom_common.eliom_params_after_action + (si.Eliom_common.si_all_get_params, si.Eliom_common.si_all_post_params, (* is Some [] *) si.Eliom_common.si_all_file_params, (* is Some [] *) si.Eliom_common.si_nl_get_params, @@ -448,9 +443,9 @@ module Action_reg_base = struct (* retry without POST params *) Polytables.set - ~table:(Ocsigen_extensions.Ocsigen_request_info.request_cache ri.Ocsigen_extensions.request_info) - ~key:Eliom_common.eliom_params_after_action - ~value:(si.Eliom_common.si_all_get_params, + (Ocsigen_extensions.Ocsigen_request_info.request_cache ri.Ocsigen_extensions.request_info) + Eliom_common.eliom_params_after_action + (si.Eliom_common.si_all_get_params, si.Eliom_common.si_all_post_params, si.Eliom_common.si_all_file_params, si.Eliom_common.si_nl_get_params, @@ -480,9 +475,9 @@ module Action_reg_base = struct (we impose GET to prevent that) *) Polytables.set - ~table:(Ocsigen_extensions.Ocsigen_request_info.request_cache ri.Ocsigen_extensions.request_info) - ~key:Eliom_common.eliom_params_after_action - ~value:(si.Eliom_common.si_all_get_params, + (Ocsigen_extensions.Ocsigen_request_info.request_cache ri.Ocsigen_extensions.request_info) + Eliom_common.eliom_params_after_action + (si.Eliom_common.si_all_get_params, si.Eliom_common.si_all_post_params, si.Eliom_common.si_all_file_params, si.Eliom_common.si_nl_get_params, @@ -523,8 +518,8 @@ module Unit_reg_base = struct let send_appl_content = Eliom_service.XAlways - let send ?options:_ ?charset:_ ?(code = 204) - ?content_type ?headers _content = + let send ?options ?charset ?(code = 204) + ?content_type ?headers content = let empty_result = Ocsigen_http_frame.Result.empty () in Lwt.return (Ocsigen_http_frame.Result.update empty_result @@ -556,7 +551,7 @@ module Any_reg_base = struct (* let send_appl_content = Eliom_service.XNever *) let send_appl_content = Eliom_service.XAlways - let send ?options:_ ?charset ?code:_ + let send ?options ?charset ?code ?content_type ?headers (res:'a kind) = let res = Result_types.cast_kind res in Lwt.return @@ -624,7 +619,7 @@ module File_reg_base = struct let sp = Eliom_common.get_sp () in let request = Eliom_request_info.get_request_sp sp in let file = - try Ocsigen_local_files.resolve ~request ~filename () + try Ocsigen_local_files.resolve request filename () with | Ocsigen_local_files.Failed_403 (* XXXBY : maybe we should signal a true 403? *) | Ocsigen_local_files.Failed_404 @@ -662,7 +657,7 @@ struct let sp = Eliom_common.get_sp () in let request = Eliom_request_info.get_request_sp sp in try - ignore (Ocsigen_local_files.resolve ~request ~filename () + ignore (Ocsigen_local_files.resolve request filename () : Ocsigen_local_files.resolved); true with @@ -687,7 +682,7 @@ module File_ct_reg_base = struct let sp = Eliom_common.get_sp () in let request = Eliom_request_info.get_request_sp sp in let file = - try Ocsigen_local_files.resolve ~request ~filename () + try Ocsigen_local_files.resolve request filename () with | Ocsigen_local_files.Failed_403 (* XXXBY : maybe we should signal a true 403? *) | Ocsigen_local_files.Failed_404 @@ -725,7 +720,7 @@ struct let sp = Eliom_common.get_sp () in let request = Eliom_request_info.get_request_sp sp in try - ignore (Ocsigen_local_files.resolve ~request ~filename () + ignore (Ocsigen_local_files.resolve request filename () : Ocsigen_local_files.resolved); true with @@ -745,7 +740,7 @@ module Streamlist_reg_base = struct let send_appl_content = Eliom_service.XNever - let send ?options:_ ?charset ?code + let send ?options ?charset ?code ?content_type ?headers content = Ocsigen_senders.Streamlist_content.result_of_content content >>= fun r -> Lwt.return @@ -949,7 +944,7 @@ module Ocaml_reg_base = struct let send_appl_content = Eliom_service.XNever - let send ?options:_ ?charset ?code + let send ?options ?charset ?code ?content_type ?headers content = Result_types.cast_kind_lwt (Text.send ?charset ?code @@ -1353,7 +1348,7 @@ module Eliom_appl_reg_make_param @ [Eliom_content.Html.F.a_src uri] in - Eliom_content.Html.F.script ~a (Eliom_content.Html.F.txt "") :: rem + Eliom_content.Html.F.script ~a (Eliom_content.Html.F.pcdata "") :: rem end else rem @@ -1655,7 +1650,7 @@ module String_redir_reg_base = struct let send_appl_content = Eliom_service.XAlways (* actually, the service will decide itself *) - let send ?(options = `Found) ?charset:_ ?code + let send ?(options = `Found) ?charset ?code ?content_type ?headers content = let uri = content in let empty_result = Ocsigen_http_frame.Result.empty () in @@ -1734,7 +1729,7 @@ module Redir_reg_base = struct let send_appl_content = Eliom_service.XAlways (* actually, the service will decide itself *) - let send ?(options = `Found) ?charset:_ ?code + let send ?(options = `Found) ?charset ?code ?content_type ?headers (Redirection service) = let uri = Eliom_uri.make_string_uri ~service () in let empty_result = Ocsigen_http_frame.Result.empty () in diff --git a/src/lib/server/eliom_route.ml b/src/lib/server/eliom_route.ml index 5873f240f5..fb90ea9665 100644 --- a/src/lib/server/eliom_route.ml +++ b/src/lib/server/eliom_route.ml @@ -12,7 +12,7 @@ include Eliom_route_base.Make (struct let sess_info_of_info (_, i, _, _, _) = i - let meth_of_info ({request_info; _}, _, _, _, _) = + let meth_of_info ({request_info}, _, _, _, _) = match Ocsigen_request_info.meth request_info with | Ocsigen_http_frame.Http_header.GET -> `Get @@ -25,7 +25,7 @@ include Eliom_route_base.Make (struct | _ -> `Other - let subpath_of_info ({request_info; _}, _, _, _, _) = + let subpath_of_info ({request_info}, _, _, _, _) = Ocsigen_request_info.sub_path request_info module Container = struct @@ -34,7 +34,7 @@ include Eliom_route_base.Make (struct let set t v = t.Eliom_common.table_services <- v - let get {Eliom_common.table_services; _} = table_services + let get {Eliom_common.table_services} = table_services let dlist_add ?sp tables lr = tables.Eliom_common.service_dlist_add ?sp lr @@ -87,7 +87,7 @@ include Eliom_route_base.Make (struct end) -let find_aux now sitedata info _e sci : Ocsigen_http_frame.Result.result Lwt.t = +let find_aux now sitedata info e sci : Ocsigen_http_frame.Result.result Lwt.t = Eliom_common.Full_state_name_table.fold (fun fullsessname (_, r) beg -> try%lwt @@ -174,9 +174,9 @@ let get_page *) Lwt_log.ign_info ~section "Link too old. Try without POST parameters:"; Polytables.set - ~table:(Ocsigen_request_info.request_cache ri.request_info) - ~key:Eliom_common.eliom_link_too_old - ~value:true; + (Ocsigen_request_info.request_cache ri.request_info) + Eliom_common.eliom_link_too_old + true; fail (Eliom_common.Eliom_retry_with ({ri with request_info = Ocsigen_request_info.update ri.request_info @@ -208,9 +208,9 @@ let get_page *) Lwt_log.ign_info ~section "Link to old. Trying without GET state parameters and POST parameters:"; Polytables.set - ~table:(Ocsigen_request_info.request_cache ri.request_info) - ~key:Eliom_common.eliom_link_too_old - ~value:true; + (Ocsigen_request_info.request_cache ri.request_info) + Eliom_common.eliom_link_too_old + true; fail (Eliom_common.Eliom_retry_with ({ri with request_info = Ocsigen_request_info.update ri.request_info @@ -401,9 +401,9 @@ let make_naservice (*VVV (Some, Some) or (_, Some)? *) Lwt_log.ign_info ~section "Link too old to a non-attached POST coservice. Try without POST parameters:"; Polytables.set - ~table:(Ocsigen_request_info.request_cache ri.request_info) - ~key:Eliom_common.eliom_link_too_old - ~value:true; + (Ocsigen_request_info.request_cache ri.request_info) + Eliom_common.eliom_link_too_old + true; Eliom_common.get_session_info {ri with Ocsigen_extensions.request_info = Ocsigen_request_info.update ri.request_info @@ -418,7 +418,7 @@ let make_naservice () } si.Eliom_common.si_previous_extension_error - >>= fun (ri', si', _previous_tab_cookies_info) -> + >>= fun (ri', si', previous_tab_cookies_info) -> Lwt.fail (Eliom_common.Eliom_retry_with (ri', si', all_cookie_info, @@ -429,9 +429,9 @@ let make_naservice | Eliom_common.RNa_get' _ -> Lwt_log.ign_info ~section "Link too old. Try without non-attached parameters:"; Polytables.set - ~table:(Ocsigen_request_info.request_cache ri.request_info) - ~key:Eliom_common.eliom_link_too_old - ~value:true; + (Ocsigen_request_info.request_cache ri.request_info) + Eliom_common.eliom_link_too_old + true; Eliom_common.get_session_info {ri with request_info = Ocsigen_request_info.update ri.request_info @@ -446,7 +446,7 @@ let make_naservice () } si.Eliom_common.si_previous_extension_error - >>= fun (ri', si', _previous_tab_cookies_info) -> + >>= fun (ri', si', previous_tab_cookies_info) -> Lwt.fail (Eliom_common.Eliom_retry_with (ri', si', all_cookie_info, all_tab_cookie_info, diff --git a/src/lib/server/eliom_service.ml b/src/lib/server/eliom_service.ml index 4a0321fc87..94f0450b13 100644 --- a/src/lib/server/eliom_service.ml +++ b/src/lib/server/eliom_service.ml @@ -242,7 +242,7 @@ let attach : ('get, 'post, 'gp, att, co, non_ext, non_reg, 'sf, 'gn, 'pn, 'return) t = fun ~fallback ~service () -> - let {na_name; _} = non_attached_info service in + let {na_name} = non_attached_info service in let fallbackkind = attached_info fallback in let open Eliom_common in let error_msg = @@ -253,16 +253,16 @@ let attach : | SNa_get_ s -> SAtt_na_named s | SNa_get' s -> SAtt_na_anon s | SNa_get_csrf_safe a -> SAtt_na_csrf_safe a - | SNa_post_ _s -> fallbackkind.get_name (*VVV check *) - | SNa_post' _s -> fallbackkind.get_name (*VVV check *) - | SNa_post_csrf_safe _a -> fallbackkind.get_name (*VVV check *) + | SNa_post_ s -> fallbackkind.get_name (*VVV check *) + | SNa_post' s -> fallbackkind.get_name (*VVV check *) + | SNa_post_csrf_safe a -> fallbackkind.get_name (*VVV check *) | _ -> failwith error_msg (*VVV Do we want to make possible to attach POST na coservices on GET attached coservices? *) and post_name = match na_name with - | SNa_get_ _s -> SAtt_no - | SNa_get' _s -> SAtt_no - | SNa_get_csrf_safe _a -> SAtt_no + | SNa_get_ s -> SAtt_no + | SNa_get' s -> SAtt_no + | SNa_get_csrf_safe a -> SAtt_no | SNa_post_ s -> SAtt_na_named s | SNa_post' s -> SAtt_na_anon s | SNa_post_csrf_safe a -> SAtt_na_csrf_safe a @@ -393,7 +393,7 @@ let unregister ?scope ?secure raise (Eliom_common.Eliom_site_information_not_available "unregister")) - | Some _sp -> + | Some sp -> Eliom_state.get_global_table () in remove_service table service diff --git a/src/lib/server/eliom_state.ml b/src/lib/server/eliom_state.ml index e1c4d8ace5..7a773abac6 100644 --- a/src/lib/server/eliom_state.ml +++ b/src/lib/server/eliom_state.ml @@ -161,7 +161,7 @@ let set_global_persistent_data_state_timeout let get_global_service_state_timeout ?secure ~cookie_scope () = let sitedata = Eliom_request_info.find_sitedata "get_global_timeout" in - let secure = Eliom_common.get_secure ~secure_o:secure ~sitedata () in + let secure = Eliom_common.get_secure secure sitedata () in Eliommod_timeouts.get_global ~kind:`Service ~cookie_scope ~secure sitedata @@ -394,7 +394,7 @@ let rec close_volatile_state_if_empty ~scope ?secure () = -let close_persistent_state_if_empty ~scope:_ ?secure:_ () = +let close_persistent_state_if_empty ~scope ?secure () = Lwt.return_unit (*VVV Can we implement this function? *) @@ -481,7 +481,7 @@ let get_service_session_group_size in match !(c.Eliom_common.sc_session_group) with | _, _, Right _ -> None - | _, _, Left _v -> + | _, _, Left v -> Some (Eliommod_sessiongroups.Serv.group_size !(c.Eliom_common.sc_session_group)) with | Not_found @@ -564,7 +564,7 @@ let get_volatile_data_session_group_size in match !(c.Eliom_common.dc_session_group) with | _, _, Right _ -> None - | _, _, Left _v -> + | _, _, Left v -> Some (Eliommod_sessiongroups.Data.group_size !(c.Eliom_common.dc_session_group)) with | Not_found @@ -971,7 +971,7 @@ let create_volatile_table ~scope ?secure () = | None -> raise (Eliom_common.Eliom_site_information_not_available "create_volatile_table")) - | Some _sp -> + | Some sp -> let sp = Eliom_common.get_sp () in let sitedata = Eliom_request_info.get_sitedata_sp ~sp in let secure = Eliom_common.get_secure ~secure_o:secure ~sitedata () in @@ -1276,16 +1276,16 @@ module Ext = struct in Eliommod_sessiongroups.Pers.remove_group ~cookie_level:`Session sitedata sgr_o - | (_, `Service, (_cookie : string)) -> + | (_, `Service, (cookie : string)) -> let (_, (_, _, _, _, _sgr, sgrnode)) = get_service_cookie_info state in Eliommod_sessiongroups.Serv.remove sgrnode; Lwt.return_unit - | (_, `Data, _cookie) -> + | (_, `Data, cookie) -> let (_, (_, _, _, _sgr, sgrnode)) = get_volatile_data_cookie_info state in Eliommod_sessiongroups.Data.remove sgrnode; Lwt.return_unit - | (_, `Pers, _cookie) -> + | (_, `Pers, cookie) -> get_persistent_cookie_info state >>= fun (cookie, ((scope, _, _), _, _, sgr_o)) -> let sitedata = get_sitedata () in @@ -1307,8 +1307,8 @@ module Ext = struct | `Client_process _ -> failwith "fold_sub_states" in let reduce_level = function - | `Session_group _n -> `Session - | `Session _n -> `Client_process + | `Session_group n -> `Session + | `Session n -> `Client_process | `Client_process _ -> failwith "fold_sub_states" in let sub_states_level = reduce_level s in @@ -1338,7 +1338,7 @@ module Ext = struct ~(state : Eliom_common.user_scope * [> `Data | `Service ] * string) f e = let state' = (state :> ('aa, 'bb) state) in - let (_sitedata, _sub_states_level, _id, _f) as a = + let (sitedata, sub_states_level, id, f) as a = fold_sub_states_aux_aux ?sitedata ~state:state' f in fold_sub_states_aux Ocsigen_cache.Dlist.fold Ocsigen_lib.id a e state @@ -1350,7 +1350,7 @@ module Ext = struct | (_, `Pers, _) -> (Eliommod_sessiongroups.Pers.find (Eliom_common.make_persistent_full_group_name - ~cookie_level:sub_states_level sitedata.Eliom_common.site_dir_string (Some id)) + sub_states_level sitedata.Eliom_common.site_dir_string (Some id)) >>= fun l -> Lwt_list.fold_left_s f e l) | _ -> @@ -1384,7 +1384,7 @@ module Ext = struct (*VVV Does not work with volatile group data *) let get_volatile_data ~state:((state_scope, _, cookie) : ('s, [ `Data ]) state) - ~table:(table_scope, _secure, t : 'a volatile_table) = + ~table:(table_scope, secure, t : 'a volatile_table) = check_scopes table_scope state_scope; Eliom_common.SessionCookies.find t cookie @@ -1396,7 +1396,7 @@ module Ext = struct let set_volatile_data ~state:((state_scope, _, cookie) : ('s, [ `Data ]) state) - ~table:(table_scope, _secure, t : 'a volatile_table) + ~table:(table_scope, secure, t : 'a volatile_table) value = check_scopes table_scope state_scope; Eliom_common.SessionCookies.replace t cookie value @@ -1464,7 +1464,7 @@ module Ext = struct let unset_service_cookie_timeout ~cookie:(_, (_, _, _, r, _, _)) = r := TGlobal - let unset_volatile_data_cookie_timeout ~cookie:(_cookie, (_, _, r, _, _)) = + let unset_volatile_data_cookie_timeout ~cookie:(cookie, (_, _, r, _, _)) = r := TGlobal let unset_persistent_data_cookie_timeout diff --git a/src/lib/shared/eliom_comet_base.ml b/src/lib/shared/eliom_comet_base.ml index 515c720189..7c0036cd68 100644 --- a/src/lib/shared/eliom_comet_base.ml +++ b/src/lib/shared/eliom_comet_base.ml @@ -24,7 +24,6 @@ type 'a chan_id = string external string_of_chan_id : 'a chan_id -> string = "%identity" external chan_id_of_string : string -> 'a chan_id = "%identity" -[@@@ocaml.warning "-39"] type position = | Newest of int | After of int @@ -65,7 +64,6 @@ type answer = | State_closed | Comet_error of string [@@deriving json] -[@@@ocaml.warning "+39"] type comet_service = Comet_service : diff --git a/src/lib/shared/eliom_common_base.ml b/src/lib/shared/eliom_common_base.ml index ca78d4f60b..9fe214d5e1 100644 --- a/src/lib/shared/eliom_common_base.ml +++ b/src/lib/shared/eliom_common_base.ml @@ -55,14 +55,14 @@ type cookie_scope = [ `Session of scope_hierarchy | `Client_process of scope_hierarchy ] let level_of_user_scope : [< user_scope ] -> [> user_level ] = function - | `Session _n -> `Session - | `Session_group _n -> `Session_group - | `Client_process _n -> `Client_process + | `Session n -> `Session + | `Session_group n -> `Session_group + | `Client_process n -> `Client_process let cookie_level_of_user_scope : [< user_scope ] -> [> cookie_level ] = function - | `Session _n - | `Session_group _n -> `Session - | `Client_process _n -> `Client_process + | `Session n + | `Session_group n -> `Session + | `Client_process n -> `Client_process let cookie_scope_of_user_scope : [< user_scope ] -> [> cookie_scope ] = function | `Session n @@ -314,7 +314,7 @@ let prefixlengthminusone = prefixlength - 1 let split_nl_prefix_param l = let rec aux other map = function | [] -> (map, other) - | ((n, _v) as a)::l -> + | ((n, v) as a)::l -> if String.first_diff n nl_param_prefix 0 prefixlengthminusone = prefixlength then @@ -349,7 +349,7 @@ let remove_prefixed_param pref l = let len = String.length pref in let rec aux = function | [] -> [] - | ((n,_v) as a)::l -> + | ((n,v) as a)::l -> try if (String.sub n 0 len) = pref then aux l diff --git a/src/lib/shared/eliom_cookies_base.ml b/src/lib/shared/eliom_cookies_base.ml index 6d4a33d31b..aff3913e41 100644 --- a/src/lib/shared/eliom_cookies_base.ml +++ b/src/lib/shared/eliom_cookies_base.ml @@ -1,7 +1,5 @@ open Ocsigen_cookies -[@@@ocaml.warning "-39"] - type cookie = Ocsigen_cookies.cookie = | OSet of float option (* exp date *) * string (* value *) * bool (* secure *) | OUnset @@ -11,8 +9,6 @@ type cookie_array = ( string array * (( string * cookie ) array )) array [@@deriving json] -[@@@ocaml.warning "+39"] - (** changes to cookieset_to_json must be completed by corresponding changes in cookieset_of_json *) let cookieset_to_json set = diff --git a/src/lib/shared/eliom_parameter_base.ml b/src/lib/shared/eliom_parameter_base.ml index e6e6d13e33..583cdd9c98 100644 --- a/src/lib/shared/eliom_parameter_base.ml +++ b/src/lib/shared/eliom_parameter_base.ml @@ -193,12 +193,12 @@ let make_list_suffix i = "["^(string_of_int i)^"]" let rec make_suffix : type a c. (a,'b,c) params_type -> a -> string list = fun typ params -> match typ with - | TNLParams {param; _} -> make_suffix param params + | TNLParams {param} -> make_suffix param params | TProd (t1, t2) -> (make_suffix t1 (fst params)) @ (make_suffix t2 (snd params)) | TAtom (_,a) -> [string_of_atom a params] - | TCoord _n -> (make_suffix (TAtom ("",TInt)) (params.abscissa))@ + | TCoord n -> (make_suffix (TAtom ("",TInt)) (params.abscissa))@ (make_suffix (TAtom ("",TInt)) (params.ordinate)) | TUnit -> [""] | TConst v -> [v] @@ -220,7 +220,7 @@ let rec make_suffix : type a c. (a,'b,c) params_type -> a -> string list = fun t (make_suffix typ l)) | TUserType (_, tao) -> [ Eliom_common.To_and_of_shared.to_string tao params ] - | TTypeFilter (t, _check) -> make_suffix t params + | TTypeFilter (t, check) -> make_suffix t params | TSum (t1, t2) -> (match params with | Inj1 p -> make_suffix t1 p @@ -239,7 +239,7 @@ let rec aux : type a c. (a,'b,c) params_type -> string list option -> 'y -> a -> fun typ psuff nlp params pref suff l -> let open Eliommod_parameters in match typ with - | TNLParams {name;param=t;_} -> + | TNLParams {name;param=t} -> let psuff, nlp, nl = aux t psuff nlp params pref suff [] in (psuff, String.Table.add name nl nlp, l) | TProd (t1, t2) -> @@ -283,7 +283,7 @@ let rec aux : type a c. (a,'b,c) params_type -> string list option -> 'y -> a -> psuff, nlp, ((pref ^ name ^ suff), insert_string (Eliom_common.To_and_of_shared.to_string tao params)) :: l - | TTypeFilter (t, _check) -> aux t psuff nlp params pref suff l + | TTypeFilter (t, check) -> aux t psuff nlp params pref suff l | TUnit -> psuff, nlp, l | TAny -> psuff, nlp, l@(List.map (fun (x,v) -> x,insert_string v) params) | TConst _ -> psuff, nlp, l @@ -359,11 +359,11 @@ let rec walk_parameter_tree : type a c. string -> (a,'b,c) params_type -> a to_a | TAny -> None | TNLParams _ -> None | TUnit -> None - | TOption (_o,_) -> failwith "walk_parameter_tree with option" - | TSet _o -> failwith "walk_parameter_tree with set" - | TList (_, _o) -> failwith "walk_parameter_tree with list" - | TProd (_a, _b) -> failwith "walk_parameter_tree with tuple" - | TSum (_a, _b) -> failwith "walk_parameter_tree with sum" + | TOption (o,_) -> failwith "walk_parameter_tree with option" + | TSet o -> failwith "walk_parameter_tree with set" + | TList (_, o) -> failwith "walk_parameter_tree with list" + | TProd (a, b) -> failwith "walk_parameter_tree with tuple" + | TSum (a, b) -> failwith "walk_parameter_tree with sum" | TRaw_post_data -> failwith "walk_parameter_tree with raw post data" @@ -385,12 +385,12 @@ let construct_params nonlocparams typ p = let make_params_names params = let rec aux : type a c. bool -> string -> string -> (a,'b,c) params_type -> bool * c = fun issuffix prefix suffix x -> match x with - | TNLParams {param=t;_} -> aux issuffix prefix suffix t + | TNLParams {param=t} -> aux issuffix prefix suffix t | TProd (t1, t2) -> let issuffix, a = aux issuffix prefix suffix t1 in let issuffix, b = aux issuffix prefix suffix t2 in issuffix, (a, b) - | TAtom(name,_a) -> issuffix, prefix^name^suffix + | TAtom(name,a) -> issuffix, prefix^name^suffix | TCoord(name) -> issuffix, prefix^name^suffix | TFile name -> issuffix, prefix^name^suffix | TUserType (name, _) -> issuffix, prefix^name^suffix @@ -471,7 +471,7 @@ let nl_prod specification *) let rec remove_from_nlp : type a c. 's -> (a,'b,c) params_type -> 's = fun nlp x -> match x with - | TNLParams {name=n;_} -> String.Table.remove n nlp + | TNLParams {name=n} -> String.Table.remove n nlp | TProd (t1, t2) -> let nlp = remove_from_nlp nlp t1 in remove_from_nlp nlp t2 @@ -594,8 +594,8 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = [] with e -> raise (Eliom_common.Eliom_Typing_Error [("", e)])) - | TOption (_t,_), [] -> None, [] - | TOption (_t,_), ""::l -> None, l + | TOption (t,_), [] -> None, [] + | TOption (t,_), ""::l -> None, l | TOption (t,_), l -> let r, ll = parse_suffix t l in Some r, ll @@ -629,14 +629,14 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = | r, l -> let rr, ll = parse_suffix t2 l in (r, rr), ll) - | TAtom (_name, t), v::l -> + | TAtom (name, t), v::l -> (try atom_of_string t v, l with e -> raise (Eliom_common.Eliom_Typing_Error [("", e)])) - | TUserType (_name, tao), v::l -> + | TUserType (name, tao), v::l -> (try Eliom_common.To_and_of_shared.of_string tao v, l with e -> raise (Eliom_common.Eliom_Typing_Error [("", e)])) - | TTypeFilter (_t, None), _ -> failwith "Type filter without filter" + | TTypeFilter (t, None), _ -> failwith "Type filter without filter" | TTypeFilter (t, Some check), l -> let (v, _) as a = parse_suffix t l in check v; @@ -658,7 +658,7 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = | TNLParams _, _ -> failwith "It is not possible to have non localized parameters in suffix" | TJson (_, Some typ), v::l -> Deriving_Json.from_string typ v, l - | TJson (_, None), _v::_l -> assert false (* client side only *) + | TJson (_, None), v::l -> assert false (* client side only *) | TAny, _ -> failwith "It is not possible to use any in suffix. May be try with all_suffix ?" | TFile _, _ -> assert false | TRaw_post_data, _ -> assert false @@ -689,7 +689,7 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = and aux : type a c. (a, 'b, c) params_type -> params' -> files -> string -> string -> a res_reconstr_param = fun typ params files pref suff -> match typ with - | TNLParams {param=t;_} -> aux t params files pref suff + | TNLParams {param=t} -> aux t params files pref suff | TProd (t1, t2) -> (match aux t1 params files pref suff with | Res_ (v1, l1, f) -> @@ -710,7 +710,7 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = | Errors_ (errs, ll, ff) when List.for_all (fun (_,s,_) -> s="") errs -> Res_ (None, ll, ff) | Errors_ err -> Errors_ err) with Not_found -> Res_ (None, params, files)) - | TOption (t,_b) -> + | TOption (t,b) -> (try (match aux t params files pref suff with | Res_ (v, l, f) -> Res_ (Some v, l, f) @@ -733,7 +733,7 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = | Res_ (vv2, ll2, ff2) -> Res_ (vv::vv2, ll2, ff2) | err -> err) - | Errors_ (_errs, ll, ff) when ll = params && ff = files -> + | Errors_ (errs, ll, ff) when ll = params && ff = files -> Res_ ([], params, files) | Errors_ (errs, ll, ff) -> (match aux_set ll ff with @@ -765,7 +765,7 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = end | TAtom (name,TBool) -> (try - let _v,l = (List.assoc_remove (pref^name^suff) params) in + let v,l = (List.assoc_remove (pref^name^suff) params) in Res_ (true,l,files) with Not_found -> Res_ (false, params, files)) @@ -804,7 +804,7 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = let v,l = (List.assoc_remove (pref^name^suff) params) in (try Res_ (Eliom_common.To_and_of_shared.of_string tao v,l,files) with e -> Errors_ ([(pref^name^suff),v,e], l, files)) - | TTypeFilter (_t, None) -> failwith "Type filter without filter" + | TTypeFilter (t, None) -> failwith "Type filter without filter" | TTypeFilter (t, Some check) -> (match aux t params files pref suff with | Res_ (v, l, files) as a -> @@ -841,7 +841,7 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = | TJson (name, Some typ) -> let v,l = List.assoc_remove (pref^name^suff) params in Res_ ((of_json ~typ v),l,files) - | TJson (_name, None) -> assert false + | TJson (name, None) -> assert false (* Never unmarshal server side without type! *) | TRaw_post_data -> raise Eliom_common.Eliom_Wrong_parameter in @@ -856,12 +856,12 @@ let reconstruct_params_ typ params files nosuffixversion urlsuffix : 'a = "Eliom_Wrong_parameter: params non-empty (ERROR): %a" (fun () l -> String.concat ", " (List.map (fun (x,k) -> x^"="^k) l)) l; if files <> [] then Lwt_log.ign_debug_f ~section - "Eliom_Wrong_parameter: files non-empty (ERROR): %a" (fun () files -> String.concat ", " (List.map (fun (x,_k) -> x) files)) files; + "Eliom_Wrong_parameter: files non-empty (ERROR): %a" (fun () files -> String.concat ", " (List.map (fun (x,k) -> x) files)) files; raise Eliom_common.Eliom_Wrong_parameter end | Errors_ (errs, l, files) -> if (l, files) = ([], []) - then raise (Eliom_common.Eliom_Typing_Error (List.map (fun (v,_l,e) -> (v,e)) errs)) + then raise (Eliom_common.Eliom_Typing_Error (List.map (fun (v,l,e) -> (v,e)) errs)) else raise Eliom_common.Eliom_Wrong_parameter with | Not_found -> raise Eliom_common.Eliom_Wrong_parameter diff --git a/src/lib/shared/eliom_route_base.ml b/src/lib/shared/eliom_route_base.ml index a0c1d8553a..50624b23d5 100644 --- a/src/lib/shared/eliom_route_base.ml +++ b/src/lib/shared/eliom_route_base.ml @@ -121,7 +121,7 @@ module Make (P : PARAM) = struct | [] -> Lwt.return ((Eliom_common.Notfound Eliom_common.Eliom_Wrong_parameter), []) - | ({ Eliom_common.s_max_use ; s_expire ; s_f; _ } as a) :: l -> + | ({ Eliom_common.s_max_use ; s_expire ; s_f } as a) :: l -> match s_expire with | Some (_, e) when !e < now -> (* Service expired. Removing it. *) @@ -202,11 +202,11 @@ module Make (P : PARAM) = struct | Eliom_common.Notfound e -> fail e let remove_id services id = - List.filter (fun {Eliom_common.s_id; _} -> s_id <> id) services + List.filter (fun {Eliom_common.s_id} -> s_id <> id) services let find_and_remove_id services id = let found, l = - let f (found, l) ({Eliom_common.s_id; _} as x) = + let f (found, l) ({Eliom_common.s_id} as x) = if id = s_id then Some x, l else @@ -221,7 +221,7 @@ module Make (P : PARAM) = struct raise Not_found let add_page_table tables url_act tref key - ({Eliom_common.s_id ; s_expire; _} as service) = + ({Eliom_common.s_id ; s_expire} as service) = let sp = Eliom_common.get_sp_option () in @@ -239,7 +239,7 @@ module Make (P : PARAM) = struct - only one for each key - we add a node in the dlist to limit their number *) (try - let (nodeopt, _l), newt = + let (nodeopt, l), newt = P.Table.find key !tref, P.Table.remove key !tref in (match nodeopt with @@ -250,10 +250,9 @@ module Make (P : PARAM) = struct let node = P.Container.dlist_add ?sp tables (Left (tref, key)) in tref := P.Table.add key (Some node, [service]) !tref) | { Eliom_common.key_state = - Eliom_common.SAtt_no, Eliom_common.SAtt_no - ; _ } -> + Eliom_common.SAtt_no, Eliom_common.SAtt_no } -> (try - let _nodeopt, l = P.Table.find key !tref + let nodeopt, l = P.Table.find key !tref and newt = P.Table.remove key !tref in (* nodeopt should be None *) try @@ -276,7 +275,7 @@ module Make (P : PARAM) = struct tref := P.Table.add key (None, [service]) !tref) | _ -> try - let _nodeopt, l = P.Table.find key !tref + let nodeopt, l = P.Table.find key !tref and newt = P.Table.remove key !tref in let _, oldl = find_and_remove_id l s_id in (* if there was an old version with the same id, we remove it *) @@ -329,7 +328,7 @@ module Make (P : PARAM) = struct let direltref = find_dircontent !dircontentref a in match !direltref with | Eliom_common.Dir dcr -> search_page_table_ref dcr l - | Eliom_common.File _ptr -> + | Eliom_common.File ptr -> raise (Eliom_common.Eliom_page_erasing a) with | Not_found -> @@ -439,7 +438,7 @@ module Make (P : PARAM) = struct | Eliom_common.File page_table_ref -> (match l with | [] -> find false page_table_ref None - | _l -> (* We have a file with suffix *) + | l -> (* We have a file with suffix *) raise Eliom_common.Eliom_Wrong_parameter))) (function | Exn1 | Eliom_common.Eliom_Wrong_parameter as e -> diff --git a/src/lib/shared/eliom_runtime.ml b/src/lib/shared/eliom_runtime.ml index 13446299c5..fce9f00b18 100644 --- a/src/lib/shared/eliom_runtime.ml +++ b/src/lib/shared/eliom_runtime.ml @@ -48,9 +48,7 @@ module RawXML = struct | Space -> " " | Comma -> ", " - [@@@ocaml.warning "-39"] type cookie_info = (bool * string list) [@@deriving json] - [@@@ocaml.warning "+39"] type caml_event_handler = | CE_registered_closure of @@ -114,10 +112,10 @@ module RawXML = struct and attrib = aname * racontent let aname = function - | name, RACamlEventHandler (CE_registered_closure (_crypto, _)) -> + | name, RACamlEventHandler (CE_registered_closure (crypto, _)) -> closure_name_prefix^name - | _, RAClient (_s, Some (name,_), _c) - | name, RAClient (_s, None, _c) -> client_name_prefix^name + | _, RAClient (s, Some (name,_), c) + | name, RAClient (s, None, c) -> client_name_prefix^name | name, _ -> name let acontent = function | _ ,RAReact s -> (match React.S.value s with None -> AStr "" | Some x -> x) @@ -165,7 +163,7 @@ module RawXML = struct let filter_class_value acc = function | AStr v -> v :: acc - | AStrL (_space, v) -> + | AStrL (space, v) -> v @ acc | _ -> failwith "attribute class is not a string" @@ -179,7 +177,7 @@ module RawXML = struct begin match Eliom_lazy.force link_info with | None -> freepos, acc_class, acc_attr - | Some (_kind, cookie_info, tmpl, _) -> + | Some (kind, cookie_info, tmpl, _) -> let acc_class = ce_call_service_class::acc_class in let acc_attr = match cookie_info with diff --git a/src/lib/shared/eliom_uri.ml b/src/lib/shared/eliom_uri.ml index 3d4aa7c062..c209d43ba2 100644 --- a/src/lib/shared/eliom_uri.ml +++ b/src/lib/shared/eliom_uri.ml @@ -44,10 +44,10 @@ let reconstruct_absolute_url_path = string_of_url_path_suff let reconstruct_relative_url_path current_url u = let rec drop cururl desturl = match cururl, desturl with - | _a::l, [_b] -> l, desturl - | [_a], m -> [], m + | a::l, [b] -> l, desturl + | [a], m -> [], m | a::l, b::m when a = b -> drop l m - | _a::l, m -> l, m + | a::l, m -> l, m | [], m -> [], m in let rec makedotdot = function | [] -> [] @@ -101,7 +101,7 @@ let make_proto_prefix then Eliom_config.get_default_sslport () else Eliom_config.get_default_port () in - Eliom_lib.Url.make_absolute_url ~https ~host ~port "/" + Eliom_lib.Url.make_absolute_url https host port "/" let is_https https ssl service = https = Some true || @@ -354,7 +354,7 @@ let make_uri_components let make_string_uri_from_components (uri, params, fragment) = let s = - Eliom_lib.String.may_concat uri ~sep:"?" + Eliom_lib.String.may_concat uri "?" (Eliom_parameter.construct_params_string params) in match fragment with @@ -507,7 +507,7 @@ let make_post_uri_components_ (* for getparams and non localized params: *) - let _suff, params = + let suff, params = Eliom_parameter.construct_params_list nlp (Eliom_service.get_params_type service) getparams (* if nl params were already present, they will be replaced @@ -674,7 +674,7 @@ let make_cookies_info (https, service) = None else Some (Eliom_service.full_path attser) - | Eliom_service.Nonattached _naser -> + | Eliom_service.Nonattached naser -> Some (Eliom_request_info.get_csp_original_full_path ()) in match get_path_ ~service with