From 192f2d700236dcd9c5954b65577e995c27306110 Mon Sep 17 00:00:00 2001 From: David Harrigan Date: Fri, 26 Jul 2013 15:36:34 +0100 Subject: [PATCH 1/2] BUG-413812 Mark RateTracker as Serializable to allow it to be stored in a Session that is eventually persisted in a distributed memory platform. Signed-off-by: David Harrigan --- .../src/main/java/org/eclipse/jetty/servlets/DoSFilter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ebc99d52cc0..737bc84accb 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 @@ -19,6 +19,7 @@ package org.eclipse.jetty.servlets; import java.io.IOException; +import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -1025,8 +1026,10 @@ public class DoSFilter implements Filter * A RateTracker is associated with a connection, and stores request rate * data. */ - class RateTracker extends Timeout.Task implements HttpSessionBindingListener, HttpSessionActivationListener + class RateTracker extends Timeout.Task implements HttpSessionBindingListener, HttpSessionActivationListener, Serializable { + private static final long serialVersionUID = 3534663738034577872L; + transient protected final String _id; transient protected final int _type; transient protected final long[] _timestamps; From 61ea4d6705557256d727458082f3e1f393787d72 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 26 Jul 2013 19:07:20 +0200 Subject: [PATCH 2/2] Fixed method parseResponse() that should never return null. The response is "filled" by parser events even if at the end of the parsing the parser returns false. --- .../src/main/java/org/eclipse/jetty/http/HttpTester.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpTester.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpTester.java index a569b1a14a2..0170d3e2049 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpTester.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpTester.java @@ -67,10 +67,8 @@ public class HttpTester { Response r=new Response(); HttpParser parser =new HttpParser(r); - if (parser.parseNext(response)) - return r; - else - return null; + parser.parseNext(response); + return r; } @@ -93,7 +91,7 @@ public class HttpTester { _version=version; } - + public void setContent(byte[] bytes) { try