diff options
author | Greg Wilkins | 2015-12-18 01:36:27 +0000 |
---|---|---|
committer | Greg Wilkins | 2015-12-18 01:36:27 +0000 |
commit | 5cd676581c178dc3611298e611c62fc51ed1b6cf (patch) | |
tree | b91816b574f8cf5e3d0f03495dad331555be7ca5 /jetty-servlets/src/main | |
parent | ecbfe7c1d08936052da021f644d19c4b0db9fe65 (diff) | |
download | org.eclipse.jetty.project-5cd676581c178dc3611298e611c62fc51ed1b6cf.tar.gz org.eclipse.jetty.project-5cd676581c178dc3611298e611c62fc51ed1b6cf.tar.xz org.eclipse.jetty.project-5cd676581c178dc3611298e611c62fc51ed1b6cf.zip |
484622 - Improve handling of Direct and Mapped buffers for static content
ResourceHttpContent now applies a maxBufferSize that is passed through the call to getContent
ResourceCache now accounts for the exact memory usage of content, which may have an indirect
buffer plus either a direct or mapped buffer. Thus content size may be 0, 1 or 2 times the
file size.
Some more limited unit tests
Diffstat (limited to 'jetty-servlets/src/main')
-rw-r--r-- | jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java index 8a13382865..aad404d5db 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java @@ -1107,10 +1107,10 @@ public class DoSFilter implements Filter { private static final long serialVersionUID = 3534663738034577872L; - protected transient final String _id; - protected transient final int _type; - protected transient final long[] _timestamps; - protected transient int _next; + protected final String _id; + protected final int _type; + protected final long[] _timestamps; + protected int _next; public RateTracker(String id, int type, int maxRequestsPerSecond) { @@ -1164,16 +1164,14 @@ public class DoSFilter implements Filter public void sessionWillPassivate(HttpSessionEvent se) { //take the tracker of the list of trackers (if its still there) - //and ensure that we take ourselves out of the session so we are not saved _rateTrackers.remove(_id); - se.getSession().removeAttribute(__TRACKER); - if (LOG.isDebugEnabled()) - LOG.debug("Value removed: {}", getId()); } public void sessionDidActivate(HttpSessionEvent se) { - LOG.warn("Unexpected session activation"); + RateTracker tracker = (RateTracker)se.getSession().getAttribute(__TRACKER); + if (tracker!=null) + _rateTrackers.put(tracker.getId(),tracker); } @Override |