mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-05 12:38:09 -07:00
dev-ml/eliom: remove old
Package-Manager: Portage-2.3.3, Repoman-2.3.1
This commit is contained in:
@@ -1,2 +1 @@
|
||||
DIST eliom-5.0.0.tar.gz 728278 SHA256 6726500f9a54478def95875d04098dc8dc829d4a10e06896ff4f037bb1c03cbd SHA512 1c5297e376c3a46935de369b418638a772304246b73756f8bc052301b48d62a37af527274bf1a05064f33b60ff9dcde057a0030f083136fa4e1c0cfa07f01887 WHIRLPOOL ca1186787a8f938cf029f9a5c9904ed0324a3d24d2f0d0834dd1e2b2f995de6d57d1040b4d128de8233255ca385478f0ba3bf597c2f0315ab2f1894118755dca
|
||||
DIST eliom-6.0.0.tar.gz 722673 SHA256 ec5636481be9cccc8256b13a5e551f6a8c32662e1c3211887a22eedf5c8958f9 SHA512 c59261bb6ba2303a7951de2e689abcb55af92b53a145d42054244d253b6757d72ba3f937772219b2b0aa5bccfe1a74baf62c938f40c1cce90720b6efe7be3b63 WHIRLPOOL e4f8c44c16dbc33c7576a117a25cb2f709a893ad82baa517fb2d5a776b0838affbef56aba84a977903c71d32987f3d16af485c5cf8dddd1cc39395025d996226
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Id$
|
||||
|
||||
EAPI=5
|
||||
|
||||
inherit eutils multilib findlib
|
||||
|
||||
DESCRIPTION="A web framework to program client/server applications"
|
||||
HOMEPAGE="http://ocsigen.org/eliom/"
|
||||
SRC_URI="https://github.com/ocsigen/eliom/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="LGPL-2.1-with-linking-exception"
|
||||
SLOT="0/${PV}"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE="doc +ocamlopt +ppx"
|
||||
|
||||
RDEPEND=">=dev-lang/ocaml-4.03:=[ocamlopt?]
|
||||
>=dev-ml/js_of_ocaml-2.8.2:=
|
||||
>=www-servers/ocsigenserver-2.8:=
|
||||
>=dev-ml/tyxml-4:=
|
||||
>=dev-ml/deriving-0.6:=
|
||||
>=dev-ml/reactiveData-0.2.1:=
|
||||
dev-ml/ocaml-ipaddr:=
|
||||
dev-ml/react:=
|
||||
dev-ml/ocaml-ssl:=
|
||||
>=dev-ml/lwt-2.5.0:=
|
||||
dev-ml/calendar:=
|
||||
dev-ml/camlp4:=
|
||||
ppx? ( >=dev-ml/ppx_tools-0.99.3:= )"
|
||||
DEPEND="${RDEPEND}
|
||||
dev-ml/ocamlbuild
|
||||
dev-ml/opam"
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}/"{camlp4,oc43,oc43-2}.patch \
|
||||
"${FILESDIR}/tyxml4.patch" \
|
||||
"${FILESDIR}/jsofocaml-282.patch" \
|
||||
"${FILESDIR}/reactivedata.patch" \
|
||||
"${FILESDIR}/ocsigen28.patch"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
if use ocamlopt ; then
|
||||
emake PPX=$(usex ppx true false) all
|
||||
else
|
||||
emake PPX=$(usex ppx true false) byte
|
||||
fi
|
||||
use doc && emake doc
|
||||
emake man
|
||||
}
|
||||
|
||||
src_install() {
|
||||
opam-installer \
|
||||
--prefix="${ED}/usr" \
|
||||
--libdir="${D}/$(ocamlc -where)" \
|
||||
--docdir="${ED}/usr/share/doc/${PF}" \
|
||||
--mandir="${ED}/usr/share/man" \
|
||||
|| die
|
||||
dodoc CHANGES README.md
|
||||
if use doc ; then
|
||||
docinto client/html
|
||||
dodoc -r _build/src/lib/client/api.docdir/*
|
||||
docinto server/html
|
||||
dodoc -r _build/src/lib/server/api.docdir/*
|
||||
fi
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
commit f157a5b913451b85e8cfe7549c66e5c98669233b
|
||||
Author: Vasilis Papavasileiou <git@vasilis.airpost.net>
|
||||
Date: Wed Mar 2 14:23:02 2016 +0100
|
||||
|
||||
Compile against Camlp4 4.02+7
|
||||
|
||||
diff --git a/src/syntax/pa_eliom_seed.ml b/src/syntax/pa_eliom_seed.ml
|
||||
index c101ff8..dc31caa 100644
|
||||
--- a/src/syntax/pa_eliom_seed.ml
|
||||
+++ b/src/syntax/pa_eliom_seed.ml
|
||||
@@ -632,8 +632,26 @@ module Register(Id : sig val name: string end)(Pass : Pass) = struct
|
||||
| None ->
|
||||
Printf.ksprintf (Syntax_error.raise loc) fmt
|
||||
|
||||
- module E2 = Camlp4.ErrorHandler.Register(Syntax_error)
|
||||
- DELETE_RULE Gram expr: "{"; TRY [label_expr_list; "}"] END;
|
||||
+ module E2 = Camlp4.ErrorHandler.Register(Syntax_error) ;;
|
||||
+
|
||||
+ try
|
||||
+ DELETE_RULE Gram expr: "{"; TRY [label_expr_list; "}"] END
|
||||
+ with Camlp4.Struct.Grammar.Delete.Rule_not_found _ ->
|
||||
+ (let test_record_field =
|
||||
+ Gram.Entry.of_parser "record_field" (fun strm ->
|
||||
+ let rec loop = function
|
||||
+ | [] -> ()
|
||||
+ | (UIDENT _, _) :: (KEYWORD ".", _) :: rest -> loop rest
|
||||
+ | (LIDENT _, _) :: (KEYWORD "=", _) :: _ -> ()
|
||||
+ | (LIDENT _, _) :: (KEYWORD ";", _) :: _ -> ()
|
||||
+ | [LIDENT _, _] -> ()
|
||||
+ | _ -> raise Stream.Failure
|
||||
+ in
|
||||
+ loop (Stream.npeek 100 strm))
|
||||
+ in
|
||||
+ DELETE_RULE Gram expr:
|
||||
+ "{"; test_record_field; label_expr_list; "}" END) ;;
|
||||
+
|
||||
DELETE_RULE Gram expr: "{"; TRY [expr LEVEL "."; "with"]; label_expr_list; "}" END;
|
||||
|
||||
(* Extending syntax *)
|
||||
@@ -812,7 +830,7 @@ module Register(Id : sig val name: string end)(Pass : Pass) = struct
|
||||
expr: LEVEL "simple"
|
||||
|
||||
[ [ KEYWORD "{"; lel = TRY [lel = label_expr_list; "}" -> lel] ->
|
||||
- <:expr< { $lel$ } >>
|
||||
+ Ast.ExRec (_loc, lel, Ast.ExNil _loc)
|
||||
| KEYWORD "{shared#";
|
||||
typ = TRY [ typ = OPT ctyp; KEYWORD "{" -> typ];
|
||||
opt_lvl = dummy_set_level_shared_value_expr ;
|
||||
@@ -1,361 +0,0 @@
|
||||
Backported from:
|
||||
|
||||
commit 4edaf2275e2f7a027f3c7dc52e1e295a6e56b19a
|
||||
Author: Vasilis Papavasileiou <git@vasilis.airpost.net>
|
||||
Date: Thu Aug 18 19:40:56 2016 +0200
|
||||
|
||||
Fix ocsigen/js_of_ocaml#518
|
||||
|
||||
upstream.
|
||||
|
||||
Index: eliom-5.0.0/src/lib/eliom_client.client.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_client.client.ml
|
||||
+++ eliom-5.0.0/src/lib/eliom_client.client.ml
|
||||
@@ -461,23 +461,29 @@ let raw_event_handler value =
|
||||
|
||||
let closure_name_prefix = Eliom_lib_base.RawXML.closure_name_prefix
|
||||
let closure_name_prefix_len = String.length closure_name_prefix
|
||||
-let reify_caml_event name node ce : string * (#Dom_html.event Js.t -> bool) =
|
||||
+let reify_caml_event name node ce =
|
||||
match ce with
|
||||
- | Xml.CE_call_service None -> name,(fun _ -> true)
|
||||
+ | Xml.CE_call_service None -> name, `Other (fun _ -> true)
|
||||
| Xml.CE_call_service (Some (`A, cookies_info, tmpl)) ->
|
||||
- name, (fun ev ->
|
||||
+ name, `Other (fun ev ->
|
||||
let node = Js.Opt.get (Dom_html.CoerceTo.a node)
|
||||
(fun () -> Lwt_log.raise_error ~section "not an anchor element")
|
||||
in
|
||||
raw_a_handler node cookies_info tmpl ev)
|
||||
| Xml.CE_call_service
|
||||
(Some ((`Form_get | `Form_post) as kind, cookies_info, tmpl)) ->
|
||||
- name, (fun ev ->
|
||||
+ name, `Other (fun ev ->
|
||||
let form = Js.Opt.get (Dom_html.CoerceTo.form node)
|
||||
(fun () -> Lwt_log.raise_error ~section "not a form element") in
|
||||
raw_form_handler form kind cookies_info tmpl ev)
|
||||
| Xml.CE_client_closure f ->
|
||||
- name, (fun ev -> try f ev; true with False -> false)
|
||||
+ name, `Other (fun ev -> try f ev; true with False -> false)
|
||||
+ | Xml.CE_client_closure_keyboard f ->
|
||||
+ name,
|
||||
+ `Keyboard (fun ev -> try f ev; true with Eliom_lib.False -> false)
|
||||
+ | Xml.CE_client_closure_mouse f ->
|
||||
+ name,
|
||||
+ `Mouse (fun ev -> try f ev; true with Eliom_lib.False -> false)
|
||||
| Xml.CE_registered_closure (_, cv) ->
|
||||
let name =
|
||||
let len = String.length name in
|
||||
@@ -485,16 +491,27 @@ let reify_caml_event name node ce : stri
|
||||
then String.sub name closure_name_prefix_len
|
||||
(len - closure_name_prefix_len)
|
||||
else name in
|
||||
- name, raw_event_handler cv
|
||||
+ name, `Other (raw_event_handler cv)
|
||||
|
||||
let register_event_handler, flush_load_script =
|
||||
let add, _, flush = create_buffer () in
|
||||
let register node (name, ev) =
|
||||
- let name,f = reify_caml_event name node ev in
|
||||
- if name = "onload"
|
||||
- then add f
|
||||
- else Js.Unsafe.set node (Js.bytestring name)
|
||||
- (Dom_html.handler (fun ev -> Js.bool (f ev)))
|
||||
+ match reify_caml_event name node ev with
|
||||
+ | "onload", `Other f ->
|
||||
+ add f
|
||||
+ | "onload", `Keyboard _ ->
|
||||
+ failwith "keyboard event handler for onload"
|
||||
+ | "onload", `Mouse _ ->
|
||||
+ failwith "keyboard event handler for onload"
|
||||
+ | name, `Other f ->
|
||||
+ Js.Unsafe.set node (Js.bytestring name)
|
||||
+ (Dom_html.handler (fun ev -> Js.bool (f ev)))
|
||||
+ | name, `Keyboard f ->
|
||||
+ Js.Unsafe.set node (Js.bytestring name)
|
||||
+ (Dom_html.handler (fun ev -> Js.bool (f ev)))
|
||||
+ | name, `Mouse f ->
|
||||
+ Js.Unsafe.set node (Js.bytestring name)
|
||||
+ (Dom_html.handler (fun ev -> Js.bool (f ev)))
|
||||
in
|
||||
let flush () =
|
||||
let fs = flush () in
|
||||
Index: eliom-5.0.0/src/lib/eliom_content.server.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_content.server.mli
|
||||
+++ eliom-5.0.0/src/lib/eliom_content.server.mli
|
||||
@@ -114,7 +114,7 @@ module Xml : sig
|
||||
example {% <<a_api project="js_of_ocaml" | type
|
||||
Dom_html.mouseEvent>>%} or {% <<a_api project="js_of_ocaml" | type
|
||||
Dom_html.keyboardEvent >>%}. *)
|
||||
- type -'a caml_event_handler constraint 'a = #Dom_html.event
|
||||
+ type caml_event_handler
|
||||
|
||||
(**/**)
|
||||
|
||||
@@ -129,18 +129,14 @@ module Xml : sig
|
||||
val make_event_handler_table : elt -> Eliom_lib.RawXML.event_handler_table
|
||||
val make_client_attrib_table : elt -> Eliom_lib.RawXML.client_attrib_table
|
||||
|
||||
- val caml_event_handler : ((#Dom_html.event as 'a) Js.t -> unit) Eliom_lib.client_value -> 'a caml_event_handler
|
||||
-
|
||||
- class type biggest_event = object
|
||||
- inherit Dom_html.event
|
||||
- inherit Dom_html.mouseEvent
|
||||
- inherit Dom_html.keyboardEvent
|
||||
- end
|
||||
+ val caml_event_handler :
|
||||
+ (Dom_html.event Js.t -> unit) Eliom_lib.client_value ->
|
||||
+ caml_event_handler
|
||||
|
||||
type racontent =
|
||||
| RA of acontent
|
||||
| RAReact of acontent option React.signal
|
||||
- | RACamlEventHandler of biggest_event caml_event_handler
|
||||
+ | RACamlEventHandler of caml_event_handler
|
||||
| RALazyStr of string Eliom_lazy.request
|
||||
| RALazyStrL of separator * string Eliom_lazy.request list
|
||||
| RAClient of string * attrib option * Eliom_lib.poly
|
||||
Index: eliom-5.0.0/src/lib/eliom_content_core.client.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_content_core.client.ml
|
||||
+++ eliom-5.0.0/src/lib/eliom_content_core.client.ml
|
||||
@@ -87,21 +87,19 @@ module Xml = struct
|
||||
let node ?(a = []) name children = make (Node (name, a, children))
|
||||
let lazy_node ?a name children = node ?a name (Eliom_lazy.force children)
|
||||
|
||||
- type biggest_event_handler = biggest_event Js.t -> unit
|
||||
-
|
||||
type event_handler = Dom_html.event Js.t -> unit
|
||||
type mouse_event_handler = Dom_html.mouseEvent Js.t -> unit
|
||||
type keyboard_event_handler = Dom_html.keyboardEvent Js.t -> unit
|
||||
|
||||
let event_handler_attrib name (value : event_handler) =
|
||||
internal_event_handler_attrib name
|
||||
- (Caml (CE_client_closure (value :> biggest_event_handler)))
|
||||
+ (Caml (CE_client_closure value))
|
||||
let mouse_event_handler_attrib name (value : mouse_event_handler) =
|
||||
internal_event_handler_attrib name
|
||||
- (Caml (CE_client_closure (value :> biggest_event_handler)))
|
||||
+ (Caml (CE_client_closure_mouse value))
|
||||
let keyboard_event_handler_attrib name (value : keyboard_event_handler) =
|
||||
internal_event_handler_attrib name
|
||||
- (Caml (CE_client_closure (value :> biggest_event_handler)))
|
||||
+ (Caml (CE_client_closure_keyboard value))
|
||||
|
||||
let node_react_children ?(a = []) name children =
|
||||
{elt = Lazy.from_val (ReactChildren (Node (name,a,[]),children)); node_id=NoId}
|
||||
Index: eliom-5.0.0/src/lib/eliom_content_core.client.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_content_core.client.mli
|
||||
+++ eliom-5.0.0/src/lib/eliom_content_core.client.mli
|
||||
@@ -35,24 +35,21 @@ module Xml : sig
|
||||
type aname = string
|
||||
type attrib
|
||||
|
||||
- type -'a caml_event_handler =
|
||||
+ type caml_event_handler =
|
||||
| CE_registered_closure of string * Eliom_lib.poly
|
||||
(* 'a Js.t -> unit) client_value_server *)
|
||||
- | CE_client_closure of ((#Dom_html.event as 'a) Js.t -> unit)
|
||||
+ | CE_client_closure of
|
||||
+ (Dom_html.event Js.t -> unit) (* Client side-only *)
|
||||
+ | CE_client_closure_mouse of
|
||||
+ (Dom_html.mouseEvent Js.t -> unit) (* Client side-only *)
|
||||
+ | CE_client_closure_keyboard of
|
||||
+ (Dom_html.keyboardEvent Js.t -> unit) (* Client side-only *)
|
||||
| CE_call_service of
|
||||
([ `A | `Form_get | `Form_post] * (bool * string list) option * string option) option Eliom_lazy.request
|
||||
|
||||
- (* Inherit from all events.
|
||||
- Necessary for subtyping since caml_event_handler is contravariant. *)
|
||||
- class type biggest_event = object
|
||||
- inherit Dom_html.event
|
||||
- inherit Dom_html.mouseEvent
|
||||
- inherit Dom_html.keyboardEvent
|
||||
- end
|
||||
-
|
||||
type internal_event_handler =
|
||||
| Raw of string
|
||||
- | Caml of biggest_event caml_event_handler
|
||||
+ | Caml of caml_event_handler
|
||||
type event_handler = Dom_html.event Js.t -> unit
|
||||
type mouse_event_handler = Dom_html.mouseEvent Js.t -> unit
|
||||
type keyboard_event_handler = Dom_html.keyboardEvent Js.t -> unit
|
||||
@@ -89,7 +86,7 @@ module Xml : sig
|
||||
type racontent =
|
||||
| RA of acontent
|
||||
| RAReact of acontent option React.signal
|
||||
- | RACamlEventHandler of biggest_event caml_event_handler
|
||||
+ | RACamlEventHandler of caml_event_handler
|
||||
| RALazyStr of string Eliom_lazy.request
|
||||
| RALazyStrL of separator * string Eliom_lazy.request list
|
||||
| RAClient of string * attrib option * Eliom_lib.poly
|
||||
Index: eliom-5.0.0/src/lib/eliom_content_core.server.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_content_core.server.ml
|
||||
+++ eliom-5.0.0/src/lib/eliom_content_core.server.ml
|
||||
@@ -114,7 +114,6 @@ module Xml = struct
|
||||
let lazy_node ?(a = []) name children =
|
||||
make_lazy (Eliom_lazy.from_fun (fun () -> (Node (name, a, Eliom_lazy.force children))))
|
||||
|
||||
- type biggest_event_handler = (biggest_event Js.t -> unit) Eliom_lib.client_value
|
||||
type event_handler = (Dom_html.event Js.t -> unit) Eliom_lib.client_value
|
||||
type mouse_event_handler = (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value
|
||||
type keyboard_event_handler = (Dom_html.keyboardEvent Js.t -> unit) Eliom_lib.client_value
|
||||
@@ -133,11 +132,11 @@ module Xml = struct
|
||||
let biggest_event_handler_attrib name cf =
|
||||
internal_event_handler_attrib name (event_handler cf)
|
||||
let event_handler_attrib name (cf : event_handler) =
|
||||
- biggest_event_handler_attrib name (cf :> biggest_event_handler)
|
||||
+ biggest_event_handler_attrib name cf
|
||||
let mouse_event_handler_attrib name (cf : mouse_event_handler) =
|
||||
- biggest_event_handler_attrib name (cf :> biggest_event_handler)
|
||||
+ biggest_event_handler_attrib name cf
|
||||
let keyboard_event_handler_attrib name (cf : keyboard_event_handler) =
|
||||
- biggest_event_handler_attrib name (cf :> biggest_event_handler)
|
||||
+ biggest_event_handler_attrib name cf
|
||||
|
||||
let client_attrib ?init (x : attrib Eliom_lib.client_value) =
|
||||
let crypto = make_cryptographic_safe_string () in
|
||||
Index: eliom-5.0.0/src/lib/eliom_content_core.server.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_content_core.server.mli
|
||||
+++ eliom-5.0.0/src/lib/eliom_content_core.server.mli
|
||||
@@ -28,7 +28,7 @@ module Xml : sig
|
||||
and type mouse_event_handler = (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value
|
||||
and type keyboard_event_handler = (Dom_html.keyboardEvent Js.t -> unit) Eliom_lib.client_value
|
||||
|
||||
- type -'a caml_event_handler constraint 'a = #Dom_html.event
|
||||
+ type caml_event_handler
|
||||
|
||||
(**/**)
|
||||
|
||||
@@ -43,15 +43,9 @@ module Xml : sig
|
||||
val make_event_handler_table : elt -> Eliom_lib.RawXML.event_handler_table
|
||||
val make_client_attrib_table : elt -> Eliom_lib.RawXML.client_attrib_table
|
||||
|
||||
- class type biggest_event = object
|
||||
- inherit Dom_html.event
|
||||
- inherit Dom_html.mouseEvent
|
||||
- inherit Dom_html.keyboardEvent
|
||||
- end
|
||||
-
|
||||
type internal_event_handler =
|
||||
| Raw of string
|
||||
- | Caml of biggest_event caml_event_handler
|
||||
+ | Caml of caml_event_handler
|
||||
|
||||
val internal_event_handler_attrib : aname -> internal_event_handler -> attrib
|
||||
val internal_event_handler_of_service :
|
||||
@@ -59,12 +53,14 @@ module Xml : sig
|
||||
* (bool * string list) option
|
||||
* string option) option Eliom_lazy.request -> internal_event_handler
|
||||
|
||||
- val caml_event_handler : ((#Dom_html.event as 'a) Js.t -> unit) Eliom_lib.client_value -> 'a caml_event_handler
|
||||
+ val caml_event_handler :
|
||||
+ (Dom_html.event Js.t -> unit) Eliom_lib.client_value ->
|
||||
+ caml_event_handler
|
||||
|
||||
type racontent =
|
||||
| RA of acontent
|
||||
| RAReact of acontent option React.signal
|
||||
- | RACamlEventHandler of biggest_event caml_event_handler
|
||||
+ | RACamlEventHandler of caml_event_handler
|
||||
| RALazyStr of string Eliom_lazy.request
|
||||
| RALazyStrL of separator * string Eliom_lazy.request list
|
||||
| RAClient of string * attrib option * Eliom_lib.poly
|
||||
Index: eliom-5.0.0/src/lib/eliom_lib_base.shared.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_lib_base.shared.ml
|
||||
+++ eliom-5.0.0/src/lib/eliom_lib_base.shared.ml
|
||||
@@ -70,26 +70,22 @@ module RawXML = struct
|
||||
|
||||
type cookie_info = (bool * string list) deriving (Json)
|
||||
|
||||
- type -'a caml_event_handler =
|
||||
+ type caml_event_handler =
|
||||
| CE_registered_closure of
|
||||
string * poly (* 'a Js.t -> unit) client_value *)
|
||||
| CE_client_closure of
|
||||
- ((#Dom_html.event as 'a) Js.t -> unit) (* Client side-only *)
|
||||
+ (Dom_html.event Js.t -> unit) (* Client side-only *)
|
||||
+ | CE_client_closure_mouse of
|
||||
+ (Dom_html.mouseEvent Js.t -> unit) (* Client side-only *)
|
||||
+ | CE_client_closure_keyboard of
|
||||
+ (Dom_html.keyboardEvent Js.t -> unit) (* Client side-only *)
|
||||
| CE_call_service of
|
||||
([ `A | `Form_get | `Form_post] * (cookie_info option) * string option)
|
||||
option Eliom_lazy.request
|
||||
|
||||
- (* Inherit from all events.
|
||||
- Necessary for subtyping since caml_event_handler is contravariant. *)
|
||||
- class type biggest_event = object
|
||||
- inherit Dom_html.event
|
||||
- inherit Dom_html.mouseEvent
|
||||
- inherit Dom_html.keyboardEvent
|
||||
- end
|
||||
-
|
||||
type internal_event_handler =
|
||||
| Raw of string
|
||||
- | Caml of biggest_event caml_event_handler
|
||||
+ | Caml of caml_event_handler
|
||||
|
||||
type uri = string Eliom_lazy.request
|
||||
let string_of_uri = Eliom_lazy.force
|
||||
@@ -128,7 +124,7 @@ module RawXML = struct
|
||||
type racontent =
|
||||
| RA of acontent
|
||||
| RAReact of acontent option React.signal
|
||||
- | RACamlEventHandler of biggest_event caml_event_handler
|
||||
+ | RACamlEventHandler of caml_event_handler
|
||||
| RALazyStr of string Eliom_lazy.request
|
||||
| RALazyStrL of separator * string Eliom_lazy.request list
|
||||
| RAClient of string * attrib option * poly (*attrib client_value *)
|
||||
Index: eliom-5.0.0/src/lib/eliom_lib_base.shared.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_lib_base.shared.mli
|
||||
+++ eliom-5.0.0/src/lib/eliom_lib_base.shared.mli
|
||||
@@ -73,24 +73,21 @@ module RawXML : sig
|
||||
|
||||
type cookie_info = (bool * string list) deriving (Json)
|
||||
|
||||
- type -'a caml_event_handler =
|
||||
+ type caml_event_handler =
|
||||
| CE_registered_closure of
|
||||
string * poly (* 'a Js.t -> unit) client_value *)
|
||||
- | CE_client_closure of ((#Dom_html.event as 'a) Js.t -> unit)
|
||||
+ | CE_client_closure of
|
||||
+ (Dom_html.event Js.t -> unit) (* Client side-only *)
|
||||
+ | CE_client_closure_mouse of
|
||||
+ (Dom_html.mouseEvent Js.t -> unit) (* Client side-only *)
|
||||
+ | CE_client_closure_keyboard of
|
||||
+ (Dom_html.keyboardEvent Js.t -> unit) (* Client side-only *)
|
||||
| CE_call_service of
|
||||
([ `A | `Form_get | `Form_post] * (cookie_info option) * string option) option Eliom_lazy.request
|
||||
|
||||
- (* Inherit from all events.
|
||||
- Necessary for subtyping since caml_event_handler is contravariant. *)
|
||||
- class type biggest_event = object
|
||||
- inherit Dom_html.event
|
||||
- inherit Dom_html.mouseEvent
|
||||
- inherit Dom_html.keyboardEvent
|
||||
- end
|
||||
-
|
||||
type internal_event_handler =
|
||||
| Raw of string
|
||||
- | Caml of biggest_event caml_event_handler
|
||||
+ | Caml of caml_event_handler
|
||||
|
||||
type uri = string Eliom_lazy.request
|
||||
val string_of_uri : uri -> string
|
||||
@@ -127,7 +124,7 @@ module RawXML : sig
|
||||
type racontent =
|
||||
| RA of acontent
|
||||
| RAReact of acontent option React.signal
|
||||
- | RACamlEventHandler of biggest_event caml_event_handler
|
||||
+ | RACamlEventHandler of caml_event_handler
|
||||
| RALazyStr of string Eliom_lazy.request
|
||||
| RALazyStrL of separator * string Eliom_lazy.request list
|
||||
| RAClient of string * attrib option * poly (* attrib client_value *)
|
||||
@@ -1,136 +0,0 @@
|
||||
commit 27c69ac5dfbc26744e304232bb8c0cf22d396082
|
||||
Author: Vasilis Papavasileiou <git@vasilis.airpost.net>
|
||||
Date: Thu May 5 11:14:02 2016 -0400
|
||||
|
||||
Fix PPX for 4.03 (empty let bindings)
|
||||
|
||||
diff --git a/src/ppx/ppx_eliom_client.ml b/src/ppx/ppx_eliom_client.ml
|
||||
index 580d2b5..fb2d263 100644
|
||||
--- a/src/ppx/ppx_eliom_client.ml
|
||||
+++ b/src/ppx/ppx_eliom_client.ml
|
||||
@@ -89,21 +89,25 @@ module Pass = struct
|
||||
]
|
||||
|
||||
let define_client_functions ~loc client_value_datas =
|
||||
- let bindings =
|
||||
- List.map
|
||||
- (fun (_num, id, expr, args) ->
|
||||
- let patt = Pat.var id in
|
||||
- let typ = find_fragment id in
|
||||
- let args = List.map Pat.var args in
|
||||
- let expr =
|
||||
- [%expr
|
||||
- fun [%p pat_args args] -> ([%e expr] : [%t typ])
|
||||
- ] [@metaloc loc]
|
||||
- in
|
||||
- Vb.mk ~loc patt expr)
|
||||
- client_value_datas
|
||||
- in
|
||||
- Str.value ~loc Nonrecursive bindings
|
||||
+ match client_value_datas with
|
||||
+ | [] ->
|
||||
+ []
|
||||
+ | _ ->
|
||||
+ let bindings =
|
||||
+ List.map
|
||||
+ (fun (_num, id, expr, args) ->
|
||||
+ let patt = Pat.var id in
|
||||
+ let typ = find_fragment id in
|
||||
+ let args = List.map Pat.var args in
|
||||
+ let expr =
|
||||
+ [%expr
|
||||
+ fun [%p pat_args args] -> ([%e expr] : [%t typ])
|
||||
+ ] [@metaloc loc]
|
||||
+ in
|
||||
+ Vb.mk ~loc patt expr)
|
||||
+ client_value_datas
|
||||
+ in
|
||||
+ [Str.value ~loc Nonrecursive bindings]
|
||||
|
||||
(* For injections *)
|
||||
|
||||
@@ -139,8 +143,8 @@ module Pass = struct
|
||||
let client_expr_data = flush_client_value_datas () in
|
||||
open_client_section loc ::
|
||||
register_client_closures client_expr_data @
|
||||
- [ define_client_functions loc client_expr_data ;
|
||||
- item ;
|
||||
+ define_client_functions loc client_expr_data @
|
||||
+ [ item ;
|
||||
close_server_section loc ;
|
||||
]
|
||||
|
||||
@@ -155,11 +159,13 @@ module Pass = struct
|
||||
push_client_value_data num id expr
|
||||
(List.map fst escaped_bindings);
|
||||
|
||||
- match context with
|
||||
- | `Server ->
|
||||
+ match context, escaped_bindings with
|
||||
+ | `Server, _ ->
|
||||
(* We are in a server fragment, this code should always be discarded. *)
|
||||
Exp.extension @@ AM.extension_of_error @@ Location.errorf "Eliom: ICE"
|
||||
- | `Shared ->
|
||||
+ | `Shared, [] ->
|
||||
+ [%expr [%e frag_eid] ()][@metaloc loc]
|
||||
+ | `Shared, _ ->
|
||||
let bindings =
|
||||
List.map
|
||||
(fun (gen_id, expr) ->
|
||||
diff --git a/src/ppx/ppx_eliom_server.ml b/src/ppx/ppx_eliom_server.ml
|
||||
index 97f0b53..b5238ad 100644
|
||||
--- a/src/ppx/ppx_eliom_server.ml
|
||||
+++ b/src/ppx/ppx_eliom_server.ml
|
||||
@@ -85,6 +85,7 @@ module Pass = struct
|
||||
let $gen_id$ = $orig_expr$ and ...
|
||||
(Necessary for injections in shared section) *)
|
||||
let bind_injected_idents injections =
|
||||
+ assert (injections <> []);
|
||||
let bindings =
|
||||
List.map
|
||||
(fun (txt, expr,_) ->
|
||||
@@ -134,10 +135,15 @@ module Pass = struct
|
||||
|
||||
let client_str item =
|
||||
let all_injections = flush_injections () in
|
||||
- let loc = item.pstr_loc in
|
||||
- [ bind_injected_idents all_injections;
|
||||
+ let ccs =
|
||||
+ let loc = item.pstr_loc in
|
||||
close_client_section loc all_injections
|
||||
- ]
|
||||
+ in
|
||||
+ match all_injections with
|
||||
+ | [] ->
|
||||
+ [ ccs ]
|
||||
+ | l ->
|
||||
+ [ bind_injected_idents l ; ccs ]
|
||||
|
||||
let server_str item = [
|
||||
item ;
|
||||
@@ -146,12 +152,19 @@ module Pass = struct
|
||||
|
||||
let shared_str item =
|
||||
let all_injections = flush_injections () in
|
||||
- let loc = item.pstr_loc in
|
||||
- [ bind_injected_idents all_injections ;
|
||||
- item ;
|
||||
- close_server_section loc ;
|
||||
- close_client_section loc all_injections ;
|
||||
- ]
|
||||
+ let cl =
|
||||
+ let loc = item.pstr_loc in
|
||||
+ [
|
||||
+ item;
|
||||
+ close_server_section loc ;
|
||||
+ close_client_section loc all_injections ;
|
||||
+ ]
|
||||
+ in
|
||||
+ match all_injections with
|
||||
+ | [] ->
|
||||
+ cl
|
||||
+ | l ->
|
||||
+ bind_injected_idents l :: cl
|
||||
|
||||
let fragment ?typ ~context:_ ~num ~id expr =
|
||||
let typ =
|
||||
@@ -1,37 +0,0 @@
|
||||
Index: eliom-5.0.0/src/lib/eliom_lib.client.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_lib.client.mli
|
||||
+++ eliom-5.0.0/src/lib/eliom_lib.client.mli
|
||||
@@ -43,7 +43,6 @@ type 'a shared_value = 'a
|
||||
|
||||
val create_shared_value : 'a -> 'a client_value -> 'a shared_value
|
||||
|
||||
-exception Eliom_Internal_Error of string
|
||||
|
||||
(** This exception is raised (in Lwt) on the client if a call to a
|
||||
server function {% <<a_api subproject="server"|val
|
||||
Index: eliom-5.0.0/src/lib/eliom_lib.server.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_lib.server.mli
|
||||
+++ eliom-5.0.0/src/lib/eliom_lib.server.mli
|
||||
@@ -50,7 +50,6 @@ type +'a shared_value
|
||||
*)
|
||||
exception Client_value_creation_invalid_context of string
|
||||
|
||||
-exception Eliom_Internal_Error of string
|
||||
|
||||
type file_info = Ocsigen_extensions.file_info
|
||||
|
||||
Index: eliom-5.0.0/src/syntax/pa_include.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/syntax/pa_include.ml
|
||||
+++ eliom-5.0.0/src/syntax/pa_include.ml
|
||||
@@ -27,7 +27,7 @@ module Make(Syntax : Camlp4.Sig.Camlp4Sy
|
||||
class subst_type env = object (self)
|
||||
inherit Ast.map as super
|
||||
method sig_item si = match si with
|
||||
- | Ast.SgTyp (_loc, (Ast.TyDcl (_, lid, _, Ast.TyNil _, _)))
|
||||
+ | Ast.SgTyp (_loc, rf, (Ast.TyDcl (_, lid, _, Ast.TyNil _, _)))
|
||||
when List.mem_assoc lid env -> <:sig_item< >>
|
||||
| si -> super#sig_item si
|
||||
method ctyp ty = match ty with
|
||||
@@ -1,500 +0,0 @@
|
||||
Index: eliom-5.0.0/src/lib/eliom_common.server.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_common.server.ml
|
||||
+++ eliom-5.0.0/src/lib/eliom_common.server.ml
|
||||
@@ -1372,7 +1372,7 @@ let create_persistent_table name =
|
||||
|
||||
let persistent_cookies_table :
|
||||
(full_state_name * float option * timeout * perssessgrp option)
|
||||
- Ocsipersist.table Lazy.t =
|
||||
+ Ocsipersist.table Lwt.t Lazy.t =
|
||||
lazy (create_persistent_table eliom_persistent_cookie_table)
|
||||
(* Another tables, containing the session info for each cookie *)
|
||||
(* the table contains:
|
||||
@@ -1390,7 +1390,7 @@ let persistent_cookies_table :
|
||||
let remove_from_all_persistent_tables key =
|
||||
Perstables.fold (* could be replaced by a parallel map *)
|
||||
(fun thr t -> thr >>= fun () ->
|
||||
- Ocsipersist.remove (Ocsipersist.open_table t) key >>= Lwt_unix.yield)
|
||||
+ Ocsipersist.open_table t >>= fun table -> Ocsipersist.remove table key >>= Lwt_unix.yield)
|
||||
(return ())
|
||||
!perstables
|
||||
|
||||
Index: eliom-5.0.0/src/lib/eliom_common.server.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_common.server.mli
|
||||
+++ eliom-5.0.0/src/lib/eliom_common.server.mli
|
||||
@@ -609,10 +609,10 @@ module Perstables :
|
||||
val fold : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
|
||||
end
|
||||
val perstables : string list ref
|
||||
-val create_persistent_table : string -> 'a Ocsipersist.table
|
||||
+val create_persistent_table : string -> 'a Ocsipersist.table Lwt.t
|
||||
val persistent_cookies_table :
|
||||
(full_state_name * float option * timeout * perssessgrp option)
|
||||
- Ocsipersist.table Lazy.t
|
||||
+ Ocsipersist.table Lwt.t Lazy.t
|
||||
val remove_from_all_persistent_tables : string -> unit Lwt.t
|
||||
val absolute_change_sitedata : sitedata -> unit
|
||||
val get_current_sitedata : unit -> sitedata
|
||||
Index: eliom-5.0.0/src/lib/eliom_reference.server.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_reference.server.ml
|
||||
+++ eliom-5.0.0/src/lib/eliom_reference.server.ml
|
||||
@@ -32,8 +32,8 @@ type 'a eref_kind =
|
||||
| Ref of 'a lazy_t ref (* Ocaml reference *)
|
||||
| Vol of 'a volatile_table Lazy.t (* Vol. table (group, session, process) *)
|
||||
| Ocsiper of 'a option Ocsipersist.t Lwt.t (* Global persist. table *)
|
||||
- | Ocsiper_sit of 'a Ocsipersist.table (* Persist. table for site *)
|
||||
- | Per of 'a persistent_table (* Persist. table for group session or process *)
|
||||
+ | Ocsiper_sit of 'a Ocsipersist.table Lwt.t (* Persist. table for site *)
|
||||
+ | Per of 'a persistent_table Lwt.t (* Persist. table for group session or process *)
|
||||
|
||||
type volatile = [ `Volatile ]
|
||||
type persistent = [ `Persistent ]
|
||||
@@ -174,9 +174,7 @@ let eref_from_fun_ ~ext ~scope ?secure ?
|
||||
| None -> (Volatile.eref_from_fun_ ~ext ~scope ?secure f :> _ eref)
|
||||
| Some name ->
|
||||
(f, ext,
|
||||
- Ocsiper (Ocsipersist.make_persistent
|
||||
- ~store:pers_ref_store
|
||||
- ~name ~default:None))
|
||||
+ Ocsiper (pers_ref_store >>= fun store -> Ocsipersist.make_persistent ~store ~name ~default:None))
|
||||
end
|
||||
| `Site ->
|
||||
begin
|
||||
@@ -207,6 +205,7 @@ let get_site_id () =
|
||||
let get (f, _, table as eref) =
|
||||
match table with
|
||||
| Per t ->
|
||||
+ t >>= fun t ->
|
||||
(get_persistent_data ~table:t () >>= function
|
||||
| Data d -> Lwt.return d
|
||||
| _ ->
|
||||
@@ -221,6 +220,7 @@ let get (f, _, table as eref) =
|
||||
Ocsipersist.set r (Some value) >>= fun () ->
|
||||
Lwt.return value)
|
||||
| Ocsiper_sit t ->
|
||||
+ t >>= fun t ->
|
||||
(let site_id = get_site_id () in
|
||||
try_lwt Ocsipersist.find t site_id
|
||||
with Not_found ->
|
||||
@@ -231,9 +231,10 @@ let get (f, _, table as eref) =
|
||||
|
||||
let set (_, _, table as eref) value =
|
||||
match table with
|
||||
- | Per t -> set_persistent_data ~table:t value
|
||||
+ | Per t -> t >>= fun t -> set_persistent_data ~table:t value
|
||||
| Ocsiper r -> r >>= fun r -> Ocsipersist.set r (Some value)
|
||||
| Ocsiper_sit t ->
|
||||
+ t >>= fun t ->
|
||||
Ocsipersist.add t (get_site_id ()) value
|
||||
| _ -> Lwt.return (Volatile.set eref value)
|
||||
|
||||
@@ -242,9 +243,10 @@ let modify eref f =
|
||||
|
||||
let unset (f, _, table as eref) =
|
||||
match table with
|
||||
- | Per t -> remove_persistent_data ~table:t ()
|
||||
+ | Per t -> t >>= fun t -> remove_persistent_data ~table:t ()
|
||||
| Ocsiper r -> r >>= fun r -> Ocsipersist.set r None
|
||||
| Ocsiper_sit t ->
|
||||
+ t >>= fun t ->
|
||||
Ocsipersist.remove t (get_site_id ())
|
||||
| _ -> Lwt.return (Volatile.unset eref)
|
||||
|
||||
@@ -258,6 +260,7 @@ module Ext = struct
|
||||
match table with
|
||||
| Vol _ -> Lwt.return (Volatile.Ext.get state r)
|
||||
| Per t ->
|
||||
+ t >>= fun t ->
|
||||
(Lwt.catch
|
||||
(fun () -> Eliom_state.Ext.Low_level.get_persistent_data
|
||||
~state ~table:t)
|
||||
@@ -279,6 +282,7 @@ module Ext = struct
|
||||
match table with
|
||||
| Vol _ -> Lwt.return (Volatile.Ext.set state r value)
|
||||
| Per t ->
|
||||
+ t >>= fun t ->
|
||||
Eliom_state.Ext.Low_level.set_persistent_data
|
||||
~state ~table:t value
|
||||
| _ -> Lwt.fail (Failure "wrong eref for this function")
|
||||
@@ -291,7 +295,7 @@ module Ext = struct
|
||||
let state = Eliom_state.Ext.untype_state state in
|
||||
match table with
|
||||
| Vol _ -> Lwt.return (Volatile.Ext.unset state r)
|
||||
- | Per t -> Eliom_state.Ext.Low_level.remove_persistent_data
|
||||
+ | Per t -> t >>= fun t -> Eliom_state.Ext.Low_level.remove_persistent_data
|
||||
~state ~table:t
|
||||
| _ -> failwith "wrong eref for this function"
|
||||
|
||||
Index: eliom-5.0.0/src/lib/eliom_state.server.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_state.server.ml
|
||||
+++ eliom-5.0.0/src/lib/eliom_state.server.ml
|
||||
@@ -918,11 +918,11 @@ type 'a persistent_table =
|
||||
bool *
|
||||
(int64 * 'a) Ocsipersist.table)
|
||||
|
||||
-let create_persistent_table ~scope ?secure name : 'a persistent_table =
|
||||
+let create_persistent_table ~scope ?secure name : 'a persistent_table Lwt.t =
|
||||
let sitedata = Eliom_request_info.find_sitedata "create_persistent_table" in
|
||||
let secure = Eliom_common.get_secure secure sitedata in
|
||||
- let t = Eliom_common.create_persistent_table name in
|
||||
- (scope, secure, t)
|
||||
+ Eliom_common.create_persistent_table name >>= fun t ->
|
||||
+ Lwt.return (scope, secure, t)
|
||||
|
||||
let get_p_table_key_
|
||||
~table:(scope, secure, table)
|
||||
@@ -1271,10 +1271,8 @@ module Ext = struct
|
||||
|
||||
let get_persistent_cookie_info
|
||||
((_, _, cookie) : ([< Eliom_common.cookie_level ], [ `Pers ]) state) =
|
||||
- Ocsipersist.find
|
||||
- (Lazy.force Eliommod_persess.persistent_cookies_table)
|
||||
- cookie
|
||||
- >>= fun v ->
|
||||
+ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table ->
|
||||
+ Ocsipersist.find table cookie >>= fun v ->
|
||||
Lwt.return (cookie, v)
|
||||
|
||||
let discard_state ~state =
|
||||
@@ -1487,10 +1485,8 @@ module Ext = struct
|
||||
| None -> TNone
|
||||
| Some t -> TSome t
|
||||
in
|
||||
- Ocsipersist.add
|
||||
- (Lazy.force Eliom_common.persistent_cookies_table)
|
||||
- cookie
|
||||
- (fullstname, exp, ti, sessgrp)
|
||||
+ Lazy.force Eliom_common.persistent_cookies_table >>= fun table ->
|
||||
+ Ocsipersist.add table cookie (fullstname, exp, ti, sessgrp)
|
||||
|
||||
let get_service_cookie_timeout ~cookie:(_, (_, _, _, r, _, _)) =
|
||||
!r
|
||||
@@ -1510,10 +1506,8 @@ module Ext = struct
|
||||
|
||||
let unset_persistent_data_cookie_timeout
|
||||
~cookie:(cookie, (fullstname, exp, _, sessgrp)) =
|
||||
- Ocsipersist.add
|
||||
- (Lazy.force Eliom_common.persistent_cookies_table)
|
||||
- cookie
|
||||
- (fullstname, exp, TGlobal, sessgrp)
|
||||
+ Lazy.force Eliom_common.persistent_cookies_table >>= fun table ->
|
||||
+ Ocsipersist.add table cookie (fullstname, exp, TGlobal, sessgrp)
|
||||
|
||||
|
||||
let get_session_group_list () =
|
||||
Index: eliom-5.0.0/src/lib/eliom_state.server.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_state.server.mli
|
||||
+++ eliom-5.0.0/src/lib/eliom_state.server.mli
|
||||
@@ -1019,7 +1019,7 @@ val remove_volatile_data :
|
||||
val create_persistent_table :
|
||||
scope:Eliom_common.user_scope ->
|
||||
?secure:bool ->
|
||||
- string -> 'a persistent_table
|
||||
+ string -> 'a persistent_table Lwt.t
|
||||
|
||||
(** gets persistent session data for the current persistent session (if any).
|
||||
(low level) *)
|
||||
Index: eliom-5.0.0/src/lib/server/eliommod_cookies.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/server/eliommod_cookies.ml
|
||||
+++ eliom-5.0.0/src/lib/server/eliommod_cookies.ml
|
||||
@@ -152,8 +152,7 @@ let get_cookie_info
|
||||
lazy
|
||||
(catch
|
||||
(fun () ->
|
||||
- Ocsipersist.find
|
||||
- (Lazy.force Eliom_common.persistent_cookies_table) value >>=
|
||||
+ Lazy.force Eliom_common.persistent_cookies_table >>= fun table -> Ocsipersist.find table value >>=
|
||||
fun (full_state_name, persexp, perstimeout, sessgrp) ->
|
||||
|
||||
Eliommod_sessiongroups.Pers.up value sessgrp >>= fun () ->
|
||||
Index: eliom-5.0.0/src/lib/server/eliommod_gc.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/server/eliommod_gc.ml
|
||||
+++ eliom-5.0.0/src/lib/server/eliommod_gc.ml
|
||||
@@ -309,7 +309,8 @@ let persistent_session_gc sitedata =
|
||||
(fun () ->
|
||||
let now = Unix.time () in
|
||||
Lwt_log.ign_info ~section "GC of persistent sessions";
|
||||
- (Ocsipersist.iter_table
|
||||
+ Lazy.force Eliommod_persess.persistent_cookies_table >>=
|
||||
+ Ocsipersist.iter_table
|
||||
(fun k ((scope, _, _), exp, _, session_group) ->
|
||||
(match exp with
|
||||
| Some exp when exp < now ->
|
||||
@@ -320,8 +321,7 @@ let persistent_session_gc sitedata =
|
||||
session_group k
|
||||
(*WAS: remove_from_all_persistent_tables k *)
|
||||
| _ -> return ())
|
||||
- )
|
||||
- (Lazy.force Eliommod_persess.persistent_cookies_table)))
|
||||
+ ))
|
||||
>>=
|
||||
f
|
||||
in ignore (f ())
|
||||
Index: eliom-5.0.0/src/lib/server/eliommod_pagegen.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/server/eliommod_pagegen.ml
|
||||
+++ eliom-5.0.0/src/lib/server/eliommod_pagegen.ml
|
||||
@@ -135,8 +135,9 @@ let update_cookie_table ?now sitedata (c
|
||||
oldv = newc.Eliom_common.pc_value ->
|
||||
catch
|
||||
(fun () ->
|
||||
+ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table ->
|
||||
Ocsipersist.replace_if_exists
|
||||
- (Lazy.force Eliommod_persess.persistent_cookies_table)
|
||||
+ table
|
||||
newc.Eliom_common.pc_value
|
||||
(name,
|
||||
newexp,
|
||||
@@ -147,8 +148,9 @@ let update_cookie_table ?now sitedata (c
|
||||
(* someone else closed the session *)
|
||||
| e -> fail e)
|
||||
| _ ->
|
||||
+ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table ->
|
||||
Ocsipersist.add
|
||||
- (Lazy.force Eliommod_persess.persistent_cookies_table)
|
||||
+ table
|
||||
newc.Eliom_common.pc_value
|
||||
(name,
|
||||
newexp,
|
||||
Index: eliom-5.0.0/src/lib/server/eliommod_persess.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/server/eliommod_persess.ml
|
||||
+++ eliom-5.0.0/src/lib/server/eliommod_persess.ml
|
||||
@@ -50,7 +50,7 @@ let number_of_persistent_table_elements
|
||||
List.fold_left
|
||||
(fun thr t ->
|
||||
thr >>= fun l ->
|
||||
- Ocsipersist.length (Ocsipersist.open_table t) >>= fun e ->
|
||||
+ Ocsipersist.open_table t >>= fun table -> Ocsipersist.length table >>= fun e ->
|
||||
return ((t, e)::l)) (return []) !perstables
|
||||
|
||||
let close_persistent_state2
|
||||
@@ -141,8 +141,7 @@ let rec find_or_create_persistent_cookie
|
||||
(* We do not need to verify if it already exists.
|
||||
make_new_session_id does never generate twice the same cookie. *)
|
||||
let usertimeout = ref Eliom_common.TGlobal (* See global table *) in
|
||||
- Ocsipersist.add
|
||||
- (Lazy.force persistent_cookies_table) c
|
||||
+ Lazy.force persistent_cookies_table >>= fun table -> Ocsipersist.add table c
|
||||
(full_st_name,
|
||||
None (* Some 0. *) (* exp on server - We'll change it later *),
|
||||
Eliom_common.TGlobal (* timeout - see global config *),
|
||||
Index: eliom-5.0.0/src/lib/server/eliommod_persess.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/server/eliommod_persess.mli
|
||||
+++ eliom-5.0.0/src/lib/server/eliommod_persess.mli
|
||||
@@ -22,7 +22,7 @@ val perstables : string list ref
|
||||
val persistent_cookies_table :
|
||||
(Eliom_common.full_state_name * float option * Eliom_common.timeout *
|
||||
Eliom_common.perssessgrp option)
|
||||
- Ocsipersist.table Lazy.t
|
||||
+ Ocsipersist.table Lwt.t Lazy.t
|
||||
val number_of_persistent_tables : unit -> int
|
||||
val number_of_persistent_table_elements : unit -> (string * int) list Lwt.t
|
||||
val close_persistent_state2 :
|
||||
Index: eliom-5.0.0/src/lib/server/eliommod_sessadmin.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/server/eliommod_sessadmin.ml
|
||||
+++ eliom-5.0.0/src/lib/server/eliommod_sessadmin.ml
|
||||
@@ -94,6 +94,7 @@ let close_all_data_states ~scope ~secure
|
||||
|
||||
|
||||
let close_all_persistent_states2 full_st_name sitedata =
|
||||
+ Lazy.force Eliommod_persess.persistent_cookies_table >>=
|
||||
Ocsipersist.iter_table
|
||||
(fun k ((scope, _, _) as full_st_name2, old_exp, old_t, sessiongrp) ->
|
||||
if full_st_name = full_st_name2 && old_t = Eliom_common.TGlobal
|
||||
@@ -102,7 +103,6 @@ let close_all_persistent_states2 full_st
|
||||
Lwt_unix.yield
|
||||
else return ()
|
||||
)
|
||||
- (Lazy.force Eliommod_persess.persistent_cookies_table)
|
||||
|
||||
(** Close all persistent sessions for one session name.
|
||||
If the optional parameter [?state_name] (session name) is not present,
|
||||
@@ -195,6 +195,7 @@ let update_pers_exp full_st_name sitedat
|
||||
close_all_persistent_states2 full_st_name sitedata
|
||||
| _ ->
|
||||
let now = Unix.time () in
|
||||
+ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table ->
|
||||
Ocsipersist.iter_table
|
||||
(fun k ((scope, _, _) as full_st_name2, old_exp, old_t, sessgrp) ->
|
||||
if full_st_name = full_st_name2 && old_t =
|
||||
@@ -211,11 +212,7 @@ let update_pers_exp full_st_name sitedat
|
||||
Eliommod_persess.close_persistent_state2
|
||||
~scope sitedata sessgrp k
|
||||
| _ ->
|
||||
- Ocsipersist.add
|
||||
- (Lazy.force Eliommod_persess.persistent_cookies_table)
|
||||
- k
|
||||
- (full_st_name2, newexp,
|
||||
- Eliom_common.TGlobal, sessgrp) >>= Lwt_unix.yield
|
||||
+ Ocsipersist.add table k (full_st_name2, newexp, Eliom_common.TGlobal, sessgrp) >>= Lwt_unix.yield
|
||||
else return ()
|
||||
)
|
||||
- (Lazy.force Eliommod_persess.persistent_cookies_table)
|
||||
+ table
|
||||
Index: eliom-5.0.0/src/lib/server/eliommod_sessexpl.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/server/eliommod_sessexpl.ml
|
||||
+++ eliom-5.0.0/src/lib/server/eliommod_sessexpl.ml
|
||||
@@ -57,12 +57,12 @@ let iter_data_cookies f =
|
||||
|
||||
(** Iterator on persistent cookies *)
|
||||
let iter_persistent_cookies f =
|
||||
+ Lazy.force Eliommod_persess.persistent_cookies_table >>=
|
||||
Ocsipersist.iter_table
|
||||
(fun k v ->
|
||||
f (k, v) >>=
|
||||
Lwt_unix.yield
|
||||
)
|
||||
- (Lazy.force Eliommod_persess.persistent_cookies_table)
|
||||
|
||||
|
||||
(** Iterator on service cookies *)
|
||||
@@ -94,13 +94,14 @@ let fold_data_cookies f beg =
|
||||
|
||||
(** Iterator on persistent cookies *)
|
||||
let fold_persistent_cookies f beg =
|
||||
+ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table ->
|
||||
Ocsipersist.fold_table
|
||||
(fun k v beg ->
|
||||
f (k, v) beg >>= fun res ->
|
||||
Lwt_unix.yield () >>= fun () ->
|
||||
return res
|
||||
)
|
||||
- (Lazy.force Eliommod_persess.persistent_cookies_table)
|
||||
+ table
|
||||
beg
|
||||
|
||||
(*****************************************************************************)
|
||||
@@ -121,4 +122,4 @@ let number_of_table_elements () =
|
||||
List.map (fun f -> f ()) !Eliommod_datasess.counttableelements
|
||||
|
||||
let number_of_persistent_cookies () =
|
||||
- Ocsipersist.length (Lazy.force Eliommod_persess.persistent_cookies_table)
|
||||
+ Lazy.force Eliommod_persess.persistent_cookies_table >>= Ocsipersist.length
|
||||
Index: eliom-5.0.0/src/lib/server/eliommod_sessiongroups.ml
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/server/eliommod_sessiongroups.ml
|
||||
+++ eliom-5.0.0/src/lib/server/eliommod_sessiongroups.ml
|
||||
@@ -413,7 +413,7 @@ module Pers = struct
|
||||
(*VVV Verify this carefully! *)
|
||||
(*VVV VEOcsigen_request_infoFY concurrent access *)
|
||||
|
||||
- let grouptable : (nbmax * string list) Ocsipersist.table Lazy.t =
|
||||
+ let grouptable : (nbmax * string list) Ocsipersist.table Lwt.t Lazy.t =
|
||||
lazy (Ocsipersist.open_table "__eliom_session_group_table")
|
||||
(* It is lazy because if the module is linked statically,
|
||||
the creation of the table must happen after initialisation
|
||||
@@ -426,7 +426,7 @@ module Pers = struct
|
||||
| Some g ->
|
||||
Lwt.catch
|
||||
(fun () ->
|
||||
- Ocsipersist.find !!grouptable
|
||||
+ !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable
|
||||
(Eliom_common.string_of_perssessgrp g) >>= fun (_, a) ->
|
||||
Lwt.return a)
|
||||
(function
|
||||
@@ -439,7 +439,7 @@ module Pers = struct
|
||||
let sg = Eliom_common.string_of_perssessgrp sg in
|
||||
Lwt.catch
|
||||
(fun () ->
|
||||
- Ocsipersist.find !!grouptable sg >>= fun (max2, cl) ->
|
||||
+ !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable sg >>= fun (max2, cl) ->
|
||||
let max, newmax = match set_max with
|
||||
| None -> ((match max2 with
|
||||
| Default -> defaultmax
|
||||
@@ -449,7 +449,7 @@ module Pers = struct
|
||||
| Some (Some v) -> Some v, Val v
|
||||
in
|
||||
let cl, toclose = cut max cl in
|
||||
- Ocsipersist.replace_if_exists !!grouptable sg (newmax, (sess_id::cl))
|
||||
+ Ocsipersist.replace_if_exists grouptable sg (newmax, (sess_id::cl))
|
||||
>>= fun () ->
|
||||
Lwt.return toclose)
|
||||
(function
|
||||
@@ -459,7 +459,7 @@ module Pers = struct
|
||||
| Some None -> Nolimit
|
||||
| Some (Some v) -> Val v
|
||||
in
|
||||
- Ocsipersist.add !!grouptable sg (max, [sess_id]) >>= fun () ->
|
||||
+ !!grouptable >>= fun grouptable -> Ocsipersist.add grouptable sg (max, [sess_id]) >>= fun () ->
|
||||
Lwt.return []
|
||||
| e -> Lwt.fail e)
|
||||
| None -> Lwt.return []
|
||||
@@ -502,8 +502,7 @@ module Pers = struct
|
||||
belonging to the group grp *)
|
||||
(* group_name is the cookie value *)
|
||||
remove sitedata group_name grp >>= fun () ->
|
||||
- Ocsipersist.remove
|
||||
- (!!Eliom_common.persistent_cookies_table) group_name
|
||||
+ !!Eliom_common.persistent_cookies_table >>= fun table -> Ocsipersist.remove table group_name
|
||||
| _ -> Lwt.return ())
|
||||
>>= fun () ->
|
||||
|
||||
@@ -511,7 +510,7 @@ module Pers = struct
|
||||
match sess_grp with
|
||||
| Some sg ->
|
||||
let sg = Eliom_common.string_of_perssessgrp sg in
|
||||
- Ocsipersist.remove !!grouptable sg
|
||||
+ !!grouptable >>= fun grouptable -> Ocsipersist.remove grouptable sg
|
||||
| None -> Lwt.return ()
|
||||
)
|
||||
(function Not_found -> Lwt.return () | e -> Lwt.fail e)
|
||||
@@ -526,7 +525,7 @@ module Pers = struct
|
||||
match cookie_level with
|
||||
| `Client_process -> begin
|
||||
(* We remove cookie info from the table *)
|
||||
- Ocsipersist.remove (!!Eliom_common.persistent_cookies_table) cookie
|
||||
+ !!Eliom_common.persistent_cookies_table >>= fun table -> Ocsipersist.remove table cookie
|
||||
>>= fun () ->
|
||||
|
||||
(* We remove the session from its group: *)
|
||||
@@ -555,7 +554,7 @@ module Pers = struct
|
||||
let sg = Eliom_common.string_of_perssessgrp sg0 in
|
||||
Lwt.catch
|
||||
(fun () ->
|
||||
- Ocsipersist.find !!grouptable sg >>= fun (max, cl) ->
|
||||
+ !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable sg >>= fun (max, cl) ->
|
||||
let newcl = List.remove_first_if_any sess_id cl in
|
||||
(match newcl with
|
||||
| [] ->
|
||||
@@ -570,8 +569,8 @@ module Pers = struct
|
||||
remove_group ~cookie_level:`Session sitedata sess_grp
|
||||
| _ -> Lwt.return ()
|
||||
) >>= fun () ->
|
||||
- Ocsipersist.remove !!grouptable sg
|
||||
- | _ -> Ocsipersist.replace_if_exists !!grouptable sg (max, newcl)
|
||||
+ Ocsipersist.remove grouptable sg
|
||||
+ | _ -> Ocsipersist.replace_if_exists grouptable sg (max, newcl)
|
||||
)
|
||||
)
|
||||
(function
|
||||
@@ -586,9 +585,9 @@ module Pers = struct
|
||||
let sg = Eliom_common.string_of_perssessgrp sg in
|
||||
Lwt.catch
|
||||
(fun () ->
|
||||
- Ocsipersist.find !!grouptable sg >>= fun (max, cl) ->
|
||||
+ !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable sg >>= fun (max, cl) ->
|
||||
let newcl = List.remove_first_if_any sess_id cl in
|
||||
- Ocsipersist.replace_if_exists !!grouptable sg (max, sess_id::newcl)
|
||||
+ Ocsipersist.replace_if_exists grouptable sg (max, sess_id::newcl)
|
||||
)
|
||||
(function
|
||||
| Not_found -> Lwt.return ()
|
||||
@@ -601,6 +600,6 @@ module Pers = struct
|
||||
end
|
||||
else Lwt.return []
|
||||
|
||||
- let nb_of_groups () = Ocsipersist.length !!grouptable
|
||||
+ let nb_of_groups () = !!grouptable >>= Ocsipersist.length
|
||||
|
||||
end
|
||||
@@ -1,44 +0,0 @@
|
||||
Index: eliom-5.0.0/src/lib/eliom_shared.eliom
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_shared.eliom
|
||||
+++ eliom-5.0.0/src/lib/eliom_shared.eliom
|
||||
@@ -288,7 +288,7 @@ module FakeReactiveData = struct
|
||||
val concat : 'a t -> 'a t -> 'a t
|
||||
val value : 'a t -> 'a list
|
||||
val synced : 'a t -> bool
|
||||
- val signal : 'a t -> 'a list FakeReact.S.t
|
||||
+ val signal : ?eq:('a -> 'a -> bool) -> 'a t -> 'a list FakeReact.S.t
|
||||
val singleton_s : 'a FakeReact.S.t -> 'a t
|
||||
val map : ('a -> 'b) -> 'a t -> 'b t
|
||||
val from_signal :
|
||||
@@ -304,7 +304,7 @@ 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 (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)
|
||||
module Lwt = struct
|
||||
@@ -635,7 +635,7 @@ module ReactiveData = struct
|
||||
let value (s : 'a t) = {shared# 'a list {
|
||||
FakeReactiveData.RList.value (Value.local %s) }}
|
||||
|
||||
- let signal (s : 'a t) = {shared# 'a list FakeReact.S.t {
|
||||
+ let signal ?eq (s : 'a t) = {shared# 'a list FakeReact.S.t {
|
||||
FakeReactiveData.RList.signal (Value.local %s) }}
|
||||
|
||||
let map f s = {shared# 'a FakeReactiveData.RList.t {
|
||||
Index: eliom-5.0.0/src/lib/eliom_shared_sigs.shared.mli
|
||||
===================================================================
|
||||
--- eliom-5.0.0.orig/src/lib/eliom_shared_sigs.shared.mli
|
||||
+++ eliom-5.0.0/src/lib/eliom_shared_sigs.shared.mli
|
||||
@@ -143,7 +143,7 @@ module type RLIST = sig
|
||||
|
||||
val concat : 'a t -> 'a t -> 'a t
|
||||
val value : 'a t -> 'a list Eliom_lib.shared_value
|
||||
- val signal : 'a t -> 'a list signal
|
||||
+ val signal : ?eq:(('a -> 'a -> bool)) -> 'a t -> 'a list signal
|
||||
val singleton_s : 'a signal -> 'a t
|
||||
val map : ('a -> 'b) Eliom_lib.shared_value -> 'a t -> 'b t
|
||||
val from_signal :
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user