You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by fm...@apache.org on 2011/11/03 11:25:12 UTC
svn commit: r1197051 - in /felix/trunk/http/jetty/src/main:
java/org/apache/felix/http/jetty/internal/ resources/OSGI-INF/metatype/
Author: fmeschbe
Date: Thu Nov 3 10:25:11 2011
New Revision: 1197051
URL: http://svn.apache.org/viewvc?rev=1197051&view=rev
Log:
FELIX-3162 Allow the configuration of three Jetty buffers: Header, Request, and Response buffers. In addition the default of the header buffer is increased to 16KB as opposed to the Jetty default of 4KB which is not enough for Cookie heavy requests.
Modified:
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.properties
felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.xml
Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java?rev=1197051&r1=1197050&r2=1197051&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java (original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java Thu Nov 3 10:25:11 2011
@@ -79,6 +79,15 @@ public final class JettyConfig
/** Felix specific property to configure the session timeout in minutes (same session-timout in web.xml). Default is servlet container specific */
public static final String FELIX_SESSION_TIMEOUT = "org.apache.felix.http.session.timeout";
+ /** Felix speicific property to configure the request buffer size. Default is 16KB (instead of Jetty's default of 4KB) */
+ public static final String FELIX_JETTY_HEADER_BUFFER_SIZE = "org.apache.felix.http.jetty.headerBufferSize";
+
+ /** Felix speicific property to configure the request buffer size. Default is 8KB */
+ public static final String FELIX_JETTY_REQUEST_BUFFER_SIZE = "org.apache.felix.http.jetty.requestBufferSize";
+
+ /** Felix speicific 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 enable Jetty MBeans. Valid values are "true", "false". Default is false */
public static final String FELIX_HTTP_MBEANS = "org.apache.felix.http.mbeans";
@@ -100,6 +109,9 @@ public final class JettyConfig
private boolean useHttpsNio;
private boolean registerMBeans;
private int sessionTimeout;
+ private int headerBufferSize;
+ private int requestBufferSize;
+ private int responseBufferSize;
/**
* Properties from the configuration not matching any of the
@@ -216,6 +228,21 @@ public final class JettyConfig
return this.sessionTimeout;
}
+ public int getHeaderBufferSize()
+ {
+ return this.headerBufferSize;
+ }
+
+ public int getRequestBufferSize()
+ {
+ return this.requestBufferSize;
+ }
+
+ public int getResponseBufferSize()
+ {
+ return this.responseBufferSize;
+ }
+
public void reset()
{
update(null);
@@ -244,6 +271,9 @@ public final class JettyConfig
this.useHttpsNio = getBooleanProperty(props, FELIX_HTTPS_NIO, this.useHttpNio);
this.registerMBeans = getBooleanProperty(props, FELIX_HTTP_MBEANS, false);
this.sessionTimeout = getIntProperty(props, FELIX_SESSION_TIMEOUT, 0);
+ this.headerBufferSize = getIntProperty(FELIX_JETTY_HEADER_BUFFER_SIZE, 16 * 1024);
+ this.requestBufferSize = getIntProperty(FELIX_JETTY_REQUEST_BUFFER_SIZE, 8 * 014);
+ this.responseBufferSize = getIntProperty(FELIX_JETTY_RESPONSE_BUFFER_SIZE, 24 * 1024);
// copy rest of the properties
Enumeration keys = props.keys();
Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java?rev=1197051&r1=1197050&r2=1197051&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java (original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java Thu Nov 3 10:25:11 2011
@@ -306,6 +306,9 @@ public final class JettyService
private void configureConnector(final Connector connector)
{
connector.setMaxIdleTime(this.config.getHttpTimeout());
+ connector.setHeaderBufferSize(this.config.getHeaderBufferSize());
+ connector.setRequestBufferSize(this.config.getRequestBufferSize());
+ connector.setResponseBufferSize(this.config.getResponseBufferSize());
connector.setHost(this.config.getHost());
connector.setStatsOn(this.config.isRegisterMBeans());
Modified: felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1197051&r1=1197050&r2=1197051&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.properties (original)
+++ felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.properties Thu Nov 3 10:25:11 2011
@@ -92,4 +92,16 @@ org.apache.felix.https.nio.description =
org.apache.felix.http.mbeans.name = Register MBeans
org.apache.felix.http.mbeans.description = Whether or not to use register \
- JMX MBeans from the servlet container (Jetty).
\ No newline at end of file
+ JMX MBeans from the servlet container (Jetty).
+
+org.apache.felix.http.jetty.headerBufferSize.name = Header Buffer Size
+org.apache.felix.http.jetty.headerBufferSize.description = Size of the \
+ buffer for request and response headers. Default is 16KB.
+
+org.apache.felix.http.jetty.requestBufferSize.name = Request Buffer Size
+org.apache.felix.http.jetty.requestBufferSize.description = Size of the \
+ buffer for requests not fitting the header buffer. Default is 8KB.
+
+org.apache.felix.http.jetty.responseBufferSize.name = Response Buffer Size
+org.apache.felix.http.jetty.responseBufferSize.description = Size of the \
+ buffer for responses. Default is 24KB.
Modified: felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.xml
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.xml?rev=1197051&r1=1197050&r2=1197051&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.xml (original)
+++ felix/trunk/http/jetty/src/main/resources/OSGI-INF/metatype/metatype.xml Thu Nov 3 10:25:11 2011
@@ -15,6 +15,9 @@
<AD id="org.apache.felix.https.truststore" type="String" name="%org.apache.felix.https.truststore.name" description="%org.apache.felix.https.truststore.description"/>
<AD id="org.apache.felix.https.truststore.password" type="String" name="%org.apache.felix.https.truststore.password.name" description="%org.apache.felix.https.truststore.password.description"/>
<AD id="org.apache.felix.https.clientcertificate" type="String" default="none" name="%org.apache.felix.https.clientcertificate.name" description="%org.apache.felix.https.clientcertificate.description">
+ <AD id="org.apache.felix.http.jetty.headerBufferSize" type="Integer" default="16384" name="%org.apache.felix.http.jetty.headerBufferSize.name" description="%org.apache.felix.http.jetty.headerBufferSize.description">
+ <AD id="org.apache.felix.http.jetty.requestBufferSize" type="Integer" default="8192" name="%org.apache.felix.http.jetty.requestBufferSize.name" description="%org.apache.felix.http.jetty.requestBufferSize.description">
+ <AD id="org.apache.felix.http.jetty.responseBufferSize" type="Integer" default="24576" name="%org.apache.felix.http.jetty.responseBufferSize.name" description="%org.apache.felix.http.jetty.responseBufferSize.description">
<Option value="none" label="%clientcertificate.none"/>
<Option value="wants" label="%clientcertificate.wants"/>
<Option value="needs" label="%clientcertificate.needs"/>