Merge pull request #2707 from lachlan-roberts/jetty-9.4.x-HttpParser-headerCacheSize

Changing default Http headerCacheSize from 512 to 4096
This commit is contained in:
Greg Wilkins 2018-07-11 08:46:54 +01:00 committed by GitHub
commit 842e3c850a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 24 additions and 26 deletions

View File

@ -218,7 +218,7 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
public int getHeaderCacheSize()
{
// TODO get from configuration
return 256;
return 4096;
}
@Override

View File

@ -84,7 +84,7 @@
<Set name="responseHeaderSize">8192</Set>
<Set name="sendServerVersion">true</Set>
<Set name="sendDateHeader">false</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
<!-- Uncomment to enable handling of X-Forwarded- style headers
<Call name="addCustomizer">

View File

@ -213,7 +213,7 @@ Below is the relevant section taken from link:{GITBROWSEURL}/jetty-server/src/ma
<Set name="responseHeaderSize"><Property name="jetty.httpConfig.responseHeaderSize" deprecated="jetty.response.header.size" default="8192" /></Set>
<Set name="sendServerVersion"><Property name="jetty.httpConfig.sendServerVersion" deprecated="jetty.send.server.version" default="true" /></Set>
<Set name="sendDateHeader"><Property name="jetty.httpConfig.sendDateHeader" deprecated="jetty.send.date.header" default="false" /></Set>
<Set name="headerCacheSize"><Property name="jetty.httpConfig.headerCacheSize" default="512" /></Set>
<Set name="headerCacheSize"><Property name="jetty.httpConfig.headerCacheSize" default="4096" /></Set>
<Set name="delayDispatchUntilContent"><Property name="jetty.httpConfig.delayDispatchUntilContent" deprecated="jetty.delayDispatchUntilContent" default="true"/></Set>
<Set name="maxErrorDispatches"><Property name="jetty.httpConfig.maxErrorDispatches" default="10"/></Set>
<Set name="blockingTimeout"><Property name="jetty.httpConfig.blockingTimeout" default="-1"/></Set>

View File

@ -153,7 +153,7 @@ public class ResponseContentParser extends StreamContentParser
public int getHeaderCacheSize()
{
// TODO: configure this
return 0;
return 4096;
}
@Override

View File

@ -268,7 +268,7 @@ public class HttpGeneratorServerHTTPTest
@Override
public int getHeaderCacheSize()
{
return 256;
return 4096;
}
}

View File

@ -18,16 +18,11 @@
package org.eclipse.jetty.http;
import static org.eclipse.jetty.http.HttpComplianceSection.NO_FIELD_FOLDING;
import static org.hamcrest.Matchers.contains;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import org.eclipse.jetty.http.HttpParser.State;
import org.eclipse.jetty.util.BufferUtil;
@ -37,6 +32,9 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import static org.eclipse.jetty.http.HttpComplianceSection.NO_FIELD_FOLDING;
import static org.hamcrest.Matchers.contains;
public class HttpParserTest
{
static
@ -2360,7 +2358,7 @@ public class HttpParserTest
@Override
public int getHeaderCacheSize()
{
return 512;
return 4096;
}
@Override

View File

@ -8,7 +8,7 @@
<Set name="outputBufferSize">32768</Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="responseHeaderSize">8192</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>
<Call name="addConnector">

View File

@ -8,7 +8,7 @@
<Set name="outputBufferSize">32768</Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="responseHeaderSize">8192</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>
<Call name="addConnector">

View File

@ -8,7 +8,7 @@
<Set name="outputBufferSize">32768</Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="responseHeaderSize">8192</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>
<Call name="addConnector">

View File

@ -8,7 +8,7 @@
<Set name="outputBufferSize">32768</Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="responseHeaderSize">8192</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>
<Call name="addConnector">

View File

@ -8,7 +8,7 @@
<Set name="outputBufferSize">32768</Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="responseHeaderSize">8192</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>
<Call name="addConnector">

View File

@ -8,7 +8,7 @@
<Set name="outputBufferSize">32768</Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="responseHeaderSize">8192</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>
<Call name="addConnector">

View File

@ -8,7 +8,7 @@
<Set name="outputBufferSize">32768</Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="responseHeaderSize">8192</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>
<Call name="addConnector">

View File

@ -8,7 +8,7 @@
<Set name="outputBufferSize">32768</Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="responseHeaderSize">8192</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>
<Call name="addConnector">

View File

@ -49,7 +49,7 @@
<Set name="responseHeaderSize">8192</Set>
<Set name="sendServerVersion">true</Set>
<Set name="sendDateHeader">false</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>

View File

@ -49,7 +49,7 @@
<Set name="responseHeaderSize">8192</Set>
<Set name="sendServerVersion">true</Set>
<Set name="sendDateHeader">false</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
</New>

View File

@ -59,7 +59,7 @@
<Set name="responseHeaderSize"><Property name="jetty.httpConfig.responseHeaderSize" deprecated="jetty.response.header.size" default="8192" /></Set>
<Set name="sendServerVersion"><Property name="jetty.httpConfig.sendServerVersion" deprecated="jetty.send.server.version" default="true" /></Set>
<Set name="sendDateHeader"><Property name="jetty.httpConfig.sendDateHeader" deprecated="jetty.send.date.header" default="false" /></Set>
<Set name="headerCacheSize"><Property name="jetty.httpConfig.headerCacheSize" default="512" /></Set>
<Set name="headerCacheSize"><Property name="jetty.httpConfig.headerCacheSize" default="4096" /></Set>
<Set name="delayDispatchUntilContent"><Property name="jetty.httpConfig.delayDispatchUntilContent" deprecated="jetty.delayDispatchUntilContent" default="true"/></Set>
<Set name="maxErrorDispatches"><Property name="jetty.httpConfig.maxErrorDispatches" default="10"/></Set>
<Set name="blockingTimeout"><Property deprecated="jetty.httpConfig.blockingTimeout" name="jetty.httpConfig.blockingTimeout.DEPRECATED" default="-1"/></Set>

View File

@ -51,7 +51,7 @@ etc/jetty.xml
# jetty.httpConfig.sendDateHeader=false
## Max per-connection header cache size (in nodes)
# jetty.httpConfig.headerCacheSize=512
# jetty.httpConfig.headerCacheSize=4096
## Whether, for requests with content, delay dispatch until some content has arrived
# jetty.httpConfig.delayDispatchUntilContent=true

View File

@ -57,7 +57,7 @@ public class HttpConfiguration
private int _outputAggregationSize=_outputBufferSize/4;
private int _requestHeaderSize=8*1024;
private int _responseHeaderSize=8*1024;
private int _headerCacheSize=512;
private int _headerCacheSize=4*1024;
private int _securePort;
private long _idleTimeout=-1;
private long _blockingTimeout=-1;

View File

@ -20,7 +20,7 @@
<Set name="responseHeaderSize">8192</Set>
<Set name="sendServerVersion">true</Set>
<Set name="sendDateHeader">false</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
<!-- Uncomment to enable handling of X-Forwarded- style headers
<Call name="addCustomizer">

View File

@ -20,7 +20,7 @@
<Set name="responseHeaderSize">8192</Set>
<Set name="sendServerVersion">true</Set>
<Set name="sendDateHeader">false</Set>
<Set name="headerCacheSize">512</Set>
<Set name="headerCacheSize">4096</Set>
<!-- Uncomment to enable handling of X-Forwarded- style headers
<Call name="addCustomizer">