Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2015-12-17 20:36:27 -0500
committerGreg Wilkins2015-12-17 20:36:27 -0500
commit5cd676581c178dc3611298e611c62fc51ed1b6cf (patch)
treeb91816b574f8cf5e3d0f03495dad331555be7ca5 /jetty-servlets
parentecbfe7c1d08936052da021f644d19c4b0db9fe65 (diff)
downloadorg.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')
-rw-r--r--jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java16
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

Back to the top