package ocsigenserver
A full-featured and extensible Web server
Install
Dune Dependency
Authors
Maintainers
Sources
6.0.0.tar.gz
md5=001e22ec2da3ab08840f934a8f005859
sha512=59f36fdf0a640117aa562d1d9ef96b7146843d9b72d71d01366640521405550074e03267fb388c5e685542781fc4bce763818a36cf05c0e033fae5e51c2f1496
doc/src/ocsigenserver.cookies/ocsigen_cookie_map.ml.html
Source file ocsigen_cookie_map.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
(* Ocsigen * Copyright (C) 2010 Vincent Balat * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, with linking exception; * either version 2.1 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) module Map_path = Map.Make (struct type t = string list let compare = compare end) module Map_inner = Map.Make (String) type t = cookie Map_inner.t Map_path.t let empty = Map_path.empty let add ~path n v m = let m' = try Map_path.find path m with Not_found -> Map_inner.empty in (* We replace the old value if it exists *) Map_path.add path (Map_inner.add n v m') m (* [add_multi new old] adds the cookies from [new] to [old]. If cookies are already bound in oldcookies, the previous binding disappear. *) let add_multi = Map_path.fold @@ fun path -> Map_inner.fold @@ fun n v beg -> match v with | OSet (expo, v, secure) -> add ~path n (OSet (expo, v, secure)) beg | OUnset -> add ~path n OUnset beg let remove ~path n m = try let m' = Map_path.find path m in let m' = Map_inner.remove n m' in if Map_inner.is_empty m' then Map_path.remove path m else (* We replace the old value *) Map_path.add path m' m with Not_found -> m module Poly = struct let add = add let remove = remove end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>