1 |
commit: 3259962977f7ec30f0803a904e748ce67f2638ab |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 28 21:17:07 2016 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 28 21:17:17 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32599629 |
7 |
|
8 |
dev-ml/eliom: fix build with reactivedata 0.2.1 and ocsigenserver 2.8; bug #601102 |
9 |
|
10 |
Package-Manager: portage-2.3.2 |
11 |
|
12 |
dev-ml/eliom/eliom-5.0.0-r2.ebuild | 8 +- |
13 |
dev-ml/eliom/eliom-9999.ebuild | 4 +- |
14 |
dev-ml/eliom/files/ocsigen28.patch | 500 ++++++++++++++++++++++++++++++++++ |
15 |
dev-ml/eliom/files/reactivedata.patch | 44 +++ |
16 |
4 files changed, 551 insertions(+), 5 deletions(-) |
17 |
|
18 |
diff --git a/dev-ml/eliom/eliom-5.0.0-r2.ebuild b/dev-ml/eliom/eliom-5.0.0-r2.ebuild |
19 |
index 6b4ae4b..0807fa3 100644 |
20 |
--- a/dev-ml/eliom/eliom-5.0.0-r2.ebuild |
21 |
+++ b/dev-ml/eliom/eliom-5.0.0-r2.ebuild |
22 |
@@ -17,10 +17,10 @@ IUSE="doc +ocamlopt +ppx" |
23 |
|
24 |
RDEPEND=">=dev-lang/ocaml-4.03:=[ocamlopt?] |
25 |
>=dev-ml/js_of_ocaml-2.8.2:= |
26 |
- >=www-servers/ocsigenserver-2.5:= |
27 |
+ >=www-servers/ocsigenserver-2.8:= |
28 |
>=dev-ml/tyxml-4:= |
29 |
>=dev-ml/deriving-0.6:= |
30 |
- >=dev-ml/reactiveData-0.2:= |
31 |
+ >=dev-ml/reactiveData-0.2.1:= |
32 |
dev-ml/ocaml-ipaddr:= |
33 |
dev-ml/react:= |
34 |
dev-ml/ocaml-ssl:= |
35 |
@@ -35,7 +35,9 @@ DEPEND="${RDEPEND} |
36 |
src_prepare() { |
37 |
epatch "${FILESDIR}/"{camlp4,oc43,oc43-2}.patch \ |
38 |
"${FILESDIR}/tyxml4.patch" \ |
39 |
- "${FILESDIR}/jsofocaml-282.patch" |
40 |
+ "${FILESDIR}/jsofocaml-282.patch" \ |
41 |
+ "${FILESDIR}/reactivedata.patch" \ |
42 |
+ "${FILESDIR}/ocsigen28.patch" |
43 |
} |
44 |
|
45 |
src_compile() { |
46 |
|
47 |
diff --git a/dev-ml/eliom/eliom-9999.ebuild b/dev-ml/eliom/eliom-9999.ebuild |
48 |
index f408965..bc9355f 100644 |
49 |
--- a/dev-ml/eliom/eliom-9999.ebuild |
50 |
+++ b/dev-ml/eliom/eliom-9999.ebuild |
51 |
@@ -25,10 +25,10 @@ IUSE="doc +ocamlopt +ppx" |
52 |
|
53 |
RDEPEND=">=dev-lang/ocaml-4.03:=[ocamlopt?] |
54 |
>=dev-ml/js_of_ocaml-2.5-r1:= |
55 |
- >=www-servers/ocsigenserver-2.5:= |
56 |
+ >=www-servers/ocsigenserver-2.8:= |
57 |
>=dev-ml/tyxml-4:= |
58 |
>=dev-ml/deriving-0.6:= |
59 |
- >=dev-ml/reactiveData-0.2:= |
60 |
+ >=dev-ml/reactiveData-0.2.1:= |
61 |
dev-ml/ocaml-ipaddr:= |
62 |
dev-ml/react:= |
63 |
dev-ml/ocaml-ssl:= |
64 |
|
65 |
diff --git a/dev-ml/eliom/files/ocsigen28.patch b/dev-ml/eliom/files/ocsigen28.patch |
66 |
new file mode 100644 |
67 |
index 00000000..fb3ef0a |
68 |
--- /dev/null |
69 |
+++ b/dev-ml/eliom/files/ocsigen28.patch |
70 |
@@ -0,0 +1,500 @@ |
71 |
+Index: eliom-5.0.0/src/lib/eliom_common.server.ml |
72 |
+=================================================================== |
73 |
+--- eliom-5.0.0.orig/src/lib/eliom_common.server.ml |
74 |
++++ eliom-5.0.0/src/lib/eliom_common.server.ml |
75 |
+@@ -1372,7 +1372,7 @@ let create_persistent_table name = |
76 |
+ |
77 |
+ let persistent_cookies_table : |
78 |
+ (full_state_name * float option * timeout * perssessgrp option) |
79 |
+- Ocsipersist.table Lazy.t = |
80 |
++ Ocsipersist.table Lwt.t Lazy.t = |
81 |
+ lazy (create_persistent_table eliom_persistent_cookie_table) |
82 |
+ (* Another tables, containing the session info for each cookie *) |
83 |
+ (* the table contains: |
84 |
+@@ -1390,7 +1390,7 @@ let persistent_cookies_table : |
85 |
+ let remove_from_all_persistent_tables key = |
86 |
+ Perstables.fold (* could be replaced by a parallel map *) |
87 |
+ (fun thr t -> thr >>= fun () -> |
88 |
+- Ocsipersist.remove (Ocsipersist.open_table t) key >>= Lwt_unix.yield) |
89 |
++ Ocsipersist.open_table t >>= fun table -> Ocsipersist.remove table key >>= Lwt_unix.yield) |
90 |
+ (return ()) |
91 |
+ !perstables |
92 |
+ |
93 |
+Index: eliom-5.0.0/src/lib/eliom_common.server.mli |
94 |
+=================================================================== |
95 |
+--- eliom-5.0.0.orig/src/lib/eliom_common.server.mli |
96 |
++++ eliom-5.0.0/src/lib/eliom_common.server.mli |
97 |
+@@ -609,10 +609,10 @@ module Perstables : |
98 |
+ val fold : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a |
99 |
+ end |
100 |
+ val perstables : string list ref |
101 |
+-val create_persistent_table : string -> 'a Ocsipersist.table |
102 |
++val create_persistent_table : string -> 'a Ocsipersist.table Lwt.t |
103 |
+ val persistent_cookies_table : |
104 |
+ (full_state_name * float option * timeout * perssessgrp option) |
105 |
+- Ocsipersist.table Lazy.t |
106 |
++ Ocsipersist.table Lwt.t Lazy.t |
107 |
+ val remove_from_all_persistent_tables : string -> unit Lwt.t |
108 |
+ val absolute_change_sitedata : sitedata -> unit |
109 |
+ val get_current_sitedata : unit -> sitedata |
110 |
+Index: eliom-5.0.0/src/lib/eliom_reference.server.ml |
111 |
+=================================================================== |
112 |
+--- eliom-5.0.0.orig/src/lib/eliom_reference.server.ml |
113 |
++++ eliom-5.0.0/src/lib/eliom_reference.server.ml |
114 |
+@@ -32,8 +32,8 @@ type 'a eref_kind = |
115 |
+ | Ref of 'a lazy_t ref (* Ocaml reference *) |
116 |
+ | Vol of 'a volatile_table Lazy.t (* Vol. table (group, session, process) *) |
117 |
+ | Ocsiper of 'a option Ocsipersist.t Lwt.t (* Global persist. table *) |
118 |
+- | Ocsiper_sit of 'a Ocsipersist.table (* Persist. table for site *) |
119 |
+- | Per of 'a persistent_table (* Persist. table for group session or process *) |
120 |
++ | Ocsiper_sit of 'a Ocsipersist.table Lwt.t (* Persist. table for site *) |
121 |
++ | Per of 'a persistent_table Lwt.t (* Persist. table for group session or process *) |
122 |
+ |
123 |
+ type volatile = [ `Volatile ] |
124 |
+ type persistent = [ `Persistent ] |
125 |
+@@ -174,9 +174,7 @@ let eref_from_fun_ ~ext ~scope ?secure ? |
126 |
+ | None -> (Volatile.eref_from_fun_ ~ext ~scope ?secure f :> _ eref) |
127 |
+ | Some name -> |
128 |
+ (f, ext, |
129 |
+- Ocsiper (Ocsipersist.make_persistent |
130 |
+- ~store:pers_ref_store |
131 |
+- ~name ~default:None)) |
132 |
++ Ocsiper (pers_ref_store >>= fun store -> Ocsipersist.make_persistent ~store ~name ~default:None)) |
133 |
+ end |
134 |
+ | `Site -> |
135 |
+ begin |
136 |
+@@ -207,6 +205,7 @@ let get_site_id () = |
137 |
+ let get (f, _, table as eref) = |
138 |
+ match table with |
139 |
+ | Per t -> |
140 |
++ t >>= fun t -> |
141 |
+ (get_persistent_data ~table:t () >>= function |
142 |
+ | Data d -> Lwt.return d |
143 |
+ | _ -> |
144 |
+@@ -221,6 +220,7 @@ let get (f, _, table as eref) = |
145 |
+ Ocsipersist.set r (Some value) >>= fun () -> |
146 |
+ Lwt.return value) |
147 |
+ | Ocsiper_sit t -> |
148 |
++ t >>= fun t -> |
149 |
+ (let site_id = get_site_id () in |
150 |
+ try_lwt Ocsipersist.find t site_id |
151 |
+ with Not_found -> |
152 |
+@@ -231,9 +231,10 @@ let get (f, _, table as eref) = |
153 |
+ |
154 |
+ let set (_, _, table as eref) value = |
155 |
+ match table with |
156 |
+- | Per t -> set_persistent_data ~table:t value |
157 |
++ | Per t -> t >>= fun t -> set_persistent_data ~table:t value |
158 |
+ | Ocsiper r -> r >>= fun r -> Ocsipersist.set r (Some value) |
159 |
+ | Ocsiper_sit t -> |
160 |
++ t >>= fun t -> |
161 |
+ Ocsipersist.add t (get_site_id ()) value |
162 |
+ | _ -> Lwt.return (Volatile.set eref value) |
163 |
+ |
164 |
+@@ -242,9 +243,10 @@ let modify eref f = |
165 |
+ |
166 |
+ let unset (f, _, table as eref) = |
167 |
+ match table with |
168 |
+- | Per t -> remove_persistent_data ~table:t () |
169 |
++ | Per t -> t >>= fun t -> remove_persistent_data ~table:t () |
170 |
+ | Ocsiper r -> r >>= fun r -> Ocsipersist.set r None |
171 |
+ | Ocsiper_sit t -> |
172 |
++ t >>= fun t -> |
173 |
+ Ocsipersist.remove t (get_site_id ()) |
174 |
+ | _ -> Lwt.return (Volatile.unset eref) |
175 |
+ |
176 |
+@@ -258,6 +260,7 @@ module Ext = struct |
177 |
+ match table with |
178 |
+ | Vol _ -> Lwt.return (Volatile.Ext.get state r) |
179 |
+ | Per t -> |
180 |
++ t >>= fun t -> |
181 |
+ (Lwt.catch |
182 |
+ (fun () -> Eliom_state.Ext.Low_level.get_persistent_data |
183 |
+ ~state ~table:t) |
184 |
+@@ -279,6 +282,7 @@ module Ext = struct |
185 |
+ match table with |
186 |
+ | Vol _ -> Lwt.return (Volatile.Ext.set state r value) |
187 |
+ | Per t -> |
188 |
++ t >>= fun t -> |
189 |
+ Eliom_state.Ext.Low_level.set_persistent_data |
190 |
+ ~state ~table:t value |
191 |
+ | _ -> Lwt.fail (Failure "wrong eref for this function") |
192 |
+@@ -291,7 +295,7 @@ module Ext = struct |
193 |
+ let state = Eliom_state.Ext.untype_state state in |
194 |
+ match table with |
195 |
+ | Vol _ -> Lwt.return (Volatile.Ext.unset state r) |
196 |
+- | Per t -> Eliom_state.Ext.Low_level.remove_persistent_data |
197 |
++ | Per t -> t >>= fun t -> Eliom_state.Ext.Low_level.remove_persistent_data |
198 |
+ ~state ~table:t |
199 |
+ | _ -> failwith "wrong eref for this function" |
200 |
+ |
201 |
+Index: eliom-5.0.0/src/lib/eliom_state.server.ml |
202 |
+=================================================================== |
203 |
+--- eliom-5.0.0.orig/src/lib/eliom_state.server.ml |
204 |
++++ eliom-5.0.0/src/lib/eliom_state.server.ml |
205 |
+@@ -918,11 +918,11 @@ type 'a persistent_table = |
206 |
+ bool * |
207 |
+ (int64 * 'a) Ocsipersist.table) |
208 |
+ |
209 |
+-let create_persistent_table ~scope ?secure name : 'a persistent_table = |
210 |
++let create_persistent_table ~scope ?secure name : 'a persistent_table Lwt.t = |
211 |
+ let sitedata = Eliom_request_info.find_sitedata "create_persistent_table" in |
212 |
+ let secure = Eliom_common.get_secure secure sitedata in |
213 |
+- let t = Eliom_common.create_persistent_table name in |
214 |
+- (scope, secure, t) |
215 |
++ Eliom_common.create_persistent_table name >>= fun t -> |
216 |
++ Lwt.return (scope, secure, t) |
217 |
+ |
218 |
+ let get_p_table_key_ |
219 |
+ ~table:(scope, secure, table) |
220 |
+@@ -1271,10 +1271,8 @@ module Ext = struct |
221 |
+ |
222 |
+ let get_persistent_cookie_info |
223 |
+ ((_, _, cookie) : ([< Eliom_common.cookie_level ], [ `Pers ]) state) = |
224 |
+- Ocsipersist.find |
225 |
+- (Lazy.force Eliommod_persess.persistent_cookies_table) |
226 |
+- cookie |
227 |
+- >>= fun v -> |
228 |
++ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table -> |
229 |
++ Ocsipersist.find table cookie >>= fun v -> |
230 |
+ Lwt.return (cookie, v) |
231 |
+ |
232 |
+ let discard_state ~state = |
233 |
+@@ -1487,10 +1485,8 @@ module Ext = struct |
234 |
+ | None -> TNone |
235 |
+ | Some t -> TSome t |
236 |
+ in |
237 |
+- Ocsipersist.add |
238 |
+- (Lazy.force Eliom_common.persistent_cookies_table) |
239 |
+- cookie |
240 |
+- (fullstname, exp, ti, sessgrp) |
241 |
++ Lazy.force Eliom_common.persistent_cookies_table >>= fun table -> |
242 |
++ Ocsipersist.add table cookie (fullstname, exp, ti, sessgrp) |
243 |
+ |
244 |
+ let get_service_cookie_timeout ~cookie:(_, (_, _, _, r, _, _)) = |
245 |
+ !r |
246 |
+@@ -1510,10 +1506,8 @@ module Ext = struct |
247 |
+ |
248 |
+ let unset_persistent_data_cookie_timeout |
249 |
+ ~cookie:(cookie, (fullstname, exp, _, sessgrp)) = |
250 |
+- Ocsipersist.add |
251 |
+- (Lazy.force Eliom_common.persistent_cookies_table) |
252 |
+- cookie |
253 |
+- (fullstname, exp, TGlobal, sessgrp) |
254 |
++ Lazy.force Eliom_common.persistent_cookies_table >>= fun table -> |
255 |
++ Ocsipersist.add table cookie (fullstname, exp, TGlobal, sessgrp) |
256 |
+ |
257 |
+ |
258 |
+ let get_session_group_list () = |
259 |
+Index: eliom-5.0.0/src/lib/eliom_state.server.mli |
260 |
+=================================================================== |
261 |
+--- eliom-5.0.0.orig/src/lib/eliom_state.server.mli |
262 |
++++ eliom-5.0.0/src/lib/eliom_state.server.mli |
263 |
+@@ -1019,7 +1019,7 @@ val remove_volatile_data : |
264 |
+ val create_persistent_table : |
265 |
+ scope:Eliom_common.user_scope -> |
266 |
+ ?secure:bool -> |
267 |
+- string -> 'a persistent_table |
268 |
++ string -> 'a persistent_table Lwt.t |
269 |
+ |
270 |
+ (** gets persistent session data for the current persistent session (if any). |
271 |
+ (low level) *) |
272 |
+Index: eliom-5.0.0/src/lib/server/eliommod_cookies.ml |
273 |
+=================================================================== |
274 |
+--- eliom-5.0.0.orig/src/lib/server/eliommod_cookies.ml |
275 |
++++ eliom-5.0.0/src/lib/server/eliommod_cookies.ml |
276 |
+@@ -152,8 +152,7 @@ let get_cookie_info |
277 |
+ lazy |
278 |
+ (catch |
279 |
+ (fun () -> |
280 |
+- Ocsipersist.find |
281 |
+- (Lazy.force Eliom_common.persistent_cookies_table) value >>= |
282 |
++ Lazy.force Eliom_common.persistent_cookies_table >>= fun table -> Ocsipersist.find table value >>= |
283 |
+ fun (full_state_name, persexp, perstimeout, sessgrp) -> |
284 |
+ |
285 |
+ Eliommod_sessiongroups.Pers.up value sessgrp >>= fun () -> |
286 |
+Index: eliom-5.0.0/src/lib/server/eliommod_gc.ml |
287 |
+=================================================================== |
288 |
+--- eliom-5.0.0.orig/src/lib/server/eliommod_gc.ml |
289 |
++++ eliom-5.0.0/src/lib/server/eliommod_gc.ml |
290 |
+@@ -309,7 +309,8 @@ let persistent_session_gc sitedata = |
291 |
+ (fun () -> |
292 |
+ let now = Unix.time () in |
293 |
+ Lwt_log.ign_info ~section "GC of persistent sessions"; |
294 |
+- (Ocsipersist.iter_table |
295 |
++ Lazy.force Eliommod_persess.persistent_cookies_table >>= |
296 |
++ Ocsipersist.iter_table |
297 |
+ (fun k ((scope, _, _), exp, _, session_group) -> |
298 |
+ (match exp with |
299 |
+ | Some exp when exp < now -> |
300 |
+@@ -320,8 +321,7 @@ let persistent_session_gc sitedata = |
301 |
+ session_group k |
302 |
+ (*WAS: remove_from_all_persistent_tables k *) |
303 |
+ | _ -> return ()) |
304 |
+- ) |
305 |
+- (Lazy.force Eliommod_persess.persistent_cookies_table))) |
306 |
++ )) |
307 |
+ >>= |
308 |
+ f |
309 |
+ in ignore (f ()) |
310 |
+Index: eliom-5.0.0/src/lib/server/eliommod_pagegen.ml |
311 |
+=================================================================== |
312 |
+--- eliom-5.0.0.orig/src/lib/server/eliommod_pagegen.ml |
313 |
++++ eliom-5.0.0/src/lib/server/eliommod_pagegen.ml |
314 |
+@@ -135,8 +135,9 @@ let update_cookie_table ?now sitedata (c |
315 |
+ oldv = newc.Eliom_common.pc_value -> |
316 |
+ catch |
317 |
+ (fun () -> |
318 |
++ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table -> |
319 |
+ Ocsipersist.replace_if_exists |
320 |
+- (Lazy.force Eliommod_persess.persistent_cookies_table) |
321 |
++ table |
322 |
+ newc.Eliom_common.pc_value |
323 |
+ (name, |
324 |
+ newexp, |
325 |
+@@ -147,8 +148,9 @@ let update_cookie_table ?now sitedata (c |
326 |
+ (* someone else closed the session *) |
327 |
+ | e -> fail e) |
328 |
+ | _ -> |
329 |
++ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table -> |
330 |
+ Ocsipersist.add |
331 |
+- (Lazy.force Eliommod_persess.persistent_cookies_table) |
332 |
++ table |
333 |
+ newc.Eliom_common.pc_value |
334 |
+ (name, |
335 |
+ newexp, |
336 |
+Index: eliom-5.0.0/src/lib/server/eliommod_persess.ml |
337 |
+=================================================================== |
338 |
+--- eliom-5.0.0.orig/src/lib/server/eliommod_persess.ml |
339 |
++++ eliom-5.0.0/src/lib/server/eliommod_persess.ml |
340 |
+@@ -50,7 +50,7 @@ let number_of_persistent_table_elements |
341 |
+ List.fold_left |
342 |
+ (fun thr t -> |
343 |
+ thr >>= fun l -> |
344 |
+- Ocsipersist.length (Ocsipersist.open_table t) >>= fun e -> |
345 |
++ Ocsipersist.open_table t >>= fun table -> Ocsipersist.length table >>= fun e -> |
346 |
+ return ((t, e)::l)) (return []) !perstables |
347 |
+ |
348 |
+ let close_persistent_state2 |
349 |
+@@ -141,8 +141,7 @@ let rec find_or_create_persistent_cookie |
350 |
+ (* We do not need to verify if it already exists. |
351 |
+ make_new_session_id does never generate twice the same cookie. *) |
352 |
+ let usertimeout = ref Eliom_common.TGlobal (* See global table *) in |
353 |
+- Ocsipersist.add |
354 |
+- (Lazy.force persistent_cookies_table) c |
355 |
++ Lazy.force persistent_cookies_table >>= fun table -> Ocsipersist.add table c |
356 |
+ (full_st_name, |
357 |
+ None (* Some 0. *) (* exp on server - We'll change it later *), |
358 |
+ Eliom_common.TGlobal (* timeout - see global config *), |
359 |
+Index: eliom-5.0.0/src/lib/server/eliommod_persess.mli |
360 |
+=================================================================== |
361 |
+--- eliom-5.0.0.orig/src/lib/server/eliommod_persess.mli |
362 |
++++ eliom-5.0.0/src/lib/server/eliommod_persess.mli |
363 |
+@@ -22,7 +22,7 @@ val perstables : string list ref |
364 |
+ val persistent_cookies_table : |
365 |
+ (Eliom_common.full_state_name * float option * Eliom_common.timeout * |
366 |
+ Eliom_common.perssessgrp option) |
367 |
+- Ocsipersist.table Lazy.t |
368 |
++ Ocsipersist.table Lwt.t Lazy.t |
369 |
+ val number_of_persistent_tables : unit -> int |
370 |
+ val number_of_persistent_table_elements : unit -> (string * int) list Lwt.t |
371 |
+ val close_persistent_state2 : |
372 |
+Index: eliom-5.0.0/src/lib/server/eliommod_sessadmin.ml |
373 |
+=================================================================== |
374 |
+--- eliom-5.0.0.orig/src/lib/server/eliommod_sessadmin.ml |
375 |
++++ eliom-5.0.0/src/lib/server/eliommod_sessadmin.ml |
376 |
+@@ -94,6 +94,7 @@ let close_all_data_states ~scope ~secure |
377 |
+ |
378 |
+ |
379 |
+ let close_all_persistent_states2 full_st_name sitedata = |
380 |
++ Lazy.force Eliommod_persess.persistent_cookies_table >>= |
381 |
+ Ocsipersist.iter_table |
382 |
+ (fun k ((scope, _, _) as full_st_name2, old_exp, old_t, sessiongrp) -> |
383 |
+ if full_st_name = full_st_name2 && old_t = Eliom_common.TGlobal |
384 |
+@@ -102,7 +103,6 @@ let close_all_persistent_states2 full_st |
385 |
+ Lwt_unix.yield |
386 |
+ else return () |
387 |
+ ) |
388 |
+- (Lazy.force Eliommod_persess.persistent_cookies_table) |
389 |
+ |
390 |
+ (** Close all persistent sessions for one session name. |
391 |
+ If the optional parameter [?state_name] (session name) is not present, |
392 |
+@@ -195,6 +195,7 @@ let update_pers_exp full_st_name sitedat |
393 |
+ close_all_persistent_states2 full_st_name sitedata |
394 |
+ | _ -> |
395 |
+ let now = Unix.time () in |
396 |
++ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table -> |
397 |
+ Ocsipersist.iter_table |
398 |
+ (fun k ((scope, _, _) as full_st_name2, old_exp, old_t, sessgrp) -> |
399 |
+ if full_st_name = full_st_name2 && old_t = |
400 |
+@@ -211,11 +212,7 @@ let update_pers_exp full_st_name sitedat |
401 |
+ Eliommod_persess.close_persistent_state2 |
402 |
+ ~scope sitedata sessgrp k |
403 |
+ | _ -> |
404 |
+- Ocsipersist.add |
405 |
+- (Lazy.force Eliommod_persess.persistent_cookies_table) |
406 |
+- k |
407 |
+- (full_st_name2, newexp, |
408 |
+- Eliom_common.TGlobal, sessgrp) >>= Lwt_unix.yield |
409 |
++ Ocsipersist.add table k (full_st_name2, newexp, Eliom_common.TGlobal, sessgrp) >>= Lwt_unix.yield |
410 |
+ else return () |
411 |
+ ) |
412 |
+- (Lazy.force Eliommod_persess.persistent_cookies_table) |
413 |
++ table |
414 |
+Index: eliom-5.0.0/src/lib/server/eliommod_sessexpl.ml |
415 |
+=================================================================== |
416 |
+--- eliom-5.0.0.orig/src/lib/server/eliommod_sessexpl.ml |
417 |
++++ eliom-5.0.0/src/lib/server/eliommod_sessexpl.ml |
418 |
+@@ -57,12 +57,12 @@ let iter_data_cookies f = |
419 |
+ |
420 |
+ (** Iterator on persistent cookies *) |
421 |
+ let iter_persistent_cookies f = |
422 |
++ Lazy.force Eliommod_persess.persistent_cookies_table >>= |
423 |
+ Ocsipersist.iter_table |
424 |
+ (fun k v -> |
425 |
+ f (k, v) >>= |
426 |
+ Lwt_unix.yield |
427 |
+ ) |
428 |
+- (Lazy.force Eliommod_persess.persistent_cookies_table) |
429 |
+ |
430 |
+ |
431 |
+ (** Iterator on service cookies *) |
432 |
+@@ -94,13 +94,14 @@ let fold_data_cookies f beg = |
433 |
+ |
434 |
+ (** Iterator on persistent cookies *) |
435 |
+ let fold_persistent_cookies f beg = |
436 |
++ Lazy.force Eliommod_persess.persistent_cookies_table >>= fun table -> |
437 |
+ Ocsipersist.fold_table |
438 |
+ (fun k v beg -> |
439 |
+ f (k, v) beg >>= fun res -> |
440 |
+ Lwt_unix.yield () >>= fun () -> |
441 |
+ return res |
442 |
+ ) |
443 |
+- (Lazy.force Eliommod_persess.persistent_cookies_table) |
444 |
++ table |
445 |
+ beg |
446 |
+ |
447 |
+ (*****************************************************************************) |
448 |
+@@ -121,4 +122,4 @@ let number_of_table_elements () = |
449 |
+ List.map (fun f -> f ()) !Eliommod_datasess.counttableelements |
450 |
+ |
451 |
+ let number_of_persistent_cookies () = |
452 |
+- Ocsipersist.length (Lazy.force Eliommod_persess.persistent_cookies_table) |
453 |
++ Lazy.force Eliommod_persess.persistent_cookies_table >>= Ocsipersist.length |
454 |
+Index: eliom-5.0.0/src/lib/server/eliommod_sessiongroups.ml |
455 |
+=================================================================== |
456 |
+--- eliom-5.0.0.orig/src/lib/server/eliommod_sessiongroups.ml |
457 |
++++ eliom-5.0.0/src/lib/server/eliommod_sessiongroups.ml |
458 |
+@@ -413,7 +413,7 @@ module Pers = struct |
459 |
+ (*VVV Verify this carefully! *) |
460 |
+ (*VVV VEOcsigen_request_infoFY concurrent access *) |
461 |
+ |
462 |
+- let grouptable : (nbmax * string list) Ocsipersist.table Lazy.t = |
463 |
++ let grouptable : (nbmax * string list) Ocsipersist.table Lwt.t Lazy.t = |
464 |
+ lazy (Ocsipersist.open_table "__eliom_session_group_table") |
465 |
+ (* It is lazy because if the module is linked statically, |
466 |
+ the creation of the table must happen after initialisation |
467 |
+@@ -426,7 +426,7 @@ module Pers = struct |
468 |
+ | Some g -> |
469 |
+ Lwt.catch |
470 |
+ (fun () -> |
471 |
+- Ocsipersist.find !!grouptable |
472 |
++ !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable |
473 |
+ (Eliom_common.string_of_perssessgrp g) >>= fun (_, a) -> |
474 |
+ Lwt.return a) |
475 |
+ (function |
476 |
+@@ -439,7 +439,7 @@ module Pers = struct |
477 |
+ let sg = Eliom_common.string_of_perssessgrp sg in |
478 |
+ Lwt.catch |
479 |
+ (fun () -> |
480 |
+- Ocsipersist.find !!grouptable sg >>= fun (max2, cl) -> |
481 |
++ !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable sg >>= fun (max2, cl) -> |
482 |
+ let max, newmax = match set_max with |
483 |
+ | None -> ((match max2 with |
484 |
+ | Default -> defaultmax |
485 |
+@@ -449,7 +449,7 @@ module Pers = struct |
486 |
+ | Some (Some v) -> Some v, Val v |
487 |
+ in |
488 |
+ let cl, toclose = cut max cl in |
489 |
+- Ocsipersist.replace_if_exists !!grouptable sg (newmax, (sess_id::cl)) |
490 |
++ Ocsipersist.replace_if_exists grouptable sg (newmax, (sess_id::cl)) |
491 |
+ >>= fun () -> |
492 |
+ Lwt.return toclose) |
493 |
+ (function |
494 |
+@@ -459,7 +459,7 @@ module Pers = struct |
495 |
+ | Some None -> Nolimit |
496 |
+ | Some (Some v) -> Val v |
497 |
+ in |
498 |
+- Ocsipersist.add !!grouptable sg (max, [sess_id]) >>= fun () -> |
499 |
++ !!grouptable >>= fun grouptable -> Ocsipersist.add grouptable sg (max, [sess_id]) >>= fun () -> |
500 |
+ Lwt.return [] |
501 |
+ | e -> Lwt.fail e) |
502 |
+ | None -> Lwt.return [] |
503 |
+@@ -502,8 +502,7 @@ module Pers = struct |
504 |
+ belonging to the group grp *) |
505 |
+ (* group_name is the cookie value *) |
506 |
+ remove sitedata group_name grp >>= fun () -> |
507 |
+- Ocsipersist.remove |
508 |
+- (!!Eliom_common.persistent_cookies_table) group_name |
509 |
++ !!Eliom_common.persistent_cookies_table >>= fun table -> Ocsipersist.remove table group_name |
510 |
+ | _ -> Lwt.return ()) |
511 |
+ >>= fun () -> |
512 |
+ |
513 |
+@@ -511,7 +510,7 @@ module Pers = struct |
514 |
+ match sess_grp with |
515 |
+ | Some sg -> |
516 |
+ let sg = Eliom_common.string_of_perssessgrp sg in |
517 |
+- Ocsipersist.remove !!grouptable sg |
518 |
++ !!grouptable >>= fun grouptable -> Ocsipersist.remove grouptable sg |
519 |
+ | None -> Lwt.return () |
520 |
+ ) |
521 |
+ (function Not_found -> Lwt.return () | e -> Lwt.fail e) |
522 |
+@@ -526,7 +525,7 @@ module Pers = struct |
523 |
+ match cookie_level with |
524 |
+ | `Client_process -> begin |
525 |
+ (* We remove cookie info from the table *) |
526 |
+- Ocsipersist.remove (!!Eliom_common.persistent_cookies_table) cookie |
527 |
++ !!Eliom_common.persistent_cookies_table >>= fun table -> Ocsipersist.remove table cookie |
528 |
+ >>= fun () -> |
529 |
+ |
530 |
+ (* We remove the session from its group: *) |
531 |
+@@ -555,7 +554,7 @@ module Pers = struct |
532 |
+ let sg = Eliom_common.string_of_perssessgrp sg0 in |
533 |
+ Lwt.catch |
534 |
+ (fun () -> |
535 |
+- Ocsipersist.find !!grouptable sg >>= fun (max, cl) -> |
536 |
++ !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable sg >>= fun (max, cl) -> |
537 |
+ let newcl = List.remove_first_if_any sess_id cl in |
538 |
+ (match newcl with |
539 |
+ | [] -> |
540 |
+@@ -570,8 +569,8 @@ module Pers = struct |
541 |
+ remove_group ~cookie_level:`Session sitedata sess_grp |
542 |
+ | _ -> Lwt.return () |
543 |
+ ) >>= fun () -> |
544 |
+- Ocsipersist.remove !!grouptable sg |
545 |
+- | _ -> Ocsipersist.replace_if_exists !!grouptable sg (max, newcl) |
546 |
++ Ocsipersist.remove grouptable sg |
547 |
++ | _ -> Ocsipersist.replace_if_exists grouptable sg (max, newcl) |
548 |
+ ) |
549 |
+ ) |
550 |
+ (function |
551 |
+@@ -586,9 +585,9 @@ module Pers = struct |
552 |
+ let sg = Eliom_common.string_of_perssessgrp sg in |
553 |
+ Lwt.catch |
554 |
+ (fun () -> |
555 |
+- Ocsipersist.find !!grouptable sg >>= fun (max, cl) -> |
556 |
++ !!grouptable >>= fun grouptable -> Ocsipersist.find grouptable sg >>= fun (max, cl) -> |
557 |
+ let newcl = List.remove_first_if_any sess_id cl in |
558 |
+- Ocsipersist.replace_if_exists !!grouptable sg (max, sess_id::newcl) |
559 |
++ Ocsipersist.replace_if_exists grouptable sg (max, sess_id::newcl) |
560 |
+ ) |
561 |
+ (function |
562 |
+ | Not_found -> Lwt.return () |
563 |
+@@ -601,6 +600,6 @@ module Pers = struct |
564 |
+ end |
565 |
+ else Lwt.return [] |
566 |
+ |
567 |
+- let nb_of_groups () = Ocsipersist.length !!grouptable |
568 |
++ let nb_of_groups () = !!grouptable >>= Ocsipersist.length |
569 |
+ |
570 |
+ end |
571 |
|
572 |
diff --git a/dev-ml/eliom/files/reactivedata.patch b/dev-ml/eliom/files/reactivedata.patch |
573 |
new file mode 100644 |
574 |
index 00000000..190df85 |
575 |
--- /dev/null |
576 |
+++ b/dev-ml/eliom/files/reactivedata.patch |
577 |
@@ -0,0 +1,44 @@ |
578 |
+Index: eliom-5.0.0/src/lib/eliom_shared.eliom |
579 |
+=================================================================== |
580 |
+--- eliom-5.0.0.orig/src/lib/eliom_shared.eliom |
581 |
++++ eliom-5.0.0/src/lib/eliom_shared.eliom |
582 |
+@@ -288,7 +288,7 @@ module FakeReactiveData = struct |
583 |
+ val concat : 'a t -> 'a t -> 'a t |
584 |
+ val value : 'a t -> 'a list |
585 |
+ val synced : 'a t -> bool |
586 |
+- val signal : 'a t -> 'a list FakeReact.S.t |
587 |
++ val signal : ?eq:('a -> 'a -> bool) -> 'a t -> 'a list FakeReact.S.t |
588 |
+ val singleton_s : 'a FakeReact.S.t -> 'a t |
589 |
+ val map : ('a -> 'b) -> 'a t -> 'b t |
590 |
+ val from_signal : |
591 |
+@@ -304,7 +304,7 @@ module FakeReactiveData = struct |
592 |
+ let singleton_s s = [FakeReact.S.value s], FakeReact.S.synced s |
593 |
+ let value (l, _) = l |
594 |
+ let synced (_, b) = b |
595 |
+- let signal (l, synced) = fst (FakeReact.S.create ~synced l) |
596 |
++ let signal ?eq (l, synced) = fst (FakeReact.S.create ~synced l) |
597 |
+ let map f (l, b) = List.map f l, b |
598 |
+ let from_signal ?eq s = FakeReact.S.(value s, synced s) |
599 |
+ module Lwt = struct |
600 |
+@@ -635,7 +635,7 @@ module ReactiveData = struct |
601 |
+ let value (s : 'a t) = {shared# 'a list { |
602 |
+ FakeReactiveData.RList.value (Value.local %s) }} |
603 |
+ |
604 |
+- let signal (s : 'a t) = {shared# 'a list FakeReact.S.t { |
605 |
++ let signal ?eq (s : 'a t) = {shared# 'a list FakeReact.S.t { |
606 |
+ FakeReactiveData.RList.signal (Value.local %s) }} |
607 |
+ |
608 |
+ let map f s = {shared# 'a FakeReactiveData.RList.t { |
609 |
+Index: eliom-5.0.0/src/lib/eliom_shared_sigs.shared.mli |
610 |
+=================================================================== |
611 |
+--- eliom-5.0.0.orig/src/lib/eliom_shared_sigs.shared.mli |
612 |
++++ eliom-5.0.0/src/lib/eliom_shared_sigs.shared.mli |
613 |
+@@ -143,7 +143,7 @@ module type RLIST = sig |
614 |
+ |
615 |
+ val concat : 'a t -> 'a t -> 'a t |
616 |
+ val value : 'a t -> 'a list Eliom_lib.shared_value |
617 |
+- val signal : 'a t -> 'a list signal |
618 |
++ val signal : ?eq:(('a -> 'a -> bool)) -> 'a t -> 'a list signal |
619 |
+ val singleton_s : 'a signal -> 'a t |
620 |
+ val map : ('a -> 'b) Eliom_lib.shared_value -> 'a t -> 'b t |
621 |
+ val from_signal : |