FELIX-4397 : Allow to configure Max Form Size. Apply patch from Dominique Pfister

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1560196 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
index c8c084a..24ae12c 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
@@ -99,6 +99,9 @@
     /** Felix specific property to configure the request buffer size. Default is 24KB */
     public static final String FELIX_JETTY_RESPONSE_BUFFER_SIZE = "org.apache.felix.http.jetty.responseBufferSize";
 
+    /** Felix specific property to configure the max form size. Default is 200KB */
+    public static final String FELIX_JETTY_MAX_FORM_SIZE = "org.apache.felix.http.jetty.maxFormSize";
+
     /** Felix specific property to enable Jetty MBeans. Valid values are "true", "false". Default is false */
     public static final String FELIX_HTTP_MBEANS = "org.apache.felix.http.mbeans";
 
@@ -271,6 +274,11 @@
         return getIntProperty(FELIX_JETTY_RESPONSE_BUFFER_SIZE, 24 * 1024);
     }
 
+    public int getMaxFormSize()
+    {
+        return getIntProperty(FELIX_JETTY_MAX_FORM_SIZE, 200 * 1024);
+    }
+
     /**
      * Returns the configured session timeout in minutes or zero if not
      * configured.
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
index 448804b..b0eea3c 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
@@ -276,6 +276,7 @@
             context.addEventListener(eventDispatcher);
             context.getSessionHandler().addEventListener(eventDispatcher);
             context.addServlet(new ServletHolder(this.dispatcher), "/*");
+            context.setMaxFormContentSize(this.config.getMaxFormSize());
 
             if (this.config.isRegisterMBeans())
             {
diff --git a/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.properties b/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.properties
index f96743c..b3e6857 100644
--- a/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.properties
+++ b/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -118,6 +118,10 @@
 org.apache.felix.http.jetty.responseBufferSize.description = Size of the \
  buffer for responses. Default is 24KB.
 
+org.apache.felix.http.jetty.maxFormSize.name = Maxmimum Form Size
+org.apache.felix.http.jetty.maxFormSize.description = Size of Body for \
+ submitted form content. Default is 200KB.
+
 org.apache.felix.http.context_path.name = Context Path
 org.apache.felix.http.context_path.description = The Servlet Context Path \
  to use for the Http Service. If this property is not configured it \