Dolda2000 GitWeb
/
jsvc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.dolda2000.com:/srv/git/r/jsvc
[jsvc.git]
/
src
/
dolda
/
jsvc
/
util
/
Cookie.java
diff --git
a/src/dolda/jsvc/util/Cookie.java
b/src/dolda/jsvc/util/Cookie.java
index
8783427
..
591289d
100644
(file)
--- a/
src/dolda/jsvc/util/Cookie.java
+++ b/
src/dolda/jsvc/util/Cookie.java
@@
-6,6
+6,7
@@
import java.text.*;
import java.io.*;
public class Cookie {
import java.io.*;
public class Cookie {
+ private final static Map<Request, MultiMap<String, Cookie>> cache = new WeakHashMap<Request, MultiMap<String, Cookie>>();
public final static DateFormat datefmt;
static {
datefmt = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss z", Locale.ENGLISH);
public final static DateFormat datefmt;
static {
datefmt = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss z", Locale.ENGLISH);
@@
-88,6
+89,17
@@
public class Cookie {
return(ret);
}
return(ret);
}
+ public static MultiMap<String, Cookie> get(Request req) {
+ synchronized(cache) {
+ MultiMap<String, Cookie> ret = cache.get(req);
+ if(ret == null) {
+ ret = parse(req);
+ cache.put(req, ret);
+ }
+ return(ret);
+ }
+ }
+
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append("Cookie(");
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append("Cookie(");