Merge 9.4.x to 10.0.x
This commit is contained in:
commit
a836e03749
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure id="threadPool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
|
||||
|
||||
<!-- =========================================================== -->
|
||||
<!-- Configure the Server Thread Pool. -->
|
||||
<!-- The server holds a common thread pool which is used by -->
|
||||
<!-- default as the executor used by all connectors and servlet -->
|
||||
<!-- dispatches. -->
|
||||
<!-- -->
|
||||
<!-- Configuring a fixed thread pool is vital to controlling the -->
|
||||
<!-- maximal memory footprint of the server and is a key tuning -->
|
||||
<!-- parameter for tuning. In an application that rarely blocks -->
|
||||
<!-- then maximal threads may be close to the number of 5*CPUs. -->
|
||||
<!-- In an application that frequently blocks, then maximal -->
|
||||
<!-- threads should be set as high as possible given the memory -->
|
||||
<!-- available. -->
|
||||
<!-- -->
|
||||
<!-- Consult the javadoc of o.e.j.util.thread.QueuedThreadPool -->
|
||||
<!-- for all configuration that may be set here. -->
|
||||
<!-- =========================================================== -->
|
||||
<Set name="minThreads" type="int"><Property name="jetty.threadPool.minThreads" deprecated="threads.min" default="10"/></Set>
|
||||
<Set name="maxThreads" type="int"><Property name="jetty.threadPool.maxThreads" deprecated="threads.max" default="200"/></Set>
|
||||
<Set name="idleTimeout" type="int"><Property name="jetty.threadPool.idleTimeout" deprecated="threads.timeout" default="60000"/></Set>
|
||||
<Set name="detailedDump" type="boolean"><Property name="jetty.threadPool.detailedDump" default="false"/></Set>
|
||||
</Configure>
|
|
@ -25,32 +25,7 @@
|
|||
<!-- =============================================================== -->
|
||||
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
||||
|
||||
<!-- =========================================================== -->
|
||||
<!-- Configure the Server Thread Pool. -->
|
||||
<!-- The server holds a common thread pool which is used by -->
|
||||
<!-- default as the executor used by all connectors and servlet -->
|
||||
<!-- dispatches. -->
|
||||
<!-- -->
|
||||
<!-- Configuring a fixed thread pool is vital to controlling the -->
|
||||
<!-- maximal memory footprint of the server and is a key tuning -->
|
||||
<!-- parameter for tuning. In an application that rarely blocks -->
|
||||
<!-- then maximal threads may be close to the number of 5*CPUs. -->
|
||||
<!-- In an application that frequently blocks, then maximal -->
|
||||
<!-- threads should be set as high as possible given the memory -->
|
||||
<!-- available. -->
|
||||
<!-- -->
|
||||
<!-- Consult the javadoc of o.e.j.util.thread.QueuedThreadPool -->
|
||||
<!-- for all configuration that may be set here. -->
|
||||
<!-- =========================================================== -->
|
||||
<!-- uncomment to change type of threadpool
|
||||
<Arg name="threadpool"><New id="threadpool" class="org.eclipse.jetty.util.thread.QueuedThreadPool"/></Arg>
|
||||
-->
|
||||
<Get name="ThreadPool">
|
||||
<Set name="minThreads" type="int"><Property name="jetty.threadPool.minThreads" default="10"/></Set>
|
||||
<Set name="maxThreads" type="int"><Property name="jetty.threadPool.maxThreads" default="200"/></Set>
|
||||
<Set name="idleTimeout" type="int"><Property name="jetty.threadPool.idleTimeout" default="60000"/></Set>
|
||||
<Set name="detailedDump">false</Set>
|
||||
</Get>
|
||||
<Arg name="threadpool"><Ref refid="threadPool"/></Arg>
|
||||
|
||||
<!-- =========================================================== -->
|
||||
<!-- Add shared Scheduler instance -->
|
||||
|
@ -78,15 +53,15 @@
|
|||
<!-- =========================================================== -->
|
||||
<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
|
||||
<Set name="secureScheme"><Property name="jetty.httpConfig.secureScheme" default="https" /></Set>
|
||||
<Set name="securePort"><Property name="jetty.httpConfig.securePort" default="8443" /></Set>
|
||||
<Set name="outputBufferSize"><Property name="jetty.httpConfig.outputBufferSize" default="32768" /></Set>
|
||||
<Set name="outputAggregationSize"><Property name="jetty.httpConfig.outputAggregationSize" default="8192" /></Set>
|
||||
<Set name="requestHeaderSize"><Property name="jetty.httpConfig.requestHeaderSize" default="8192" /></Set>
|
||||
<Set name="responseHeaderSize"><Property name="jetty.httpConfig.responseHeaderSize" default="8192" /></Set>
|
||||
<Set name="sendServerVersion"><Property name="jetty.httpConfig.sendServerVersion" default="true" /></Set>
|
||||
<Set name="sendDateHeader"><Property name="jetty.httpConfig.sendDateHeader" default="false" /></Set>
|
||||
<Set name="securePort"><Property name="jetty.httpConfig.securePort" deprecated="jetty.secure.port" default="8443" /></Set>
|
||||
<Set name="outputBufferSize"><Property name="jetty.httpConfig.outputBufferSize" deprecated="jetty.output.buffer.size" default="32768" /></Set>
|
||||
<Set name="outputAggregationSize"><Property name="jetty.httpConfig.outputAggregationSize" deprecated="jetty.output.aggregation.size" default="8192" /></Set>
|
||||
<Set name="requestHeaderSize"><Property name="jetty.httpConfig.requestHeaderSize" deprecated="jetty.request.header.size" default="8192" /></Set>
|
||||
<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="delayDispatchUntilContent"><Property name="jetty.httpConfig.delayDispatchUntilContent" default="true"/></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>
|
||||
<Set name="persistentConnectionsEnabled"><Property name="jetty.httpConfig.persistentConnectionsEnabled" default="true"/></Set>
|
||||
|
@ -124,7 +99,7 @@
|
|||
<!-- =========================================================== -->
|
||||
<Set name="stopAtShutdown"><Property name="jetty.server.stopAtShutdown" default="true"/></Set>
|
||||
<Set name="stopTimeout"><Property name="jetty.server.stopTimeout" default="5000"/></Set>
|
||||
<Set name="dumpAfterStart"><Property name="jetty.server.dumpAfterStart" default="false"/></Set>
|
||||
<Set name="dumpBeforeStop"><Property name="jetty.server.dumpBeforeStop" default="false"/></Set>
|
||||
<Set name="dumpAfterStart"><Property name="jetty.server.dumpAfterStart" deprecated="jetty.dump.start" default="false"/></Set>
|
||||
<Set name="dumpBeforeStop"><Property name="jetty.server.dumpBeforeStop" deprecated="jetty.dump.stop" default="false"/></Set>
|
||||
|
||||
</Configure>
|
||||
|
|
|
@ -7,6 +7,9 @@ ext
|
|||
resources
|
||||
logging
|
||||
|
||||
[depend]
|
||||
threadpool
|
||||
|
||||
[lib]
|
||||
lib/servlet-api-4.0.jar
|
||||
lib/jetty-schemas-4.0.jar
|
||||
|
@ -20,16 +23,6 @@ lib/jetty-io-${jetty.version}.jar
|
|||
etc/jetty.xml
|
||||
|
||||
[ini-template]
|
||||
### ThreadPool configuration
|
||||
## Minimum number of threads
|
||||
# jetty.threadPool.minThreads=10
|
||||
|
||||
## Maximum number of threads
|
||||
# jetty.threadPool.maxThreads=200
|
||||
|
||||
## Thread idle timeout (in milliseconds)
|
||||
# jetty.threadPool.idleTimeout=60000
|
||||
|
||||
### Common HTTP configuration
|
||||
## Scheme to use to build URIs for secure redirects
|
||||
# jetty.httpConfig.secureScheme=https
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
[description]
|
||||
Enables the Server thread pool.
|
||||
|
||||
[xml]
|
||||
etc/jetty-threadpool.xml
|
||||
|
||||
[ini-template]
|
||||
|
||||
### Server Thread Pool Configuration
|
||||
## Minimum Number of Threads
|
||||
#jetty.threadPool.minThreads=10
|
||||
|
||||
## Maximum Number of Threads
|
||||
#jetty.threadPool.maxThreads=200
|
||||
|
||||
## Thread Idle Timeout (in milliseconds)
|
||||
#jetty.threadPool.idleTimeout=60000
|
||||
|
||||
## Whether to Output a Detailed Dump
|
||||
#jetty.threadPool.detailedDump=false
|
|
@ -19,12 +19,10 @@
|
|||
package org.eclipse.jetty.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.BufferOverflowException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
@ -1096,8 +1094,8 @@ public class BufferUtil
|
|||
private static void appendContentChar(StringBuilder buf, byte b)
|
||||
{
|
||||
if (b == '\\')
|
||||
buf.append("\\\\");
|
||||
else if (b >= ' ')
|
||||
buf.append("\\\\");
|
||||
else if ((b >= 0x20) && (b<=0x7E)) // limit to 7-bit printable US-ASCII character space
|
||||
buf.append((char)b);
|
||||
else if (b == '\r')
|
||||
buf.append("\\r");
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
package org.eclipse.jetty.util;
|
||||
|
||||
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
@ -325,7 +326,18 @@ public class BufferUtilTest
|
|||
assertEquals(64, b3.capacity());
|
||||
assertEquals("Cruel", BufferUtil.toString(b3));
|
||||
assertEquals(0, b3.arrayOffset());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToDetail_WithDEL()
|
||||
{
|
||||
ByteBuffer b = ByteBuffer.allocate(40);
|
||||
b.putChar('a').putChar('b').putChar('c');
|
||||
b.put((byte)0x7F);
|
||||
b.putChar('x').putChar('y').putChar('z');
|
||||
b.flip();
|
||||
String result = BufferUtil.toDetailString(b);
|
||||
assertThat("result", result, containsString("\\x7f"));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -91,11 +91,12 @@ public class XmlConfiguration
|
|||
private static final XmlParser __parser = initParser();
|
||||
private static XmlParser initParser()
|
||||
{
|
||||
ClassLoader loader = XmlConfiguration.class.getClassLoader();
|
||||
XmlParser parser = new XmlParser();
|
||||
URL config60 = Loader.getResource("org/eclipse/jetty/xml/configure_6_0.dtd");
|
||||
URL config76 = Loader.getResource("org/eclipse/jetty/xml/configure_7_6.dtd");
|
||||
URL config90 = Loader.getResource("org/eclipse/jetty/xml/configure_9_0.dtd");
|
||||
URL config93 = Loader.getResource("org/eclipse/jetty/xml/configure_9_3.dtd");
|
||||
URL config60 = loader.getResource("org/eclipse/jetty/xml/configure_6_0.dtd");
|
||||
URL config76 = loader.getResource("org/eclipse/jetty/xml/configure_7_6.dtd");
|
||||
URL config90 = loader.getResource("org/eclipse/jetty/xml/configure_9_0.dtd");
|
||||
URL config93 = loader.getResource("org/eclipse/jetty/xml/configure_9_3.dtd");
|
||||
parser.redirectEntity("configure.dtd",config90);
|
||||
parser.redirectEntity("configure_1_0.dtd",config60);
|
||||
parser.redirectEntity("configure_1_1.dtd",config60);
|
||||
|
|
Loading…
Reference in New Issue