Merge remote-tracking branch 'origin/jetty-9.4.x' into issue-1640
This commit is contained in:
commit
4bc2883412
|
@ -73,6 +73,7 @@ import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||||
import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
|
import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
|
||||||
import org.eclipse.jetty.util.thread.Scheduler;
|
import org.eclipse.jetty.util.thread.Scheduler;
|
||||||
|
import org.eclipse.jetty.util.thread.ThreadPool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>{@link HttpClient} provides an efficient, asynchronous, non-blocking implementation
|
* <p>{@link HttpClient} provides an efficient, asynchronous, non-blocking implementation
|
||||||
|
@ -204,9 +205,12 @@ public class HttpClient extends ContainerLifeCycle
|
||||||
executor = threadPool;
|
executor = threadPool;
|
||||||
}
|
}
|
||||||
addBean(executor);
|
addBean(executor);
|
||||||
|
|
||||||
if (byteBufferPool == null)
|
if (byteBufferPool == null)
|
||||||
byteBufferPool = new MappedByteBufferPool();
|
byteBufferPool = new MappedByteBufferPool(2048,
|
||||||
|
executor instanceof ThreadPool.SizedThreadPool
|
||||||
|
? ((ThreadPool.SizedThreadPool)executor).getMaxThreads()/2
|
||||||
|
: Runtime.getRuntime().availableProcessors()*2);
|
||||||
addBean(byteBufferPool);
|
addBean(byteBufferPool);
|
||||||
|
|
||||||
if (scheduler == null)
|
if (scheduler == null)
|
||||||
|
|
|
@ -2257,7 +2257,7 @@ public class Request implements HttpServletRequest
|
||||||
event.setDispatchContext(getServletContext());
|
event.setDispatchContext(getServletContext());
|
||||||
|
|
||||||
String uri = ((HttpServletRequest)servletRequest).getRequestURI();
|
String uri = ((HttpServletRequest)servletRequest).getRequestURI();
|
||||||
if (uri.startsWith(_contextPath))
|
if (_contextPath!=null && uri.startsWith(_contextPath))
|
||||||
uri = uri.substring(_contextPath.length());
|
uri = uri.substring(_contextPath.length());
|
||||||
else
|
else
|
||||||
// TODO probably need to strip encoded context from requestURI, but will do this for now:
|
// TODO probably need to strip encoded context from requestURI, but will do this for now:
|
||||||
|
|
|
@ -384,9 +384,15 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
|
||||||
os.flush();
|
os.flush();
|
||||||
|
|
||||||
// Read the response.
|
// Read the response.
|
||||||
String response = readResponse(client);
|
try
|
||||||
|
{
|
||||||
Assert.assertThat(response, Matchers.containsString("HTTP/1.1 431 "));
|
String response = readResponse(client);
|
||||||
|
Assert.assertThat(response, Matchers.containsString("HTTP/1.1 431 "));
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
// TODO evaluate why we sometimes get an early close on this test
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue