Checkstyle cleanup (#3847)
* Checkstyle cleanup * fixed bug from reformat Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
parent
9fe27eb8e3
commit
d744d097de
|
@ -38,10 +38,16 @@
|
|||
===========================================================================================
|
||||
-->
|
||||
|
||||
<module name="SuppressionCommentFilter">
|
||||
<property name="offCommentFormat" value="@checkstyle-disable-check : ([\w\|]+)"/>
|
||||
<property name="onCommentFormat" value="@checkstyle-enable-check : ([\w\|]+)"/>
|
||||
<property name="checkFormat" value="$1"/>
|
||||
</module>
|
||||
|
||||
<!-- Check abbreviations(consecutive capital letters) length in identifier name -->
|
||||
<module name="AbbreviationAsWordInName">
|
||||
<property name="ignoreFinal" value="true"/>
|
||||
<property name="allowedAbbreviations" value="RFC, XML, URL, URI, HTTP, IP, ID, ISO8859, UTF8, CRLF, AWT"/>
|
||||
<property name="allowedAbbreviations" value="ALPN, ASCII, AWT, CRLDP, CRLF, FCGI, GZIP, HTTP, HTTPS, ID, IP, ISO8859, JAAS, JDBC, JMXRMI, JNDI, JPMS, JSON, JSTL, LDAP, PROXY, RFC, SPNEGO, URI, URL, UTF8, XML"/>
|
||||
</module>
|
||||
|
||||
<!-- Location of Annotations -->
|
||||
|
@ -51,7 +57,7 @@
|
|||
|
||||
<!-- Catch Parameter Name Format -->
|
||||
<module name="CatchParameterName">
|
||||
<property name="format" value="^(e|t|x|ex|[a-z][a-z][a-zA-Z0-9]+)$"/>
|
||||
<property name="format" value="^(e|t|x|ex|th|e2|[a-z][a-z][a-zA-Z0-9]+)$"/>
|
||||
</module>
|
||||
|
||||
<!-- Class Type Parameter Name Format -->
|
||||
|
|
|
@ -130,7 +130,7 @@ public class AsyncRestServlet extends AbstractRestServlet
|
|||
// We have results!
|
||||
|
||||
// Generate the response
|
||||
String thumbs = generateThumbs(results);
|
||||
final String thumbs = generateThumbs(results);
|
||||
|
||||
response.setContentType("text/html");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
@ -194,9 +194,10 @@ public class AsyncRestServlet extends AbstractRestServlet
|
|||
onComplete();
|
||||
}
|
||||
|
||||
abstract void onComplete();
|
||||
|
||||
abstract void onAuctionFound(Map<String, String> details);
|
||||
|
||||
abstract void onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,7 +42,7 @@ public class SerialRestServlet extends AbstractRestServlet
|
|||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
|
||||
{
|
||||
long start = System.nanoTime();
|
||||
final long start = System.nanoTime();
|
||||
|
||||
String[] keywords = sanitize(request.getParameter(ITEMS_PARAM)).split(",");
|
||||
Queue<Map<String, String>> results = new LinkedList<Map<String, String>>();
|
||||
|
@ -67,7 +67,7 @@ public class SerialRestServlet extends AbstractRestServlet
|
|||
}
|
||||
|
||||
// Generate the response
|
||||
String thumbs = generateThumbs(results);
|
||||
final String thumbs = generateThumbs(results);
|
||||
|
||||
response.setContentType("text/html");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
|
|
@ -35,7 +35,7 @@ public class FileServer
|
|||
// Create a basic Jetty server object that will listen on port 8080. Note that if you set this to port 0
|
||||
// then a randomly available port will be assigned that you can either look in the logs for the port,
|
||||
// or programmatically obtain it for use in test cases.
|
||||
Server server = new Server(8080);
|
||||
final Server server = new Server(8080);
|
||||
|
||||
// Create the ResourceHandler. It is the object that will actually handle the request for a given file. It is
|
||||
// a Jetty Handler object so it is suitable for chaining with other handlers as you will see in other examples.
|
||||
|
|
|
@ -34,7 +34,7 @@ public class JarServer
|
|||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
final Server server = new Server(8080);
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler();
|
||||
Resource.setDefaultUseCaches(true);
|
||||
|
|
|
@ -186,10 +186,10 @@ public class LikeJettyXml
|
|||
|
||||
// === jetty-requestlog.xml ===
|
||||
AsyncRequestLogWriter logWriter = new AsyncRequestLogWriter(jettyHome + "/logs/yyyy_mm_dd.request.log");
|
||||
CustomRequestLog requestLog = new CustomRequestLog(logWriter, CustomRequestLog.EXTENDED_NCSA_FORMAT + " \"%C\"");
|
||||
logWriter.setFilenameDateFormat("yyyy_MM_dd");
|
||||
logWriter.setRetainDays(90);
|
||||
logWriter.setTimeZone("GMT");
|
||||
CustomRequestLog requestLog = new CustomRequestLog(logWriter, CustomRequestLog.EXTENDED_NCSA_FORMAT + " \"%C\"");
|
||||
server.setRequestLog(requestLog);
|
||||
|
||||
// === jetty-lowresources.xml ===
|
||||
|
|
|
@ -27,7 +27,7 @@ public class ManyContexts
|
|||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
final Server server = new Server(8080);
|
||||
|
||||
ContextHandler context = new ContextHandler("/");
|
||||
context.setContextPath("/");
|
||||
|
|
|
@ -106,13 +106,13 @@ public class ManyHandlers
|
|||
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
final Server server = new Server(8080);
|
||||
|
||||
// create the handlers
|
||||
Handler param = new ParamHandler();
|
||||
HandlerWrapper wrapper = new WelcomeWrapHandler();
|
||||
Handler hello = new HelloHandler();
|
||||
Handler dft = new DefaultHandler();
|
||||
final Handler param = new ParamHandler();
|
||||
final HandlerWrapper wrapper = new WelcomeWrapHandler();
|
||||
final Handler hello = new HelloHandler();
|
||||
final Handler dft = new DefaultHandler();
|
||||
|
||||
// configure request logging
|
||||
File requestLogFile = File.createTempFile("demo", "log");
|
||||
|
|
|
@ -39,7 +39,7 @@ public class ServerWithAnnotations
|
|||
public static final void main(String[] args) throws Exception
|
||||
{
|
||||
// Create the server
|
||||
Server server = new Server(8080);
|
||||
final Server server = new Server(8080);
|
||||
|
||||
// Create a WebApp
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
|
|
|
@ -48,7 +48,7 @@ public class WebSocketJsrServer
|
|||
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
final Server server = new Server(8080);
|
||||
|
||||
HandlerList handlers = new HandlerList();
|
||||
|
||||
|
|
|
@ -428,8 +428,6 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
AnnotationParser parser = createAnnotationParser(javaPlatform);
|
||||
_parserTasks = new ArrayList<ParserTask>();
|
||||
|
||||
long start = 0;
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Annotation scanning commencing: webxml={}, metadatacomplete={}, configurationDiscovered={}, multiThreaded={}, maxScanWait={}",
|
||||
context.getServletContext().getEffectiveMajorVersion(),
|
||||
|
@ -447,7 +445,7 @@ public class AnnotationConfiguration extends AbstractConfiguration
|
|||
parseWebInfClasses(context, parser);
|
||||
parseWebInfLib(context, parser);
|
||||
|
||||
start = System.nanoTime();
|
||||
long start = System.nanoTime();
|
||||
|
||||
//execute scan, either effectively synchronously (1 thread only), or asynchronously (limited by number of processors available)
|
||||
final Semaphore task_limit = (isUseMultiThreading(context) ? new Semaphore(ProcessorUtils.availableProcessors()) : new Semaphore(1));
|
||||
|
|
|
@ -694,68 +694,6 @@ public class AnnotationParser
|
|||
me.ifExceptionThrow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse all classes in a directory
|
||||
*
|
||||
* @param handlers the set of handlers to look for classes in
|
||||
* @param root the resource directory to look for classes
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
protected void parseDir(Set<? extends Handler> handlers, Resource root) throws Exception
|
||||
{
|
||||
if (!root.isDirectory() || !root.exists() || root.getName().startsWith("."))
|
||||
return;
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Scanning dir {}", root);
|
||||
|
||||
File rootFile = root.getFile();
|
||||
|
||||
MultiException me = new MultiException();
|
||||
Collection<Resource> resources = root.getAllResources();
|
||||
if (resources != null)
|
||||
{
|
||||
for (Resource r : resources)
|
||||
{
|
||||
if (r.isDirectory())
|
||||
continue;
|
||||
|
||||
File file = r.getFile();
|
||||
if (isValidClassFileName((file == null ? null : file.getName())))
|
||||
{
|
||||
Path classpath = rootFile.toPath().relativize(file.toPath());
|
||||
String str = classpath.toString();
|
||||
str = str.substring(0, str.lastIndexOf(".class"));
|
||||
str = StringUtil.replace(str, File.separatorChar, '.');
|
||||
|
||||
try
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Scanning class {}", r);
|
||||
addParsedClass(str, r);
|
||||
try (InputStream is = r.getInputStream())
|
||||
{
|
||||
scanClass(handlers, Resource.newResource(file.getParentFile()), is);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Error scanning file " + file, ex);
|
||||
me.add(new RuntimeException("Error scanning file " + file, ex));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Skipping scan on invalid file {}", file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
me.ifExceptionThrow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse classes in the supplied uris.
|
||||
*
|
||||
|
@ -837,6 +775,68 @@ public class AnnotationParser
|
|||
LOG.warn("Resource not scannable for classes: {}", r);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse all classes in a directory
|
||||
*
|
||||
* @param handlers the set of handlers to look for classes in
|
||||
* @param root the resource directory to look for classes
|
||||
* @throws Exception if unable to parse
|
||||
*/
|
||||
protected void parseDir(Set<? extends Handler> handlers, Resource root) throws Exception
|
||||
{
|
||||
if (!root.isDirectory() || !root.exists() || root.getName().startsWith("."))
|
||||
return;
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Scanning dir {}", root);
|
||||
|
||||
File rootFile = root.getFile();
|
||||
|
||||
MultiException me = new MultiException();
|
||||
Collection<Resource> resources = root.getAllResources();
|
||||
if (resources != null)
|
||||
{
|
||||
for (Resource r : resources)
|
||||
{
|
||||
if (r.isDirectory())
|
||||
continue;
|
||||
|
||||
File file = r.getFile();
|
||||
if (isValidClassFileName((file == null ? null : file.getName())))
|
||||
{
|
||||
Path classpath = rootFile.toPath().relativize(file.toPath());
|
||||
String str = classpath.toString();
|
||||
str = str.substring(0, str.lastIndexOf(".class"));
|
||||
str = StringUtil.replace(str, File.separatorChar, '.');
|
||||
|
||||
try
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Scanning class {}", r);
|
||||
addParsedClass(str, r);
|
||||
try (InputStream is = r.getInputStream())
|
||||
{
|
||||
scanClass(handlers, Resource.newResource(file.getParentFile()), is);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Error scanning file " + file, ex);
|
||||
me.add(new RuntimeException("Error scanning file " + file, ex));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Skipping scan on invalid file {}", file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
me.ifExceptionThrow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a resource that is a jar file.
|
||||
*
|
||||
|
|
|
@ -201,12 +201,6 @@ public class AntWebAppContext extends WebAppContext
|
|||
return super.findClass(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Package definePackage(String name, Manifest man, URL url) throws IllegalArgumentException
|
||||
{
|
||||
return super.definePackage(name, man, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL findResource(String name)
|
||||
{
|
||||
|
@ -255,6 +249,12 @@ public class AntWebAppContext extends WebAppContext
|
|||
return super.getResources(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Package definePackage(String name, Manifest man, URL url) throws IllegalArgumentException
|
||||
{
|
||||
return super.definePackage(name, man, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Package definePackage(String name, String specTitle, String specVersion, String specVendor, String implTitle, String implVersion,
|
||||
String implVendor, URL sealBase) throws IllegalArgumentException
|
||||
|
|
|
@ -484,14 +484,12 @@ public class ServerProxyImpl implements ServerProxy
|
|||
if (scanIntervalSecs <= 0)
|
||||
return;
|
||||
|
||||
List<File> scanList = awc.getScanFiles();
|
||||
|
||||
TaskLog.log("Web application '" + awc + "': starting scanner at interval of " + scanIntervalSecs + " seconds.");
|
||||
Scanner.Listener changeListener = new WebAppScannerListener(awc);
|
||||
Scanner scanner = new Scanner();
|
||||
scanner.setScanInterval(scanIntervalSecs);
|
||||
scanner.addListener(changeListener);
|
||||
scanner.setScanDirs(scanList);
|
||||
scanner.setScanDirs(awc.getScanFiles());
|
||||
scanner.setReportExistingFilesOnStartup(false);
|
||||
scanner.start();
|
||||
}
|
||||
|
|
|
@ -79,12 +79,54 @@ public abstract class HttpConnection implements IConnection
|
|||
httpRequest.abort(result.failure);
|
||||
}
|
||||
|
||||
protected SendFailure send(HttpChannel channel, HttpExchange exchange)
|
||||
{
|
||||
// Forbid idle timeouts for the time window where
|
||||
// the request is associated to the channel and sent.
|
||||
// Use a counter to support multiplexed requests.
|
||||
boolean send;
|
||||
synchronized (this)
|
||||
{
|
||||
send = idleTimeoutGuard >= 0;
|
||||
if (send)
|
||||
++idleTimeoutGuard;
|
||||
}
|
||||
|
||||
if (send)
|
||||
{
|
||||
HttpRequest request = exchange.getRequest();
|
||||
SendFailure result;
|
||||
if (channel.associate(exchange))
|
||||
{
|
||||
channel.send();
|
||||
result = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
channel.release();
|
||||
result = new SendFailure(new HttpRequestException("Could not associate request to connection", request), false);
|
||||
}
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
--idleTimeoutGuard;
|
||||
idleTimeoutStamp = System.nanoTime();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new SendFailure(new TimeoutException(), true);
|
||||
}
|
||||
}
|
||||
|
||||
protected void normalizeRequest(Request request)
|
||||
{
|
||||
HttpVersion version = request.getVersion();
|
||||
HttpFields headers = request.getHeaders();
|
||||
ContentProvider content = request.getContent();
|
||||
ProxyConfiguration.Proxy proxy = destination.getProxy();
|
||||
final HttpVersion version = request.getVersion();
|
||||
final HttpFields headers = request.getHeaders();
|
||||
final ContentProvider content = request.getContent();
|
||||
final ProxyConfiguration.Proxy proxy = destination.getProxy();
|
||||
|
||||
// Make sure the path is there
|
||||
String path = request.getPath();
|
||||
|
@ -176,48 +218,6 @@ public abstract class HttpConnection implements IConnection
|
|||
}
|
||||
}
|
||||
|
||||
protected SendFailure send(HttpChannel channel, HttpExchange exchange)
|
||||
{
|
||||
// Forbid idle timeouts for the time window where
|
||||
// the request is associated to the channel and sent.
|
||||
// Use a counter to support multiplexed requests.
|
||||
boolean send;
|
||||
synchronized (this)
|
||||
{
|
||||
send = idleTimeoutGuard >= 0;
|
||||
if (send)
|
||||
++idleTimeoutGuard;
|
||||
}
|
||||
|
||||
if (send)
|
||||
{
|
||||
HttpRequest request = exchange.getRequest();
|
||||
SendFailure result;
|
||||
if (channel.associate(exchange))
|
||||
{
|
||||
channel.send();
|
||||
result = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
channel.release();
|
||||
result = new SendFailure(new HttpRequestException("Could not associate request to connection", request), false);
|
||||
}
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
--idleTimeoutGuard;
|
||||
idleTimeoutStamp = System.nanoTime();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new SendFailure(new TimeoutException(), true);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onIdleTimeout(long idleTimeout)
|
||||
{
|
||||
synchronized (this)
|
||||
|
|
|
@ -304,11 +304,6 @@ public class HttpDestination extends ContainerLifeCycle implements Destination,
|
|||
}
|
||||
}
|
||||
|
||||
protected boolean enqueue(Queue<HttpExchange> queue, HttpExchange exchange)
|
||||
{
|
||||
return queue.offer(exchange);
|
||||
}
|
||||
|
||||
public void send()
|
||||
{
|
||||
if (getHttpExchanges().isEmpty())
|
||||
|
@ -316,6 +311,11 @@ public class HttpDestination extends ContainerLifeCycle implements Destination,
|
|||
process();
|
||||
}
|
||||
|
||||
protected boolean enqueue(Queue<HttpExchange> queue, HttpExchange exchange)
|
||||
{
|
||||
return queue.offer(exchange);
|
||||
}
|
||||
|
||||
private void process()
|
||||
{
|
||||
while (true)
|
||||
|
@ -396,6 +396,11 @@ public class HttpDestination extends ContainerLifeCycle implements Destination,
|
|||
return exchanges.remove(exchange);
|
||||
}
|
||||
|
||||
public boolean remove(Connection connection)
|
||||
{
|
||||
return connectionPool.remove(connection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close()
|
||||
{
|
||||
|
@ -406,6 +411,24 @@ public class HttpDestination extends ContainerLifeCycle implements Destination,
|
|||
timeout.destroy();
|
||||
}
|
||||
|
||||
public void close(Connection connection)
|
||||
{
|
||||
boolean removed = remove(connection);
|
||||
|
||||
if (getHttpExchanges().isEmpty())
|
||||
{
|
||||
tryRemoveIdleDestination();
|
||||
}
|
||||
else
|
||||
{
|
||||
// We need to execute queued requests even if this connection failed.
|
||||
// We may create a connection that is not needed, but it will eventually
|
||||
// idle timeout, so no worries.
|
||||
if (removed)
|
||||
process();
|
||||
}
|
||||
}
|
||||
|
||||
public void release(Connection connection)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
|
@ -434,29 +457,6 @@ public class HttpDestination extends ContainerLifeCycle implements Destination,
|
|||
}
|
||||
}
|
||||
|
||||
public boolean remove(Connection connection)
|
||||
{
|
||||
return connectionPool.remove(connection);
|
||||
}
|
||||
|
||||
public void close(Connection connection)
|
||||
{
|
||||
boolean removed = remove(connection);
|
||||
|
||||
if (getHttpExchanges().isEmpty())
|
||||
{
|
||||
tryRemoveIdleDestination();
|
||||
}
|
||||
else
|
||||
{
|
||||
// We need to execute queued requests even if this connection failed.
|
||||
// We may create a connection that is not needed, but it will eventually
|
||||
// idle timeout, so no worries.
|
||||
if (removed)
|
||||
process();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Aborts all the {@link HttpExchange}s queued in this destination.
|
||||
*
|
||||
|
|
|
@ -116,12 +116,13 @@ public abstract class HttpReceiver
|
|||
if (!updateResponseState(ResponseState.IDLE, ResponseState.TRANSIENT))
|
||||
return false;
|
||||
|
||||
HttpConversation conversation = exchange.getConversation();
|
||||
HttpResponse response = exchange.getResponse();
|
||||
final HttpConversation conversation = exchange.getConversation();
|
||||
final HttpResponse response = exchange.getResponse();
|
||||
// Probe the protocol handlers
|
||||
HttpDestination destination = getHttpDestination();
|
||||
HttpClient client = destination.getHttpClient();
|
||||
ProtocolHandler protocolHandler = client.findProtocolHandler(exchange.getRequest(), response);
|
||||
final HttpDestination destination = getHttpDestination();
|
||||
final HttpClient client = destination.getHttpClient();
|
||||
final ProtocolHandler protocolHandler = client.findProtocolHandler(exchange.getRequest(), response);
|
||||
|
||||
Response.Listener handlerListener = null;
|
||||
if (protocolHandler != null)
|
||||
{
|
||||
|
|
|
@ -175,58 +175,6 @@ public class HttpRedirector
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts and sanitizes (by making it absolute and escaping paths and query parameters)
|
||||
* the redirect URI of the given {@code response}.
|
||||
*
|
||||
* @param response the response to extract the redirect URI from
|
||||
* @return the absolute redirect URI, or null if the response does not contain a valid redirect location
|
||||
*/
|
||||
public URI extractRedirectURI(Response response)
|
||||
{
|
||||
String location = response.getHeaders().get("location");
|
||||
if (location != null)
|
||||
return sanitize(location);
|
||||
return null;
|
||||
}
|
||||
|
||||
private URI sanitize(String location)
|
||||
{
|
||||
// Redirects should be valid, absolute, URIs, with properly escaped paths and encoded
|
||||
// query parameters. However, shit happens, and here we try our best to recover.
|
||||
|
||||
try
|
||||
{
|
||||
// Direct hit first: if passes, we're good
|
||||
return new URI(location);
|
||||
}
|
||||
catch (URISyntaxException x)
|
||||
{
|
||||
Matcher matcher = URI_PATTERN.matcher(location);
|
||||
if (matcher.matches())
|
||||
{
|
||||
String scheme = matcher.group(2);
|
||||
String authority = matcher.group(3);
|
||||
String path = matcher.group(4);
|
||||
String query = matcher.group(5);
|
||||
if (query.length() == 0)
|
||||
query = null;
|
||||
String fragment = matcher.group(6);
|
||||
if (fragment.length() == 0)
|
||||
fragment = null;
|
||||
try
|
||||
{
|
||||
return new URI(scheme, authority, path, query, fragment);
|
||||
}
|
||||
catch (URISyntaxException ex)
|
||||
{
|
||||
// Give up
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Request redirect(Request request, Response response, Response.CompleteListener listener, URI newURI)
|
||||
{
|
||||
if (!newURI.isAbsolute())
|
||||
|
@ -307,6 +255,58 @@ public class HttpRedirector
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts and sanitizes (by making it absolute and escaping paths and query parameters)
|
||||
* the redirect URI of the given {@code response}.
|
||||
*
|
||||
* @param response the response to extract the redirect URI from
|
||||
* @return the absolute redirect URI, or null if the response does not contain a valid redirect location
|
||||
*/
|
||||
public URI extractRedirectURI(Response response)
|
||||
{
|
||||
String location = response.getHeaders().get("location");
|
||||
if (location != null)
|
||||
return sanitize(location);
|
||||
return null;
|
||||
}
|
||||
|
||||
private URI sanitize(String location)
|
||||
{
|
||||
// Redirects should be valid, absolute, URIs, with properly escaped paths and encoded
|
||||
// query parameters. However, shit happens, and here we try our best to recover.
|
||||
|
||||
try
|
||||
{
|
||||
// Direct hit first: if passes, we're good
|
||||
return new URI(location);
|
||||
}
|
||||
catch (URISyntaxException x)
|
||||
{
|
||||
Matcher matcher = URI_PATTERN.matcher(location);
|
||||
if (matcher.matches())
|
||||
{
|
||||
String scheme = matcher.group(2);
|
||||
String authority = matcher.group(3);
|
||||
String path = matcher.group(4);
|
||||
String query = matcher.group(5);
|
||||
if (query.length() == 0)
|
||||
query = null;
|
||||
String fragment = matcher.group(6);
|
||||
if (fragment.length() == 0)
|
||||
fragment = null;
|
||||
try
|
||||
{
|
||||
return new URI(scheme, authority, path, query, fragment);
|
||||
}
|
||||
catch (URISyntaxException ex)
|
||||
{
|
||||
// Give up
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Request sendRedirect(final HttpRequest httpRequest, Response response, Response.CompleteListener listener, URI location, String method)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -237,7 +237,7 @@ public class HttpSenderOverHTTP extends HttpSender
|
|||
}
|
||||
case FLUSH:
|
||||
{
|
||||
EndPoint endPoint = getHttpChannel().getHttpConnection().getEndPoint();
|
||||
final EndPoint endPoint = getHttpChannel().getHttpConnection().getEndPoint();
|
||||
if (headerBuffer == null)
|
||||
headerBuffer = BufferUtil.EMPTY_BUFFER;
|
||||
if (chunkBuffer == null)
|
||||
|
|
|
@ -85,7 +85,7 @@ public class DigestAuthentication extends AbstractAuthentication
|
|||
String nonce = params.get("nonce");
|
||||
if (nonce == null || nonce.length() == 0)
|
||||
return null;
|
||||
String opaque = params.get("opaque");
|
||||
final String opaque = params.get("opaque");
|
||||
String algorithm = params.get("algorithm");
|
||||
if (algorithm == null)
|
||||
algorithm = "MD5";
|
||||
|
@ -186,7 +186,7 @@ public class DigestAuthentication extends AbstractAuthentication
|
|||
clientNonce = null;
|
||||
a3 = hashA1 + ":" + nonce + ":" + hashA2;
|
||||
}
|
||||
String hashA3 = toHexString(digester.digest(a3.getBytes(StandardCharsets.ISO_8859_1)));
|
||||
final String hashA3 = toHexString(digester.digest(a3.getBytes(StandardCharsets.ISO_8859_1)));
|
||||
|
||||
StringBuilder value = new StringBuilder("Digest");
|
||||
value.append(" username=\"").append(user).append("\"");
|
||||
|
|
|
@ -365,6 +365,9 @@ public class MultiPartContentProvider extends AbstractTypedContentProvider imple
|
|||
{
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(state.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -338,6 +338,11 @@ public class DeploymentManager extends ContainerLifeCycle
|
|||
return ret;
|
||||
}
|
||||
|
||||
public Collection<App> getApps(String nodeName)
|
||||
{
|
||||
return getApps(_lifecycle.getNodeByName(nodeName));
|
||||
}
|
||||
|
||||
public List<App> getAppsWithSameContext(App app)
|
||||
{
|
||||
List<App> ret = new ArrayList<App>();
|
||||
|
@ -538,15 +543,6 @@ public class DeploymentManager extends ContainerLifeCycle
|
|||
}
|
||||
}
|
||||
|
||||
private synchronized void addOnStartupError(Throwable cause)
|
||||
{
|
||||
if (onStartupErrors == null)
|
||||
{
|
||||
onStartupErrors = new MultiException();
|
||||
}
|
||||
onStartupErrors.add(cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Move an {@link App} through the {@link AppLifeCycle} to the desired {@link Node}, executing each lifecycle step
|
||||
* in the process to reach the desired state.
|
||||
|
@ -565,6 +561,15 @@ public class DeploymentManager extends ContainerLifeCycle
|
|||
requestAppGoal(appentry, nodeName);
|
||||
}
|
||||
|
||||
private synchronized void addOnStartupError(Throwable cause)
|
||||
{
|
||||
if (onStartupErrors == null)
|
||||
{
|
||||
onStartupErrors = new MultiException();
|
||||
}
|
||||
onStartupErrors.add(cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a contextAttribute that will be set for every Context deployed by this provider.
|
||||
*
|
||||
|
@ -628,11 +633,6 @@ public class DeploymentManager extends ContainerLifeCycle
|
|||
return _lifecycle.getNodes();
|
||||
}
|
||||
|
||||
public Collection<App> getApps(String nodeName)
|
||||
{
|
||||
return getApps(_lifecycle.getNodeByName(nodeName));
|
||||
}
|
||||
|
||||
public void scope(XmlConfiguration xmlc, Resource webapp)
|
||||
throws IOException
|
||||
{
|
||||
|
|
|
@ -56,12 +56,6 @@ public class DeploymentManagerMBean extends ObjectMBean
|
|||
return ret;
|
||||
}
|
||||
|
||||
@ManagedOperation(value = "list nodes that are tracked by DeploymentManager", impact = "INFO")
|
||||
public Collection<String> getNodes()
|
||||
{
|
||||
return _manager.getNodes().stream().map(Node::getName).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@ManagedOperation(value = "list apps that are located at specified App LifeCycle nodes", impact = "ACTION")
|
||||
public Collection<String> getApps(@Name("nodeName") String nodeName)
|
||||
{
|
||||
|
@ -82,6 +76,12 @@ public class DeploymentManagerMBean extends ObjectMBean
|
|||
return ret;
|
||||
}
|
||||
|
||||
@ManagedOperation(value = "list nodes that are tracked by DeploymentManager", impact = "INFO")
|
||||
public Collection<String> getNodes()
|
||||
{
|
||||
return _manager.getNodes().stream().map(Node::getName).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private String toRef(App app)
|
||||
{
|
||||
return String.format("originId=%s,contextPath=%s,appProvider=%s", app.getContextPath(), app.getOriginId(), app.getAppProvider().getClass().getName());
|
||||
|
|
|
@ -62,7 +62,7 @@ public class StreamContentParser extends ContentParser
|
|||
int length = Math.min(contentLength, buffer.remaining());
|
||||
int limit = buffer.limit();
|
||||
buffer.limit(buffer.position() + length);
|
||||
ByteBuffer slice = buffer.slice();
|
||||
final ByteBuffer slice = buffer.slice();
|
||||
buffer.position(buffer.limit());
|
||||
buffer.limit(limit);
|
||||
contentLength -= length;
|
||||
|
|
|
@ -904,14 +904,14 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
|
|||
return null;
|
||||
|
||||
//turn an Entity into a Session
|
||||
String id = entity.getString(_model.getId());
|
||||
String contextPath = entity.getString(_model.getContextPath());
|
||||
String vhost = entity.getString(_model.getVhost());
|
||||
long accessed = entity.getLong(_model.getAccessed());
|
||||
long lastAccessed = entity.getLong(_model.getLastAccessed());
|
||||
long createTime = entity.getLong(_model.getCreateTime());
|
||||
long cookieSet = entity.getLong(_model.getCookieSetTime());
|
||||
String lastNode = entity.getString(_model.getLastNode());
|
||||
final String id = entity.getString(_model.getId());
|
||||
final String contextPath = entity.getString(_model.getContextPath());
|
||||
final String vhost = entity.getString(_model.getVhost());
|
||||
final long accessed = entity.getLong(_model.getAccessed());
|
||||
final long lastAccessed = entity.getLong(_model.getLastAccessed());
|
||||
final long createTime = entity.getLong(_model.getCreateTime());
|
||||
final long cookieSet = entity.getLong(_model.getCookieSetTime());
|
||||
final String lastNode = entity.getString(_model.getLastNode());
|
||||
|
||||
long lastSaved = 0;
|
||||
//for compatibility with previously saved sessions, lastSaved may not be present
|
||||
|
|
|
@ -77,17 +77,17 @@ public class SessionDataSerializer implements StreamSerializer<SessionData>
|
|||
@Override
|
||||
public SessionData read(ObjectDataInput in) throws IOException
|
||||
{
|
||||
String id = in.readUTF();
|
||||
String contextPath = in.readUTF();
|
||||
String vhost = in.readUTF();
|
||||
final String id = in.readUTF();
|
||||
final String contextPath = in.readUTF();
|
||||
final String vhost = in.readUTF();
|
||||
|
||||
long accessed = in.readLong();
|
||||
long lastAccessed = in.readLong();
|
||||
long created = in.readLong();
|
||||
long cookieSet = in.readLong();
|
||||
String lastNode = in.readUTF();
|
||||
long expiry = in.readLong();
|
||||
long maxInactiveMs = in.readLong();
|
||||
final long accessed = in.readLong();
|
||||
final long lastAccessed = in.readLong();
|
||||
final long created = in.readLong();
|
||||
final long cookieSet = in.readLong();
|
||||
final String lastNode = in.readUTF();
|
||||
final long expiry = in.readLong();
|
||||
final long maxInactiveMs = in.readLong();
|
||||
|
||||
SessionData sd = new SessionData(id, contextPath, vhost, created, accessed, lastAccessed, maxInactiveMs);
|
||||
|
||||
|
|
|
@ -259,6 +259,12 @@ public class JettyHttpServer extends com.sun.net.httpserver.HttpServer
|
|||
return context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpContext createContext(String path)
|
||||
{
|
||||
return createContext(path, null);
|
||||
}
|
||||
|
||||
private void checkIfContextIsFree(String path)
|
||||
{
|
||||
Handler serverHandler = _server.getHandler();
|
||||
|
@ -284,12 +290,6 @@ public class JettyHttpServer extends com.sun.net.httpserver.HttpServer
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpContext createContext(String path)
|
||||
{
|
||||
return createContext(path, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeContext(String path) throws IllegalArgumentException
|
||||
{
|
||||
|
|
|
@ -101,16 +101,16 @@ public class DateGenerator
|
|||
buf.setLength(0);
|
||||
gc.setTimeInMillis(date);
|
||||
|
||||
int dayOfWeek = gc.get(Calendar.DAY_OF_WEEK);
|
||||
int dayOfMonth = gc.get(Calendar.DAY_OF_MONTH);
|
||||
int month = gc.get(Calendar.MONTH);
|
||||
int year = gc.get(Calendar.YEAR);
|
||||
int century = year / 100;
|
||||
year = year % 100;
|
||||
final int dayOfWeek = gc.get(Calendar.DAY_OF_WEEK);
|
||||
final int dayOfMonth = gc.get(Calendar.DAY_OF_MONTH);
|
||||
final int month = gc.get(Calendar.MONTH);
|
||||
final int fullYear = gc.get(Calendar.YEAR);
|
||||
final int century = fullYear / 100;
|
||||
final int year = fullYear % 100;
|
||||
|
||||
int hours = gc.get(Calendar.HOUR_OF_DAY);
|
||||
int minutes = gc.get(Calendar.MINUTE);
|
||||
int seconds = gc.get(Calendar.SECOND);
|
||||
final int hours = gc.get(Calendar.HOUR_OF_DAY);
|
||||
final int minutes = gc.get(Calendar.MINUTE);
|
||||
final int seconds = gc.get(Calendar.SECOND);
|
||||
|
||||
buf.append(DAYS[dayOfWeek]);
|
||||
buf.append(',');
|
||||
|
@ -143,17 +143,17 @@ public class DateGenerator
|
|||
{
|
||||
gc.setTimeInMillis(date);
|
||||
|
||||
int dayOfWeek = gc.get(Calendar.DAY_OF_WEEK);
|
||||
int dayOfMonth = gc.get(Calendar.DAY_OF_MONTH);
|
||||
int month = gc.get(Calendar.MONTH);
|
||||
int year = gc.get(Calendar.YEAR);
|
||||
year = year % 10000;
|
||||
final int dayOfWeek = gc.get(Calendar.DAY_OF_WEEK);
|
||||
final int dayOfMonth = gc.get(Calendar.DAY_OF_MONTH);
|
||||
final int month = gc.get(Calendar.MONTH);
|
||||
final int fullYear = gc.get(Calendar.YEAR);
|
||||
final int year = fullYear % 10000;
|
||||
|
||||
int epoch = (int)((date / 1000) % (60 * 60 * 24));
|
||||
int seconds = epoch % 60;
|
||||
epoch = epoch / 60;
|
||||
int minutes = epoch % 60;
|
||||
int hours = epoch / 60;
|
||||
final int epochSec = (int)((date / 1000) % (60 * 60 * 24));
|
||||
final int seconds = epochSec % 60;
|
||||
final int epoch = epochSec / 60;
|
||||
final int minutes = epoch % 60;
|
||||
final int hours = epoch / 60;
|
||||
|
||||
buf.append(DAYS[dayOfWeek]);
|
||||
buf.append(',');
|
||||
|
|
|
@ -36,19 +36,19 @@ public class DateParser
|
|||
}
|
||||
|
||||
static final String[] DATE_RECEIVE_FMT =
|
||||
{
|
||||
"EEE, dd MMM yyyy HH:mm:ss zzz",
|
||||
"EEE, dd-MMM-yy HH:mm:ss",
|
||||
"EEE MMM dd HH:mm:ss yyyy",
|
||||
{
|
||||
"EEE, dd MMM yyyy HH:mm:ss zzz",
|
||||
"EEE, dd-MMM-yy HH:mm:ss",
|
||||
"EEE MMM dd HH:mm:ss yyyy",
|
||||
|
||||
"EEE, dd MMM yyyy HH:mm:ss", "EEE dd MMM yyyy HH:mm:ss zzz",
|
||||
"EEE dd MMM yyyy HH:mm:ss", "EEE MMM dd yyyy HH:mm:ss zzz", "EEE MMM dd yyyy HH:mm:ss",
|
||||
"EEE MMM-dd-yyyy HH:mm:ss zzz", "EEE MMM-dd-yyyy HH:mm:ss", "dd MMM yyyy HH:mm:ss zzz",
|
||||
"dd MMM yyyy HH:mm:ss", "dd-MMM-yy HH:mm:ss zzz", "dd-MMM-yy HH:mm:ss", "MMM dd HH:mm:ss yyyy zzz",
|
||||
"MMM dd HH:mm:ss yyyy", "EEE MMM dd HH:mm:ss yyyy zzz",
|
||||
"EEE, MMM dd HH:mm:ss yyyy zzz", "EEE, MMM dd HH:mm:ss yyyy", "EEE, dd-MMM-yy HH:mm:ss zzz",
|
||||
"EEE dd-MMM-yy HH:mm:ss zzz", "EEE dd-MMM-yy HH:mm:ss"
|
||||
};
|
||||
"EEE, dd MMM yyyy HH:mm:ss", "EEE dd MMM yyyy HH:mm:ss zzz",
|
||||
"EEE dd MMM yyyy HH:mm:ss", "EEE MMM dd yyyy HH:mm:ss zzz", "EEE MMM dd yyyy HH:mm:ss",
|
||||
"EEE MMM-dd-yyyy HH:mm:ss zzz", "EEE MMM-dd-yyyy HH:mm:ss", "dd MMM yyyy HH:mm:ss zzz",
|
||||
"dd MMM yyyy HH:mm:ss", "dd-MMM-yy HH:mm:ss zzz", "dd-MMM-yy HH:mm:ss", "MMM dd HH:mm:ss yyyy zzz",
|
||||
"MMM dd HH:mm:ss yyyy", "EEE MMM dd HH:mm:ss yyyy zzz",
|
||||
"EEE, MMM dd HH:mm:ss yyyy zzz", "EEE, MMM dd HH:mm:ss yyyy", "EEE, dd-MMM-yy HH:mm:ss zzz",
|
||||
"EEE dd-MMM-yy HH:mm:ss zzz", "EEE dd-MMM-yy HH:mm:ss"
|
||||
};
|
||||
|
||||
public static long parseDate(String date)
|
||||
{
|
||||
|
|
|
@ -661,6 +661,39 @@ public class HttpFields implements Iterable<HttpField>
|
|||
add(field);
|
||||
}
|
||||
|
||||
public void add(HttpField field)
|
||||
{
|
||||
if (field != null)
|
||||
{
|
||||
if (_size == _fields.length)
|
||||
_fields = Arrays.copyOf(_fields, _size * 2);
|
||||
_fields[_size++] = field;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add fields from another HttpFields instance. Single valued fields are replaced, while all
|
||||
* others are added.
|
||||
*
|
||||
* @param fields the fields to add
|
||||
*/
|
||||
public void add(HttpFields fields)
|
||||
{
|
||||
if (fields == null)
|
||||
return;
|
||||
|
||||
Enumeration<String> e = fields.getFieldNames();
|
||||
while (e.hasMoreElements())
|
||||
{
|
||||
String name = e.nextElement();
|
||||
Enumeration<String> values = fields.getValues(name);
|
||||
while (values.hasMoreElements())
|
||||
{
|
||||
add(name, values.nextElement());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a field.
|
||||
*
|
||||
|
@ -873,16 +906,6 @@ public class HttpFields implements Iterable<HttpField>
|
|||
_size = 0;
|
||||
}
|
||||
|
||||
public void add(HttpField field)
|
||||
{
|
||||
if (field != null)
|
||||
{
|
||||
if (_size == _fields.length)
|
||||
_fields = Arrays.copyOf(_fields, _size * 2);
|
||||
_fields[_size++] = field;
|
||||
}
|
||||
}
|
||||
|
||||
public void addAll(HttpFields fields)
|
||||
{
|
||||
for (int i = 0; i < fields._size; i++)
|
||||
|
@ -891,29 +914,6 @@ public class HttpFields implements Iterable<HttpField>
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add fields from another HttpFields instance. Single valued fields are replaced, while all
|
||||
* others are added.
|
||||
*
|
||||
* @param fields the fields to add
|
||||
*/
|
||||
public void add(HttpFields fields)
|
||||
{
|
||||
if (fields == null)
|
||||
return;
|
||||
|
||||
Enumeration<String> e = fields.getFieldNames();
|
||||
while (e.hasMoreElements())
|
||||
{
|
||||
String name = e.nextElement();
|
||||
Enumeration<String> values = fields.getValues(name);
|
||||
while (values.hasMoreElements())
|
||||
{
|
||||
add(name, values.nextElement());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get field value without parameters. Some field values can have parameters. This method separates the
|
||||
* value from the parameters and optionally populates a map with the parameters. For example:
|
||||
|
|
|
@ -171,23 +171,6 @@ public class HttpURI
|
|||
parse(State.START, uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse according to https://tools.ietf.org/html/rfc7230#section-5.3
|
||||
*
|
||||
* @param method the request method
|
||||
* @param uri the request uri
|
||||
*/
|
||||
public void parseRequestTarget(String method, String uri)
|
||||
{
|
||||
clear();
|
||||
_uri = uri;
|
||||
|
||||
if (HttpMethod.CONNECT.is(method))
|
||||
_path = uri;
|
||||
else
|
||||
parse(uri.startsWith("/") ? State.PATH : State.START, uri);
|
||||
}
|
||||
|
||||
public void parse(String uri, int offset, int length)
|
||||
{
|
||||
clear();
|
||||
|
@ -297,6 +280,9 @@ public class HttpURI
|
|||
_path = uri.substring(mark, i);
|
||||
state = State.FRAGMENT;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -361,6 +347,9 @@ public class HttpURI
|
|||
case '[':
|
||||
state = State.IPV6;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -385,6 +374,9 @@ public class HttpURI
|
|||
state = State.PATH;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -434,6 +426,9 @@ public class HttpURI
|
|||
case '.':
|
||||
if ('/' == last)
|
||||
encoded = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -463,6 +458,8 @@ public class HttpURI
|
|||
// multiple parameters
|
||||
mark = i + 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -489,6 +486,9 @@ public class HttpURI
|
|||
i = end;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(state.toString());
|
||||
}
|
||||
last = c;
|
||||
}
|
||||
|
@ -536,6 +536,9 @@ public class HttpURI
|
|||
case QUERY:
|
||||
_query = uri.substring(mark, end);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(state.toString());
|
||||
}
|
||||
|
||||
if (!encoded)
|
||||
|
@ -547,6 +550,23 @@ public class HttpURI
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse according to https://tools.ietf.org/html/rfc7230#section-5.3
|
||||
*
|
||||
* @param method the request method
|
||||
* @param uri the request uri
|
||||
*/
|
||||
public void parseRequestTarget(String method, String uri)
|
||||
{
|
||||
clear();
|
||||
_uri = uri;
|
||||
|
||||
if (HttpMethod.CONNECT.is(method))
|
||||
_path = uri;
|
||||
else
|
||||
parse(uri.startsWith("/") ? State.PATH : State.START, uri);
|
||||
}
|
||||
|
||||
public String getScheme()
|
||||
{
|
||||
return _scheme;
|
||||
|
|
|
@ -68,15 +68,19 @@ public enum HttpVersion
|
|||
return HTTP_1_0;
|
||||
case '1':
|
||||
return HTTP_1_1;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
case '2':
|
||||
switch (bytes[position + 7])
|
||||
{
|
||||
case '0':
|
||||
return HTTP_2;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -483,14 +483,12 @@ public class MimeTypes
|
|||
else
|
||||
state = 0;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
if ('=' == b)
|
||||
state = 9;
|
||||
else if (' ' != b)
|
||||
state = 0;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
if (' ' == b)
|
||||
break;
|
||||
|
@ -504,11 +502,13 @@ public class MimeTypes
|
|||
start = i;
|
||||
state = 10;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
if (!quote && (';' == b || ' ' == b) ||
|
||||
(quote && '"' == b))
|
||||
return StringUtil.normalizeCharset(value, start, i - start);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -658,7 +658,6 @@ public class MimeTypes
|
|||
else if (' ' != b)
|
||||
state = 0;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
if (' ' == b)
|
||||
break;
|
||||
|
@ -666,7 +665,6 @@ public class MimeTypes
|
|||
builder.append(value, 0, start + 1);
|
||||
state = 10;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
if (';' == b)
|
||||
{
|
||||
|
@ -677,6 +675,9 @@ public class MimeTypes
|
|||
case 11:
|
||||
if (' ' != b)
|
||||
builder.append(b);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
if (builder == null)
|
||||
|
|
|
@ -149,6 +149,38 @@ public class MultiPartFormInputStream
|
|||
_size += length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(String fileName) throws IOException
|
||||
{
|
||||
if (_file == null)
|
||||
{
|
||||
_temporary = false;
|
||||
|
||||
// part data is only in the ByteArrayOutputStream and never been written to disk
|
||||
_file = new File(_tmpDir, fileName);
|
||||
|
||||
try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(_file)))
|
||||
{
|
||||
_bout.writeTo(bos);
|
||||
bos.flush();
|
||||
}
|
||||
finally
|
||||
{
|
||||
_bout = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// the part data is already written to a temporary file, just rename it
|
||||
_temporary = false;
|
||||
|
||||
Path src = _file.toPath();
|
||||
Path target = src.resolveSibling(fileName);
|
||||
Files.move(src, target, StandardCopyOption.REPLACE_EXISTING);
|
||||
_file = target.toFile();
|
||||
}
|
||||
}
|
||||
|
||||
protected void createFile() throws IOException
|
||||
{
|
||||
/*
|
||||
|
@ -248,38 +280,6 @@ public class MultiPartFormInputStream
|
|||
return _size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(String fileName) throws IOException
|
||||
{
|
||||
if (_file == null)
|
||||
{
|
||||
_temporary = false;
|
||||
|
||||
// part data is only in the ByteArrayOutputStream and never been written to disk
|
||||
_file = new File(_tmpDir, fileName);
|
||||
|
||||
try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(_file)))
|
||||
{
|
||||
_bout.writeTo(bos);
|
||||
bos.flush();
|
||||
}
|
||||
finally
|
||||
{
|
||||
_bout = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// the part data is already written to a temporary file, just rename it
|
||||
_temporary = false;
|
||||
|
||||
Path src = _file.toPath();
|
||||
Path target = src.resolveSibling(fileName);
|
||||
Files.move(src, target, StandardCopyOption.REPLACE_EXISTING);
|
||||
_file = target.toFile();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the file, whether or not Part.write() was called on it (ie no longer temporary)
|
||||
*/
|
||||
|
|
|
@ -133,6 +133,8 @@ public abstract class QuotedCSVParser
|
|||
if (!_keepQuotes)
|
||||
continue;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -194,7 +196,10 @@ public abstract class QuotedCSVParser
|
|||
case PARAM_VALUE:
|
||||
parsedParam(buffer, valueLength, paramName, paramValue);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException(state.toString());
|
||||
}
|
||||
|
||||
parsedValueAndParams(buffer);
|
||||
}
|
||||
buffer.setLength(0);
|
||||
|
@ -209,9 +214,9 @@ public abstract class QuotedCSVParser
|
|||
{
|
||||
case VALUE:
|
||||
// It wasn't really a value, it was a param name
|
||||
valueLength = paramName = 0;
|
||||
paramName = 0;
|
||||
buffer.setLength(nwsLength); // trim following OWS
|
||||
String param = buffer.toString();
|
||||
final String param = buffer.toString();
|
||||
buffer.setLength(0);
|
||||
parsedValue(buffer);
|
||||
valueLength = buffer.length();
|
||||
|
@ -234,8 +239,10 @@ public abstract class QuotedCSVParser
|
|||
buffer.append(c);
|
||||
nwsLength = buffer.length();
|
||||
continue;
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(state.toString());
|
||||
}
|
||||
continue;
|
||||
|
||||
default:
|
||||
{
|
||||
|
@ -265,6 +272,9 @@ public abstract class QuotedCSVParser
|
|||
nwsLength = buffer.length();
|
||||
continue;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(state.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -271,6 +271,8 @@ public class PathMappings<E> implements Iterable<MappedResource<E>>, Dumpable
|
|||
case SUFFIX_GLOB:
|
||||
_suffixMap.remove(pathSpec.getSuffix());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Iterator<MappedResource<E>> iter = _mappings.iterator();
|
||||
|
|
|
@ -241,6 +241,8 @@ public class ServletPathSpec extends PathSpec
|
|||
case '/':
|
||||
super.pathDepth++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,24 +51,24 @@ public class HTTP2ClientConnectionFactory implements ClientConnectionFactory
|
|||
@Override
|
||||
public Connection newConnection(EndPoint endPoint, Map<String, Object> context)
|
||||
{
|
||||
HTTP2Client client = (HTTP2Client)context.get(CLIENT_CONTEXT_KEY);
|
||||
ByteBufferPool byteBufferPool = client.getByteBufferPool();
|
||||
Executor executor = client.getExecutor();
|
||||
Scheduler scheduler = client.getScheduler();
|
||||
Session.Listener listener = (Session.Listener)context.get(SESSION_LISTENER_CONTEXT_KEY);
|
||||
final HTTP2Client client = (HTTP2Client)context.get(CLIENT_CONTEXT_KEY);
|
||||
final ByteBufferPool byteBufferPool = client.getByteBufferPool();
|
||||
final Executor executor = client.getExecutor();
|
||||
final Scheduler scheduler = client.getScheduler();
|
||||
final Session.Listener listener = (Session.Listener)context.get(SESSION_LISTENER_CONTEXT_KEY);
|
||||
@SuppressWarnings("unchecked")
|
||||
Promise<Session> promise = (Promise<Session>)context.get(SESSION_PROMISE_CONTEXT_KEY);
|
||||
final Promise<Session> promise = (Promise<Session>)context.get(SESSION_PROMISE_CONTEXT_KEY);
|
||||
|
||||
Generator generator = new Generator(byteBufferPool);
|
||||
FlowControlStrategy flowControl = client.getFlowControlStrategyFactory().newFlowControlStrategy();
|
||||
HTTP2ClientSession session = new HTTP2ClientSession(scheduler, endPoint, generator, listener, flowControl);
|
||||
final Generator generator = new Generator(byteBufferPool);
|
||||
final FlowControlStrategy flowControl = client.getFlowControlStrategyFactory().newFlowControlStrategy();
|
||||
final HTTP2ClientSession session = new HTTP2ClientSession(scheduler, endPoint, generator, listener, flowControl);
|
||||
session.setMaxRemoteStreams(client.getMaxConcurrentPushedStreams());
|
||||
|
||||
Parser parser = new Parser(byteBufferPool, session, 4096, 8192);
|
||||
final Parser parser = new Parser(byteBufferPool, session, 4096, 8192);
|
||||
parser.setMaxFrameLength(client.getMaxFrameLength());
|
||||
parser.setMaxSettingsKeys(client.getMaxSettingsKeys());
|
||||
|
||||
HTTP2ClientConnection connection = new HTTP2ClientConnection(client, byteBufferPool, executor, endPoint,
|
||||
final HTTP2ClientConnection connection = new HTTP2ClientConnection(client, byteBufferPool, executor, endPoint,
|
||||
parser, session, client.getInputBufferSize(), promise, listener);
|
||||
connection.addListener(connectionListener);
|
||||
return customize(connection, context);
|
||||
|
|
|
@ -39,284 +39,284 @@ public class HTTP2Cipher
|
|||
}
|
||||
|
||||
String[] ciphers =
|
||||
{
|
||||
"TLS_NULL_WITH_NULL_NULL",
|
||||
"TLS_RSA_WITH_NULL_MD5",
|
||||
"TLS_RSA_WITH_NULL_SHA",
|
||||
"TLS_RSA_EXPORT_WITH_RC4_40_MD5",
|
||||
"TLS_RSA_WITH_RC4_128_MD5",
|
||||
"TLS_RSA_WITH_RC4_128_SHA",
|
||||
"TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5",
|
||||
"TLS_RSA_WITH_IDEA_CBC_SHA",
|
||||
"TLS_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_RSA_WITH_DES_CBC_SHA",
|
||||
"TLS_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_DES_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_DES_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_DES_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_DES_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DH_anon_EXPORT_WITH_RC4_40_MD5",
|
||||
"TLS_DH_anon_WITH_RC4_128_MD5",
|
||||
"TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_DES_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_KRB5_WITH_DES_CBC_SHA",
|
||||
"TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_KRB5_WITH_RC4_128_SHA",
|
||||
"TLS_KRB5_WITH_IDEA_CBC_SHA",
|
||||
"TLS_KRB5_WITH_DES_CBC_MD5",
|
||||
"TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
|
||||
"TLS_KRB5_WITH_RC4_128_MD5",
|
||||
"TLS_KRB5_WITH_IDEA_CBC_MD5",
|
||||
"TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
|
||||
"TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA",
|
||||
"TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
|
||||
"TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
|
||||
"TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5",
|
||||
"TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
|
||||
"TLS_PSK_WITH_NULL_SHA",
|
||||
"TLS_DHE_PSK_WITH_NULL_SHA",
|
||||
"TLS_RSA_PSK_WITH_NULL_SHA",
|
||||
"TLS_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_AES_128_CBC_SHA",
|
||||
"TLS_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_AES_256_CBC_SHA",
|
||||
"TLS_RSA_WITH_NULL_SHA256",
|
||||
"TLS_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_RSA_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_RSA_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_RSA_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_PSK_WITH_RC4_128_SHA",
|
||||
"TLS_PSK_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_PSK_WITH_AES_128_CBC_SHA",
|
||||
"TLS_PSK_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DHE_PSK_WITH_RC4_128_SHA",
|
||||
"TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DHE_PSK_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DHE_PSK_WITH_AES_256_CBC_SHA",
|
||||
"TLS_RSA_PSK_WITH_RC4_128_SHA",
|
||||
"TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_RSA_PSK_WITH_AES_128_CBC_SHA",
|
||||
"TLS_RSA_PSK_WITH_AES_256_CBC_SHA",
|
||||
"TLS_RSA_WITH_SEED_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_SEED_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_SEED_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_SEED_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_SEED_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_SEED_CBC_SHA",
|
||||
"TLS_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_RSA_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_DH_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_DH_RSA_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_DH_DSS_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_DH_DSS_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_DH_anon_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_DH_anon_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_PSK_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_RSA_PSK_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_RSA_PSK_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_PSK_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_PSK_WITH_NULL_SHA256",
|
||||
"TLS_PSK_WITH_NULL_SHA384",
|
||||
"TLS_DHE_PSK_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DHE_PSK_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_DHE_PSK_WITH_NULL_SHA256",
|
||||
"TLS_DHE_PSK_WITH_NULL_SHA384",
|
||||
"TLS_RSA_PSK_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_RSA_PSK_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_RSA_PSK_WITH_NULL_SHA256",
|
||||
"TLS_RSA_PSK_WITH_NULL_SHA384",
|
||||
"TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
|
||||
"TLS_ECDH_ECDSA_WITH_NULL_SHA",
|
||||
"TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
|
||||
"TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_NULL_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDH_RSA_WITH_NULL_SHA",
|
||||
"TLS_ECDH_RSA_WITH_RC4_128_SHA",
|
||||
"TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_NULL_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_RC4_128_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDH_anon_WITH_NULL_SHA",
|
||||
"TLS_ECDH_anon_WITH_RC4_128_SHA",
|
||||
"TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
|
||||
"TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_SRP_SHA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA",
|
||||
"TLS_SRP_SHA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_ECDHE_PSK_WITH_RC4_128_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDHE_PSK_WITH_NULL_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_NULL_SHA256",
|
||||
"TLS_ECDHE_PSK_WITH_NULL_SHA384",
|
||||
"TLS_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DH_anon_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_RSA_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_RSA_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_DH_anon_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_DH_anon_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_PSK_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_PSK_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_PSK_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_RSA_WITH_AES_128_CCM",
|
||||
"TLS_RSA_WITH_AES_256_CCM",
|
||||
"TLS_RSA_WITH_AES_128_CCM_8",
|
||||
"TLS_RSA_WITH_AES_256_CCM_8",
|
||||
"TLS_PSK_WITH_AES_128_CCM",
|
||||
"TLS_PSK_WITH_AES_256_CCM",
|
||||
"TLS_PSK_WITH_AES_128_CCM_8",
|
||||
"TLS_PSK_WITH_AES_256_CCM_8"
|
||||
};
|
||||
{
|
||||
"TLS_NULL_WITH_NULL_NULL",
|
||||
"TLS_RSA_WITH_NULL_MD5",
|
||||
"TLS_RSA_WITH_NULL_SHA",
|
||||
"TLS_RSA_EXPORT_WITH_RC4_40_MD5",
|
||||
"TLS_RSA_WITH_RC4_128_MD5",
|
||||
"TLS_RSA_WITH_RC4_128_SHA",
|
||||
"TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5",
|
||||
"TLS_RSA_WITH_IDEA_CBC_SHA",
|
||||
"TLS_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_RSA_WITH_DES_CBC_SHA",
|
||||
"TLS_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_DES_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_DES_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_DES_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_DES_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DH_anon_EXPORT_WITH_RC4_40_MD5",
|
||||
"TLS_DH_anon_WITH_RC4_128_MD5",
|
||||
"TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_DES_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_KRB5_WITH_DES_CBC_SHA",
|
||||
"TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_KRB5_WITH_RC4_128_SHA",
|
||||
"TLS_KRB5_WITH_IDEA_CBC_SHA",
|
||||
"TLS_KRB5_WITH_DES_CBC_MD5",
|
||||
"TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
|
||||
"TLS_KRB5_WITH_RC4_128_MD5",
|
||||
"TLS_KRB5_WITH_IDEA_CBC_MD5",
|
||||
"TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
|
||||
"TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA",
|
||||
"TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
|
||||
"TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
|
||||
"TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5",
|
||||
"TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
|
||||
"TLS_PSK_WITH_NULL_SHA",
|
||||
"TLS_DHE_PSK_WITH_NULL_SHA",
|
||||
"TLS_RSA_PSK_WITH_NULL_SHA",
|
||||
"TLS_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_AES_128_CBC_SHA",
|
||||
"TLS_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_AES_256_CBC_SHA",
|
||||
"TLS_RSA_WITH_NULL_SHA256",
|
||||
"TLS_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_RSA_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_RSA_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_AES_256_CBC_SHA256",
|
||||
"TLS_RSA_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA",
|
||||
"TLS_PSK_WITH_RC4_128_SHA",
|
||||
"TLS_PSK_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_PSK_WITH_AES_128_CBC_SHA",
|
||||
"TLS_PSK_WITH_AES_256_CBC_SHA",
|
||||
"TLS_DHE_PSK_WITH_RC4_128_SHA",
|
||||
"TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_DHE_PSK_WITH_AES_128_CBC_SHA",
|
||||
"TLS_DHE_PSK_WITH_AES_256_CBC_SHA",
|
||||
"TLS_RSA_PSK_WITH_RC4_128_SHA",
|
||||
"TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_RSA_PSK_WITH_AES_128_CBC_SHA",
|
||||
"TLS_RSA_PSK_WITH_AES_256_CBC_SHA",
|
||||
"TLS_RSA_WITH_SEED_CBC_SHA",
|
||||
"TLS_DH_DSS_WITH_SEED_CBC_SHA",
|
||||
"TLS_DH_RSA_WITH_SEED_CBC_SHA",
|
||||
"TLS_DHE_DSS_WITH_SEED_CBC_SHA",
|
||||
"TLS_DHE_RSA_WITH_SEED_CBC_SHA",
|
||||
"TLS_DH_anon_WITH_SEED_CBC_SHA",
|
||||
"TLS_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_RSA_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_DH_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_DH_RSA_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_DH_DSS_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_DH_DSS_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_DH_anon_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_DH_anon_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_PSK_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_RSA_PSK_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_RSA_PSK_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_PSK_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_PSK_WITH_NULL_SHA256",
|
||||
"TLS_PSK_WITH_NULL_SHA384",
|
||||
"TLS_DHE_PSK_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_DHE_PSK_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_DHE_PSK_WITH_NULL_SHA256",
|
||||
"TLS_DHE_PSK_WITH_NULL_SHA384",
|
||||
"TLS_RSA_PSK_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_RSA_PSK_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_RSA_PSK_WITH_NULL_SHA256",
|
||||
"TLS_RSA_PSK_WITH_NULL_SHA384",
|
||||
"TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256",
|
||||
"TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
|
||||
"TLS_ECDH_ECDSA_WITH_NULL_SHA",
|
||||
"TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
|
||||
"TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_NULL_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDH_RSA_WITH_NULL_SHA",
|
||||
"TLS_ECDH_RSA_WITH_RC4_128_SHA",
|
||||
"TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_NULL_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_RC4_128_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDH_anon_WITH_NULL_SHA",
|
||||
"TLS_ECDH_anon_WITH_RC4_128_SHA",
|
||||
"TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
|
||||
"TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_SRP_SHA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA",
|
||||
"TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA",
|
||||
"TLS_SRP_SHA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA",
|
||||
"TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
|
||||
"TLS_ECDHE_PSK_WITH_RC4_128_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256",
|
||||
"TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384",
|
||||
"TLS_ECDHE_PSK_WITH_NULL_SHA",
|
||||
"TLS_ECDHE_PSK_WITH_NULL_SHA256",
|
||||
"TLS_ECDHE_PSK_WITH_NULL_SHA384",
|
||||
"TLS_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DH_anon_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DH_anon_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_RSA_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_RSA_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_DH_anon_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_DH_anon_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_PSK_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_PSK_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_PSK_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256",
|
||||
"TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384",
|
||||
"TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256",
|
||||
"TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384",
|
||||
"TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256",
|
||||
"TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384",
|
||||
"TLS_RSA_WITH_AES_128_CCM",
|
||||
"TLS_RSA_WITH_AES_256_CCM",
|
||||
"TLS_RSA_WITH_AES_128_CCM_8",
|
||||
"TLS_RSA_WITH_AES_256_CCM_8",
|
||||
"TLS_PSK_WITH_AES_128_CCM",
|
||||
"TLS_PSK_WITH_AES_256_CCM",
|
||||
"TLS_PSK_WITH_AES_128_CCM_8",
|
||||
"TLS_PSK_WITH_AES_256_CCM_8"
|
||||
};
|
||||
for (String c : ciphers)
|
||||
{
|
||||
__blackCiphers.put(c, Boolean.TRUE);
|
||||
|
|
|
@ -163,6 +163,14 @@ public class HTTP2Connection extends AbstractConnection implements WriteFlusher.
|
|||
produce();
|
||||
}
|
||||
|
||||
private void offerTask(Runnable task)
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
tasks.offer(task);
|
||||
}
|
||||
}
|
||||
|
||||
protected void produce()
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
|
@ -185,14 +193,6 @@ public class HTTP2Connection extends AbstractConnection implements WriteFlusher.
|
|||
session.close(ErrorCode.NO_ERROR.code, "close", Callback.NOOP);
|
||||
}
|
||||
|
||||
private void offerTask(Runnable task)
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
tasks.offer(task);
|
||||
}
|
||||
}
|
||||
|
||||
private Runnable pollTask()
|
||||
{
|
||||
synchronized (this)
|
||||
|
|
|
@ -504,6 +504,21 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowUpdate(IStream stream, WindowUpdateFrame frame)
|
||||
{
|
||||
// WindowUpdateFrames arrive concurrently with writes.
|
||||
// Increasing (or reducing) the window size concurrently
|
||||
// with writes requires coordination with the flusher, that
|
||||
// decides how many frames to write depending on the available
|
||||
// window sizes. If the window sizes vary concurrently, the
|
||||
// flusher may take non-optimal or wrong decisions.
|
||||
// Here, we "queue" window updates to the flusher, so it will
|
||||
// be the only component responsible for window updates, for
|
||||
// both increments and reductions.
|
||||
flusher.window(stream, frame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamFailure(int streamId, int error, String reason)
|
||||
{
|
||||
|
@ -574,6 +589,11 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio
|
|||
}
|
||||
}
|
||||
|
||||
protected IStream newStream(int streamId, boolean local)
|
||||
{
|
||||
return new HTTP2Stream(scheduler, this, streamId, local);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int priority(PriorityFrame frame, Callback callback)
|
||||
{
|
||||
|
@ -833,11 +853,6 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio
|
|||
remoteStreamCount.add(deltaStreams, deltaClosing);
|
||||
}
|
||||
|
||||
protected IStream newStream(int streamId, boolean local)
|
||||
{
|
||||
return new HTTP2Stream(scheduler, this, streamId, local);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeStream(IStream stream)
|
||||
{
|
||||
|
@ -893,21 +908,6 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio
|
|||
return recvWindow.getAndAdd(delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowUpdate(IStream stream, WindowUpdateFrame frame)
|
||||
{
|
||||
// WindowUpdateFrames arrive concurrently with writes.
|
||||
// Increasing (or reducing) the window size concurrently
|
||||
// with writes requires coordination with the flusher, that
|
||||
// decides how many frames to write depending on the available
|
||||
// window sizes. If the window sizes vary concurrently, the
|
||||
// flusher may take non-optimal or wrong decisions.
|
||||
// Here, we "queue" window updates to the flusher, so it will
|
||||
// be the only component responsible for window updates, for
|
||||
// both increments and reductions.
|
||||
flusher.window(stream, frame);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ManagedAttribute(value = "Whether HTTP/2 push is enabled", readonly = true)
|
||||
public boolean isPushEnabled()
|
||||
|
|
|
@ -44,7 +44,7 @@ public class SimpleFlowControlStrategy extends AbstractFlowControlStrategy
|
|||
// This method is called when a whole flow controlled frame has been consumed.
|
||||
// We send a WindowUpdate every time, even if the frame was very small.
|
||||
|
||||
WindowUpdateFrame sessionFrame = new WindowUpdateFrame(0, length);
|
||||
final WindowUpdateFrame sessionFrame = new WindowUpdateFrame(0, length);
|
||||
session.updateRecvWindow(length);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Data consumed, increased session recv window by {} for {}", length, session);
|
||||
|
|
|
@ -217,15 +217,6 @@ public class HpackEncoder
|
|||
LOG.debug(String.format("CtxTbl[%x] encoded %d octets", _context.hashCode(), buffer.position() - pos));
|
||||
}
|
||||
|
||||
public void encodeMaxDynamicTableSize(ByteBuffer buffer, int maxDynamicTableSize)
|
||||
{
|
||||
if (maxDynamicTableSize > _remoteMaxDynamicTableSize)
|
||||
throw new IllegalArgumentException();
|
||||
buffer.put((byte)0x20);
|
||||
NBitInteger.encode(buffer, 5, maxDynamicTableSize);
|
||||
_context.resize(maxDynamicTableSize);
|
||||
}
|
||||
|
||||
public void encode(ByteBuffer buffer, HttpField field)
|
||||
{
|
||||
if (field.getValue() == null)
|
||||
|
@ -369,6 +360,15 @@ public class HpackEncoder
|
|||
}
|
||||
}
|
||||
|
||||
public void encodeMaxDynamicTableSize(ByteBuffer buffer, int maxDynamicTableSize)
|
||||
{
|
||||
if (maxDynamicTableSize > _remoteMaxDynamicTableSize)
|
||||
throw new IllegalArgumentException();
|
||||
buffer.put((byte)0x20);
|
||||
NBitInteger.encode(buffer, 5, maxDynamicTableSize);
|
||||
_context.resize(maxDynamicTableSize);
|
||||
}
|
||||
|
||||
private void encodeName(ByteBuffer buffer, byte mask, int bits, String name, Entry entry)
|
||||
{
|
||||
buffer.put(mask);
|
||||
|
|
|
@ -422,16 +422,6 @@ public class Huffman
|
|||
return out.toString();
|
||||
}
|
||||
|
||||
public static int octetsNeeded(String s)
|
||||
{
|
||||
return octetsNeeded(CODES, s);
|
||||
}
|
||||
|
||||
public static void encode(ByteBuffer buffer, String s)
|
||||
{
|
||||
encode(CODES, buffer, s);
|
||||
}
|
||||
|
||||
public static int octetsNeededLC(String s)
|
||||
{
|
||||
return octetsNeeded(LCCODES, s);
|
||||
|
@ -442,6 +432,11 @@ public class Huffman
|
|||
encode(LCCODES, buffer, s);
|
||||
}
|
||||
|
||||
public static int octetsNeeded(String s)
|
||||
{
|
||||
return octetsNeeded(CODES, s);
|
||||
}
|
||||
|
||||
private static int octetsNeeded(final int[][] table, String s)
|
||||
{
|
||||
int needed = 0;
|
||||
|
@ -457,6 +452,11 @@ public class Huffman
|
|||
return (needed + 7) / 8;
|
||||
}
|
||||
|
||||
public static void encode(ByteBuffer buffer, String s)
|
||||
{
|
||||
encode(CODES, buffer, s);
|
||||
}
|
||||
|
||||
private static void encode(final int[][] table, ByteBuffer buffer, String s)
|
||||
{
|
||||
long current = 0;
|
||||
|
|
|
@ -113,6 +113,12 @@ public class HTTP2ServerConnectionFactory extends AbstractHTTP2ServerConnectionF
|
|||
return getConnection().onSessionTimeout(new TimeoutException("Session idle timeout " + idleTimeout + " ms"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onIdleTimeout(Stream stream, Throwable x)
|
||||
{
|
||||
return getConnection().onStreamTimeout((IStream)stream, x);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(Session session, GoAwayFrame frame, Callback callback)
|
||||
{
|
||||
|
@ -128,6 +134,12 @@ public class HTTP2ServerConnectionFactory extends AbstractHTTP2ServerConnectionF
|
|||
getConnection().onSessionFailure(failure, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Stream stream, int error, String reason, Callback callback)
|
||||
{
|
||||
getConnection().onStreamFailure((IStream)stream, new EofException(String.format("Failure %s/%s", ErrorCode.toString(error, null), reason)), callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHeaders(Stream stream, HeadersFrame frame)
|
||||
{
|
||||
|
@ -157,18 +169,6 @@ public class HTTP2ServerConnectionFactory extends AbstractHTTP2ServerConnectionF
|
|||
getConnection().onStreamFailure((IStream)stream, new EofException("Reset " + ErrorCode.toString(frame.getError(), null)), callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Stream stream, int error, String reason, Callback callback)
|
||||
{
|
||||
getConnection().onStreamFailure((IStream)stream, new EofException(String.format("Failure %s/%s", ErrorCode.toString(error, null), reason)), callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onIdleTimeout(Stream stream, Throwable x)
|
||||
{
|
||||
return getConnection().onStreamTimeout((IStream)stream, x);
|
||||
}
|
||||
|
||||
private void close(Stream stream, String reason)
|
||||
{
|
||||
stream.getSession().close(ErrorCode.PROTOCOL_ERROR.code, reason, Callback.NOOP);
|
||||
|
|
|
@ -300,7 +300,7 @@ public class HttpChannelOverHTTP2 extends HttpChannel implements Closeable, Writ
|
|||
|
||||
public boolean onStreamTimeout(Throwable failure, Consumer<Runnable> consumer)
|
||||
{
|
||||
boolean delayed = _delayedUntilContent;
|
||||
final boolean delayed = _delayedUntilContent;
|
||||
_delayedUntilContent = false;
|
||||
|
||||
boolean result = isRequestIdle();
|
||||
|
|
|
@ -52,20 +52,20 @@ public class SessionDataMarshaller implements MessageMarshaller<InfinispanSessio
|
|||
@Override
|
||||
public InfinispanSessionData readFrom(ProtoStreamReader in) throws IOException
|
||||
{
|
||||
int version = in.readInt("version");// version of serialized session
|
||||
String id = in.readString("id"); // session id
|
||||
String cpath = in.readString("contextPath"); // context path
|
||||
String vhost = in.readString("vhost"); // first vhost
|
||||
final int version = in.readInt("version");// version of serialized session
|
||||
final String id = in.readString("id"); // session id
|
||||
final String cpath = in.readString("contextPath"); // context path
|
||||
final String vhost = in.readString("vhost"); // first vhost
|
||||
|
||||
long accessed = in.readLong("accessed");// accessTime
|
||||
long lastAccessed = in.readLong("lastAccessed"); // lastAccessTime
|
||||
long created = in.readLong("created"); // time created
|
||||
long cookieSet = in.readLong("cookieSet");// time cookie was set
|
||||
String lastNode = in.readString("lastNode"); // name of last node
|
||||
final long accessed = in.readLong("accessed");// accessTime
|
||||
final long lastAccessed = in.readLong("lastAccessed"); // lastAccessTime
|
||||
final long created = in.readLong("created"); // time created
|
||||
final long cookieSet = in.readLong("cookieSet");// time cookie was set
|
||||
final String lastNode = in.readString("lastNode"); // name of last node
|
||||
// managing
|
||||
|
||||
long expiry = in.readLong("expiry");
|
||||
long maxInactiveMs = in.readLong("maxInactiveMs");
|
||||
final long expiry = in.readLong("expiry");
|
||||
final long maxInactiveMs = in.readLong("maxInactiveMs");
|
||||
|
||||
InfinispanSessionData sd = new InfinispanSessionData(id, cpath, vhost, created, accessed, lastAccessed, maxInactiveMs);
|
||||
sd.setCookieSet(cookieSet);
|
||||
|
|
|
@ -117,6 +117,10 @@ public abstract class AbstractConnection implements Connection
|
|||
|
||||
case EITHER:
|
||||
Invocable.invokeNonBlocking(failCallback);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,9 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
|
|||
|
||||
case CLOSED: // already closed
|
||||
return;
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(s.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -163,6 +166,9 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
|
|||
|
||||
case CLOSED: // already closed
|
||||
return;
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(s.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -201,6 +207,9 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
|
|||
|
||||
case CLOSED: // already closed
|
||||
return;
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(s.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -225,6 +225,16 @@ public class ByteArrayEndPoint extends AbstractEndPoint
|
|||
_runFillable.run();
|
||||
}
|
||||
|
||||
public void addInput(String s)
|
||||
{
|
||||
addInput(BufferUtil.toBuffer(s, StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public void addInput(String s, Charset charset)
|
||||
{
|
||||
addInput(BufferUtil.toBuffer(s, charset));
|
||||
}
|
||||
|
||||
public void addInputAndExecute(ByteBuffer in)
|
||||
{
|
||||
boolean fillable = false;
|
||||
|
@ -248,16 +258,6 @@ public class ByteArrayEndPoint extends AbstractEndPoint
|
|||
execute(_runFillable);
|
||||
}
|
||||
|
||||
public void addInput(String s)
|
||||
{
|
||||
addInput(BufferUtil.toBuffer(s, StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public void addInput(String s, Charset charset)
|
||||
{
|
||||
addInput(BufferUtil.toBuffer(s, charset));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the out.
|
||||
*/
|
||||
|
|
|
@ -323,8 +323,8 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
|
|||
Selector selector = _selector;
|
||||
if (selector != null && selector.isOpen())
|
||||
{
|
||||
DumpKeys dump = new DumpKeys();
|
||||
String updatesAt = DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(ZonedDateTime.now());
|
||||
final DumpKeys dump = new DumpKeys();
|
||||
final String updatesAt = DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(ZonedDateTime.now());
|
||||
synchronized (ManagedSelector.this)
|
||||
{
|
||||
updates = new ArrayList<>(_updates);
|
||||
|
|
|
@ -253,6 +253,11 @@ public abstract class SelectorManager extends ContainerLifeCycle implements Dump
|
|||
return new ManagedSelector(this, id);
|
||||
}
|
||||
|
||||
protected Selector newSelector() throws IOException
|
||||
{
|
||||
return Selector.open();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doStop() throws Exception
|
||||
{
|
||||
|
@ -359,11 +364,6 @@ public abstract class SelectorManager extends ContainerLifeCycle implements Dump
|
|||
LOG.warn(String.format("%s - %s", channel, attachment), ex);
|
||||
}
|
||||
|
||||
protected Selector newSelector() throws IOException
|
||||
{
|
||||
return Selector.open();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Factory method to create {@link EndPoint}.</p>
|
||||
* <p>This method is invoked as a result of the registration of a channel via {@link #connect(SelectableChannel, Object)}
|
||||
|
|
|
@ -81,6 +81,9 @@ public abstract class AbstractLoginModule implements LoginModule
|
|||
return this.principal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param subject The subject
|
||||
*/
|
||||
public void setJAASInfo(Subject subject)
|
||||
{
|
||||
subject.getPrincipals().add(this.principal);
|
||||
|
@ -91,6 +94,9 @@ public abstract class AbstractLoginModule implements LoginModule
|
|||
subject.getPrincipals().addAll(roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param subject The subject
|
||||
*/
|
||||
public void unsetJAASInfo(Subject subject)
|
||||
{
|
||||
subject.getPrincipals().remove(this.principal);
|
||||
|
|
|
@ -94,30 +94,6 @@ public class JaspiAuthenticator extends LoginAuthenticator
|
|||
return "JASPI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authentication validateRequest(ServletRequest request, ServletResponse response, boolean mandatory) throws ServerAuthException
|
||||
{
|
||||
JaspiMessageInfo info = new JaspiMessageInfo(request, response, mandatory);
|
||||
request.setAttribute("org.eclipse.jetty.security.jaspi.info", info);
|
||||
|
||||
Authentication a = validateRequest(info);
|
||||
|
||||
//if its not mandatory to authenticate, and the authenticator returned UNAUTHENTICATED, we treat it as authentication deferred
|
||||
if (_allowLazyAuthentication && !info.isAuthMandatory() && a == Authentication.UNAUTHENTICATED)
|
||||
a = new DeferredAuthentication(this);
|
||||
return a;
|
||||
}
|
||||
|
||||
// most likely validatedUser is not needed here.
|
||||
@Override
|
||||
public boolean secureResponse(ServletRequest req, ServletResponse res, boolean mandatory, User validatedUser) throws ServerAuthException
|
||||
{
|
||||
JaspiMessageInfo info = (JaspiMessageInfo)req.getAttribute("org.eclipse.jetty.security.jaspi.info");
|
||||
if (info == null)
|
||||
throw new NullPointerException("MessageInfo from request missing: " + req);
|
||||
return secureResponse(info, validatedUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.security.authentication.LoginAuthenticator#login(java.lang.String, java.lang.Object, javax.servlet.ServletRequest)
|
||||
*/
|
||||
|
@ -138,6 +114,20 @@ public class JaspiAuthenticator extends LoginAuthenticator
|
|||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authentication validateRequest(ServletRequest request, ServletResponse response, boolean mandatory) throws ServerAuthException
|
||||
{
|
||||
JaspiMessageInfo info = new JaspiMessageInfo(request, response, mandatory);
|
||||
request.setAttribute("org.eclipse.jetty.security.jaspi.info", info);
|
||||
|
||||
Authentication a = validateRequest(info);
|
||||
|
||||
//if its not mandatory to authenticate, and the authenticator returned UNAUTHENTICATED, we treat it as authentication deferred
|
||||
if (_allowLazyAuthentication && !info.isAuthMandatory() && a == Authentication.UNAUTHENTICATED)
|
||||
a = new DeferredAuthentication(this);
|
||||
return a;
|
||||
}
|
||||
|
||||
public Authentication validateRequest(JaspiMessageInfo messageInfo) throws ServerAuthException
|
||||
{
|
||||
try
|
||||
|
@ -218,6 +208,16 @@ public class JaspiAuthenticator extends LoginAuthenticator
|
|||
}
|
||||
}
|
||||
|
||||
// most likely validatedUser is not needed here.
|
||||
@Override
|
||||
public boolean secureResponse(ServletRequest req, ServletResponse res, boolean mandatory, User validatedUser) throws ServerAuthException
|
||||
{
|
||||
JaspiMessageInfo info = (JaspiMessageInfo)req.getAttribute("org.eclipse.jetty.security.jaspi.info");
|
||||
if (info == null)
|
||||
throw new NullPointerException("MessageInfo from request missing: " + req);
|
||||
return secureResponse(info, validatedUser);
|
||||
}
|
||||
|
||||
public boolean secureResponse(JaspiMessageInfo messageInfo, Authentication validatedUser) throws ServerAuthException
|
||||
{
|
||||
try
|
||||
|
|
|
@ -91,6 +91,21 @@ class MetaData
|
|||
return mbean;
|
||||
}
|
||||
|
||||
private static Object newInstance(Constructor<?> constructor, Object bean)
|
||||
{
|
||||
try
|
||||
{
|
||||
Object mbean = constructor.getParameterCount() == 0 ? constructor.newInstance() : constructor.newInstance(bean);
|
||||
if (mbean instanceof ModelMBean)
|
||||
((ModelMBean)mbean).setManagedResource(bean, "objectReference");
|
||||
return mbean;
|
||||
}
|
||||
catch (Throwable x)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
MBeanInfo getMBeanInfo()
|
||||
{
|
||||
return _info;
|
||||
|
@ -175,21 +190,6 @@ class MetaData
|
|||
return result;
|
||||
}
|
||||
|
||||
private static Object newInstance(Constructor<?> constructor, Object bean)
|
||||
{
|
||||
try
|
||||
{
|
||||
Object mbean = constructor.getParameterCount() == 0 ? constructor.newInstance() : constructor.newInstance(bean);
|
||||
if (mbean instanceof ModelMBean)
|
||||
((ModelMBean)mbean).setManagedResource(bean, "objectReference");
|
||||
return mbean;
|
||||
}
|
||||
catch (Throwable x)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void parseMethods(Class<?>... classes)
|
||||
{
|
||||
for (Class<?> klass : classes)
|
||||
|
|
|
@ -243,7 +243,7 @@ public class JettyRunForkedMojo extends JettyRunMojo
|
|||
webApp.start(); //just enough to generate the quickstart
|
||||
|
||||
//save config of the webapp BEFORE we stop
|
||||
File props = prepareConfiguration();
|
||||
final File props = prepareConfiguration();
|
||||
|
||||
webApp.stop();
|
||||
|
||||
|
|
|
@ -112,6 +112,8 @@ public class OverlayConfig
|
|||
excludes = Arrays.asList(exs);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -449,7 +449,7 @@ public class MongoSessionDataStore extends NoSqlSessionDataStore
|
|||
public void doStore(String id, SessionData data, long lastSaveTime) throws Exception
|
||||
{
|
||||
// Form query for upsert
|
||||
BasicDBObject key = new BasicDBObject(__ID, id);
|
||||
final BasicDBObject key = new BasicDBObject(__ID, id);
|
||||
|
||||
// Form updates
|
||||
BasicDBObject update = new BasicDBObject();
|
||||
|
|
|
@ -95,7 +95,7 @@ public class ContainerTldBundleDiscoverer implements TldBundleDiscoverer
|
|||
if (jstlBundle == null)
|
||||
jstlBundle = findJstlBundle();
|
||||
|
||||
Bundle[] bundles = FrameworkUtil.getBundle(ContainerTldBundleDiscoverer.class).getBundleContext().getBundles();
|
||||
final Bundle[] bundles = FrameworkUtil.getBundle(ContainerTldBundleDiscoverer.class).getBundleContext().getBundles();
|
||||
HashSet<URL> urls = new HashSet<URL>();
|
||||
String tmp = System.getProperty(OSGiMetaInfConfiguration.SYS_PROP_TLD_BUNDLES); //comma separated exact names
|
||||
List<String> sysNames = new ArrayList<String>();
|
||||
|
|
|
@ -77,7 +77,7 @@ public class Activator implements BundleActivator
|
|||
|
||||
//Create a second webappB as a Service and target it at a custom Server
|
||||
//deployed by another bundle
|
||||
WebAppContext webappB = new WebAppContext();
|
||||
final WebAppContext webappB = new WebAppContext();
|
||||
Dictionary propsB = new Hashtable();
|
||||
propsB.put("Jetty-WarResourcePath", "webappB");
|
||||
propsB.put("Web-ContextPath", "/acme");
|
||||
|
|
|
@ -170,6 +170,5 @@ public abstract class LifeCycleCallback
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
public abstract void validate(Class<?> clazz, Method m);
|
||||
}
|
||||
|
|
|
@ -98,6 +98,21 @@ public class LifeCycleCallbackCollection
|
|||
return preDestroyCallbacksMap.get(clazz.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Amalgamate all pre-destroy callbacks and return a read only set
|
||||
*
|
||||
* @return the collection of {@link PreDestroyCallback}s
|
||||
*/
|
||||
public Collection<LifeCycleCallback> getPreDestroyCallbacks()
|
||||
{
|
||||
Set<LifeCycleCallback> set = new HashSet<LifeCycleCallback>();
|
||||
for (String s : preDestroyCallbacksMap.keySet())
|
||||
{
|
||||
set.addAll(preDestroyCallbacksMap.get(s));
|
||||
}
|
||||
return Collections.unmodifiableCollection(set);
|
||||
}
|
||||
|
||||
public Set<LifeCycleCallback> getPostConstructCallbacks(Object o)
|
||||
{
|
||||
if (o == null)
|
||||
|
@ -107,6 +122,21 @@ public class LifeCycleCallbackCollection
|
|||
return postConstructCallbacksMap.get(clazz.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Amalgamate all post-construct callbacks and return a read only set
|
||||
*
|
||||
* @return the collection of {@link PostConstructCallback}s
|
||||
*/
|
||||
public Collection<LifeCycleCallback> getPostConstructCallbacks()
|
||||
{
|
||||
Set<LifeCycleCallback> set = new HashSet<LifeCycleCallback>();
|
||||
for (String s : postConstructCallbacksMap.keySet())
|
||||
{
|
||||
set.addAll(postConstructCallbacksMap.get(s));
|
||||
}
|
||||
return Collections.unmodifiableCollection(set);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the method, if one exists, that is annotated with <code>@PostConstruct</code>
|
||||
* or with <code><post-construct></code> in web.xml
|
||||
|
@ -172,34 +202,4 @@ public class LifeCycleCallbackCollection
|
|||
{
|
||||
return Collections.unmodifiableMap(preDestroyCallbacksMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Amalgamate all post-construct callbacks and return a read only set
|
||||
*
|
||||
* @return the collection of {@link PostConstructCallback}s
|
||||
*/
|
||||
public Collection<LifeCycleCallback> getPostConstructCallbacks()
|
||||
{
|
||||
Set<LifeCycleCallback> set = new HashSet<LifeCycleCallback>();
|
||||
for (String s : postConstructCallbacksMap.keySet())
|
||||
{
|
||||
set.addAll(postConstructCallbacksMap.get(s));
|
||||
}
|
||||
return Collections.unmodifiableCollection(set);
|
||||
}
|
||||
|
||||
/**
|
||||
* Amalgamate all pre-destroy callbacks and return a read only set
|
||||
*
|
||||
* @return the collection of {@link PreDestroyCallback}s
|
||||
*/
|
||||
public Collection<LifeCycleCallback> getPreDestroyCallbacks()
|
||||
{
|
||||
Set<LifeCycleCallback> set = new HashSet<LifeCycleCallback>();
|
||||
for (String s : preDestroyCallbacksMap.keySet())
|
||||
{
|
||||
set.addAll(preDestroyCallbacksMap.get(s));
|
||||
}
|
||||
return Collections.unmodifiableCollection(set);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,6 +130,33 @@ public class NamingEntryUtil
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build up a list of NamingEntry objects that are of a specific type.
|
||||
*/
|
||||
private static List<Object> lookupNamingEntries(List<Object> list, Context context, Class<?> clazz)
|
||||
throws NamingException
|
||||
{
|
||||
try
|
||||
{
|
||||
NamingEnumeration<Binding> nenum = context.listBindings("");
|
||||
while (nenum.hasMoreElements())
|
||||
{
|
||||
Binding binding = nenum.next();
|
||||
if (binding.getObject() instanceof Context)
|
||||
lookupNamingEntries(list, (Context)binding.getObject(), clazz);
|
||||
else if (clazz.isInstance(binding.getObject()))
|
||||
list.add(binding.getObject());
|
||||
}
|
||||
}
|
||||
catch (NameNotFoundException e)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("No entries of type " + clazz.getName() + " in context=" + context);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static Name makeNamingEntryName(NameParser parser, NamingEntry namingEntry)
|
||||
throws NamingException
|
||||
{
|
||||
|
@ -194,33 +221,6 @@ public class NamingEntryUtil
|
|||
return (Context)scopeContext.lookup(NamingEntry.__contextName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build up a list of NamingEntry objects that are of a specific type.
|
||||
*/
|
||||
private static List<Object> lookupNamingEntries(List<Object> list, Context context, Class<?> clazz)
|
||||
throws NamingException
|
||||
{
|
||||
try
|
||||
{
|
||||
NamingEnumeration<Binding> nenum = context.listBindings("");
|
||||
while (nenum.hasMoreElements())
|
||||
{
|
||||
Binding binding = nenum.next();
|
||||
if (binding.getObject() instanceof Context)
|
||||
lookupNamingEntries(list, (Context)binding.getObject(), clazz);
|
||||
else if (clazz.isInstance(binding.getObject()))
|
||||
list.add(binding.getObject());
|
||||
}
|
||||
}
|
||||
catch (NameNotFoundException e)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("No entries of type " + clazz.getName() + " in context=" + context);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private static String canonicalizeScope(Object scope)
|
||||
{
|
||||
if (scope == null)
|
||||
|
|
|
@ -178,6 +178,8 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
//ServletSpec p.75. No declaration in web.xml, but in multiple web-fragments. Error.
|
||||
throw new IllegalStateException("Conflicting env-entry " + name + " in " + descriptor.getResource());
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -312,16 +314,16 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
{
|
||||
//declarations of the resource-ref must be the same in both fragment descriptors
|
||||
String otherType = otherNode.getString("res-type", false, true);
|
||||
otherType = (otherType == null ? "" : otherType);
|
||||
String otherAuth = otherNode.getString("res-auth", false, true);
|
||||
otherAuth = (otherAuth == null ? "" : otherAuth);
|
||||
String otherShared = otherNode.getString("res-sharing-scope", false, true);
|
||||
otherShared = (otherShared == null ? "" : otherShared);
|
||||
|
||||
//otherType, otherAuth and otherShared must be the same as type, auth, shared
|
||||
type = (type == null ? "" : type);
|
||||
otherType = (otherType == null ? "" : otherType);
|
||||
auth = (auth == null ? "" : auth);
|
||||
otherAuth = (otherAuth == null ? "" : otherAuth);
|
||||
shared = (shared == null ? "" : shared);
|
||||
otherShared = (otherShared == null ? "" : otherShared);
|
||||
|
||||
//ServletSpec p.75. No declaration of resource-ref in web xml, but different in multiple web-fragments. Error.
|
||||
if (!type.equals(otherType) || !auth.equals(otherAuth) || !shared.equals(otherShared))
|
||||
|
@ -331,7 +333,11 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
else
|
||||
throw new IllegalStateException("resource-ref." + jndiName + " not found in declaring descriptor " + otherFragment);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -436,7 +442,10 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
else
|
||||
throw new IllegalStateException("resource-env-ref." + jndiName + " not found in declaring descriptor " + otherFragment);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -535,7 +544,10 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
else
|
||||
throw new IllegalStateException("message-destination-ref." + jndiName + " not found in declaring descriptor " + otherFragment);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -615,6 +627,8 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -691,6 +705,8 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -452,7 +452,7 @@ public class AsyncMiddleManServlet extends AbstractProxyServlet
|
|||
hasContent = true;
|
||||
|
||||
ProxyWriter proxyWriter = (ProxyWriter)clientRequest.getAttribute(WRITE_LISTENER_ATTRIBUTE);
|
||||
boolean committed = proxyWriter != null;
|
||||
final boolean committed = proxyWriter != null;
|
||||
if (proxyWriter == null)
|
||||
{
|
||||
proxyWriter = newProxyWriteListener(clientRequest, serverResponse);
|
||||
|
|
|
@ -142,6 +142,9 @@ public class QuickStartConfiguration extends AbstractConfiguration
|
|||
else
|
||||
throw new IllegalStateException("No " + quickStartWebXml);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(_mode.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,18 +164,6 @@ public class QuickStartConfiguration extends AbstractConfiguration
|
|||
generator.setQuickStartWebXml(Resource.newResource(attr.toString()));
|
||||
}
|
||||
|
||||
protected void quickStart(WebAppContext context, Resource quickStartWebXml)
|
||||
throws Exception
|
||||
{
|
||||
_quickStart = true;
|
||||
context.setConfigurations(context.getWebAppConfigurations().stream()
|
||||
.filter(c -> !__replacedConfigurations.contains(c.replaces()) && !__replacedConfigurations.contains(c.getClass()))
|
||||
.collect(Collectors.toList()).toArray(new Configuration[]{}));
|
||||
context.getMetaData().setWebXml(quickStartWebXml);
|
||||
context.getServletContext().setEffectiveMajorVersion(context.getMetaData().getWebXml().getMajorVersion());
|
||||
context.getServletContext().setEffectiveMinorVersion(context.getMetaData().getWebXml().getMinorVersion());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.webapp.AbstractConfiguration#configure(org.eclipse.jetty.webapp.WebAppContext)
|
||||
*/
|
||||
|
@ -204,6 +195,18 @@ public class QuickStartConfiguration extends AbstractConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
protected void quickStart(WebAppContext context, Resource quickStartWebXml)
|
||||
throws Exception
|
||||
{
|
||||
_quickStart = true;
|
||||
context.setConfigurations(context.getWebAppConfigurations().stream()
|
||||
.filter(c -> !__replacedConfigurations.contains(c.replaces()) && !__replacedConfigurations.contains(c.getClass()))
|
||||
.collect(Collectors.toList()).toArray(new Configuration[]{}));
|
||||
context.getMetaData().setWebXml(quickStartWebXml);
|
||||
context.getServletContext().setEffectiveMajorVersion(context.getMetaData().getWebXml().getMajorVersion());
|
||||
context.getServletContext().setEffectiveMinorVersion(context.getMetaData().getWebXml().getMinorVersion());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the quickstart-web.xml file as a Resource.
|
||||
*
|
||||
|
|
|
@ -165,8 +165,6 @@ public class QuickStartGeneratorConfiguration extends AbstractConfiguration
|
|||
|
||||
LOG.info("Quickstart generating");
|
||||
|
||||
XmlAppendable out = new XmlAppendable(stream, "UTF-8");
|
||||
|
||||
MetaData md = context.getMetaData();
|
||||
|
||||
Map<String, String> webappAttr = new HashMap<>();
|
||||
|
@ -178,6 +176,7 @@ public class QuickStartGeneratorConfiguration extends AbstractConfiguration
|
|||
webappAttr.put("metadata-complete", "true");
|
||||
webappAttr.put("version", major + "." + minor);
|
||||
|
||||
XmlAppendable out = new XmlAppendable(stream, "UTF-8");
|
||||
out.openTag("web-app", webappAttr);
|
||||
if (context.getDisplayName() != null)
|
||||
out.tag("display-name", context.getDisplayName());
|
||||
|
|
|
@ -369,7 +369,7 @@ public class Runner
|
|||
statsContext.setSessionHandler(new SessionHandler());
|
||||
if (_statsPropFile != null)
|
||||
{
|
||||
HashLoginService loginService = new HashLoginService("StatsRealm", _statsPropFile);
|
||||
final HashLoginService loginService = new HashLoginService("StatsRealm", _statsPropFile);
|
||||
Constraint constraint = new Constraint();
|
||||
constraint.setName("Admin Only");
|
||||
constraint.setRoles(new String[]{"admin"});
|
||||
|
@ -496,6 +496,9 @@ public class Runner
|
|||
monitor.setKey(stopKey);
|
||||
monitor.setExitVm(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (_logFile != null)
|
||||
|
|
|
@ -289,7 +289,7 @@ public class ConfigurableSpnegoLoginService extends ContainerLifeCycle implement
|
|||
@Override
|
||||
public AppConfigurationEntry[] getAppConfigurationEntry(String name)
|
||||
{
|
||||
String principal = getServiceName() + "/" + getHostName();
|
||||
final String principal = getServiceName() + "/" + getHostName();
|
||||
Map<String, Object> options = new HashMap<>();
|
||||
if (LOG.isDebugEnabled())
|
||||
options.put("debug", "true");
|
||||
|
|
|
@ -123,16 +123,17 @@ public class JDBCLoginService extends AbstractLoginService
|
|||
_url = properties.getProperty("url");
|
||||
_userName = properties.getProperty("username");
|
||||
_password = properties.getProperty("password");
|
||||
String userTable = properties.getProperty("usertable");
|
||||
_userTableKey = properties.getProperty("usertablekey");
|
||||
String userTableUserField = properties.getProperty("usertableuserfield");
|
||||
_userTablePasswordField = properties.getProperty("usertablepasswordfield");
|
||||
String roleTable = properties.getProperty("roletable");
|
||||
String roleTableKey = properties.getProperty("roletablekey");
|
||||
_roleTableRoleField = properties.getProperty("roletablerolefield");
|
||||
String userRoleTable = properties.getProperty("userroletable");
|
||||
String userRoleTableUserKey = properties.getProperty("userroletableuserkey");
|
||||
String userRoleTableRoleKey = properties.getProperty("userroletablerolekey");
|
||||
|
||||
final String userTable = properties.getProperty("usertable");
|
||||
final String userTableUserField = properties.getProperty("usertableuserfield");
|
||||
final String roleTable = properties.getProperty("roletable");
|
||||
final String roleTableKey = properties.getProperty("roletablekey");
|
||||
final String userRoleTable = properties.getProperty("userroletable");
|
||||
final String userRoleTableUserKey = properties.getProperty("userroletableuserkey");
|
||||
final String userRoleTableRoleKey = properties.getProperty("userroletablerolekey");
|
||||
|
||||
if (_jdbcDriver == null || _jdbcDriver.equals("") ||
|
||||
_url == null || _url.equals("") ||
|
||||
|
|
|
@ -244,10 +244,10 @@ public class FormAuthenticator extends LoginAuthenticator
|
|||
@Override
|
||||
public Authentication validateRequest(ServletRequest req, ServletResponse res, boolean mandatory) throws ServerAuthException
|
||||
{
|
||||
HttpServletRequest request = (HttpServletRequest)req;
|
||||
HttpServletResponse response = (HttpServletResponse)res;
|
||||
Request baseRequest = Request.getBaseRequest(request);
|
||||
Response baseResponse = baseRequest.getResponse();
|
||||
final HttpServletRequest request = (HttpServletRequest)req;
|
||||
final HttpServletResponse response = (HttpServletResponse)res;
|
||||
final Request baseRequest = Request.getBaseRequest(request);
|
||||
final Response baseResponse = baseRequest.getResponse();
|
||||
|
||||
String uri = request.getRequestURI();
|
||||
if (uri == null)
|
||||
|
|
|
@ -559,11 +559,6 @@ public class CustomRequestLog extends ContainerLifeCycle implements RequestLog
|
|||
}
|
||||
}
|
||||
|
||||
private MethodHandle updateLogHandle(MethodHandle logHandle, MethodHandle append, String literal)
|
||||
{
|
||||
return foldArguments(logHandle, dropArguments(dropArguments(append.bindTo(literal), 1, Request.class), 2, Response.class));
|
||||
}
|
||||
|
||||
//TODO use integer comparisons instead of strings
|
||||
private static boolean modify(List<String> modifiers, Boolean negated, StringBuilder b, Request request, Response response)
|
||||
{
|
||||
|
@ -578,6 +573,11 @@ public class CustomRequestLog extends ContainerLifeCycle implements RequestLog
|
|||
}
|
||||
}
|
||||
|
||||
private MethodHandle updateLogHandle(MethodHandle logHandle, MethodHandle append, String literal)
|
||||
{
|
||||
return foldArguments(logHandle, dropArguments(dropArguments(append.bindTo(literal), 1, Request.class), 2, Response.class));
|
||||
}
|
||||
|
||||
private MethodHandle updateLogHandle(MethodHandle logHandle, MethodHandle append, String code, String arg, List<String> modifiers, boolean negated) throws NoSuchMethodException, IllegalAccessException
|
||||
{
|
||||
MethodType logType = methodType(Void.TYPE, StringBuilder.class, Request.class, Response.class);
|
||||
|
|
|
@ -75,12 +75,6 @@ public class Dispatcher implements RequestDispatcher
|
|||
_named = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException
|
||||
{
|
||||
forward(request, response, DispatcherType.FORWARD);
|
||||
}
|
||||
|
||||
public void error(ServletRequest request, ServletResponse response) throws ServletException, IOException
|
||||
{
|
||||
try
|
||||
|
@ -142,6 +136,12 @@ public class Dispatcher implements RequestDispatcher
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException
|
||||
{
|
||||
forward(request, response, DispatcherType.FORWARD);
|
||||
}
|
||||
|
||||
protected void forward(ServletRequest request, ServletResponse response, DispatcherType dispatch) throws ServletException, IOException
|
||||
{
|
||||
Request baseRequest = Request.getBaseRequest(request);
|
||||
|
|
|
@ -676,6 +676,8 @@ public class ForwardedRequestCustomizer implements Customizer
|
|||
_proto = value;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -470,6 +470,9 @@ public class HttpChannelState
|
|||
case IDLE:
|
||||
case REGISTERED:
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new IllegalStateException(_asyncRead.toString());
|
||||
}
|
||||
|
||||
if (_asyncWritePossible)
|
||||
|
@ -1184,6 +1187,8 @@ public class HttpChannelState
|
|||
case POSSIBLE:
|
||||
case PRODUCING:
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException(_asyncRead.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1227,7 +1232,7 @@ public class HttpChannelState
|
|||
}
|
||||
break;
|
||||
|
||||
case POSSIBLE:
|
||||
default:
|
||||
throw new IllegalStateException(toStringLocked());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -219,37 +219,6 @@ public class HttpOutput extends ServletOutputStream implements Runnable
|
|||
return _writeBlocker.acquire();
|
||||
}
|
||||
|
||||
private void write(ByteBuffer content, boolean complete) throws IOException
|
||||
{
|
||||
try (Blocker blocker = _writeBlocker.acquire())
|
||||
{
|
||||
write(content, complete, blocker);
|
||||
blocker.block();
|
||||
}
|
||||
catch (Exception failure)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug(failure);
|
||||
abort(failure);
|
||||
if (failure instanceof IOException)
|
||||
throw failure;
|
||||
throw new IOException(failure);
|
||||
}
|
||||
}
|
||||
|
||||
protected void write(ByteBuffer content, boolean complete, Callback callback)
|
||||
{
|
||||
if (_firstByteTimeStamp == -1)
|
||||
{
|
||||
long minDataRate = getHttpChannel().getHttpConfiguration().getMinResponseDataRate();
|
||||
if (minDataRate > 0)
|
||||
_firstByteTimeStamp = System.nanoTime();
|
||||
else
|
||||
_firstByteTimeStamp = Long.MAX_VALUE;
|
||||
}
|
||||
_interceptor.write(content, complete, callback);
|
||||
}
|
||||
|
||||
private void abort(Throwable failure)
|
||||
{
|
||||
closed();
|
||||
|
@ -435,6 +404,37 @@ public class HttpOutput extends ServletOutputStream implements Runnable
|
|||
}
|
||||
}
|
||||
|
||||
private void write(ByteBuffer content, boolean complete) throws IOException
|
||||
{
|
||||
try (Blocker blocker = _writeBlocker.acquire())
|
||||
{
|
||||
write(content, complete, blocker);
|
||||
blocker.block();
|
||||
}
|
||||
catch (Exception failure)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug(failure);
|
||||
abort(failure);
|
||||
if (failure instanceof IOException)
|
||||
throw failure;
|
||||
throw new IOException(failure);
|
||||
}
|
||||
}
|
||||
|
||||
protected void write(ByteBuffer content, boolean complete, Callback callback)
|
||||
{
|
||||
if (_firstByteTimeStamp == -1)
|
||||
{
|
||||
long minDataRate = getHttpChannel().getHttpConfiguration().getMinResponseDataRate();
|
||||
if (minDataRate > 0)
|
||||
_firstByteTimeStamp = System.nanoTime();
|
||||
else
|
||||
_firstByteTimeStamp = Long.MAX_VALUE;
|
||||
}
|
||||
_interceptor.write(content, complete, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b, int off, int len) throws IOException
|
||||
{
|
||||
|
@ -540,8 +540,8 @@ public class HttpOutput extends ServletOutputStream implements Runnable
|
|||
ByteBuffer view = ByteBuffer.wrap(b, off, len);
|
||||
while (len > getBufferSize())
|
||||
{
|
||||
int p = view.position();
|
||||
int l = p + getBufferSize();
|
||||
final int p = view.position();
|
||||
final int l = p + getBufferSize();
|
||||
view.limit(p + getBufferSize());
|
||||
write(view, false);
|
||||
len -= getBufferSize();
|
||||
|
@ -689,12 +689,6 @@ public class HttpOutput extends ServletOutputStream implements Runnable
|
|||
print(s, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void println(String s) throws IOException
|
||||
{
|
||||
print(s, true);
|
||||
}
|
||||
|
||||
private void print(String s, boolean eoln) throws IOException
|
||||
{
|
||||
if (isClosed())
|
||||
|
@ -761,6 +755,12 @@ public class HttpOutput extends ServletOutputStream implements Runnable
|
|||
getHttpChannel().getByteBufferPool().release(out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void println(String s) throws IOException
|
||||
{
|
||||
print(s, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void println(boolean b) throws IOException
|
||||
{
|
||||
|
|
|
@ -765,7 +765,6 @@ public class ResourceService
|
|||
String mimetype = (content == null ? null : content.getContentTypeValue());
|
||||
if (mimetype == null)
|
||||
LOG.warn("Unknown mimetype for " + request.getRequestURI());
|
||||
MultiPartOutputStream multi = new MultiPartOutputStream(out);
|
||||
response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);
|
||||
if (!response.containsHeader(HttpHeader.DATE.asString()))
|
||||
response.addDateHeader(HttpHeader.DATE.asString(), System.currentTimeMillis());
|
||||
|
@ -778,6 +777,7 @@ public class ResourceService
|
|||
ctp = "multipart/x-byteranges; boundary=";
|
||||
else
|
||||
ctp = "multipart/byteranges; boundary=";
|
||||
MultiPartOutputStream multi = new MultiPartOutputStream(out);
|
||||
response.setContentType(ctp + multi.getBoundary());
|
||||
|
||||
InputStream in = content.getResource().getInputStream();
|
||||
|
|
|
@ -176,6 +176,39 @@ public class Response implements HttpServletResponse
|
|||
_fields.put(__EXPIRES_01JAN1970);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCookie(Cookie cookie)
|
||||
{
|
||||
if (StringUtil.isBlank(cookie.getName()))
|
||||
throw new IllegalArgumentException("Cookie.name cannot be blank/null");
|
||||
|
||||
String comment = cookie.getComment();
|
||||
boolean httpOnly = cookie.isHttpOnly();
|
||||
|
||||
if (comment != null)
|
||||
{
|
||||
int i = comment.indexOf(HTTP_ONLY_COMMENT);
|
||||
if (i >= 0)
|
||||
{
|
||||
httpOnly = true;
|
||||
comment = StringUtil.strip(comment.trim(), HTTP_ONLY_COMMENT);
|
||||
if (comment.length() == 0)
|
||||
comment = null;
|
||||
}
|
||||
}
|
||||
|
||||
addCookie(new HttpCookie(
|
||||
cookie.getName(),
|
||||
cookie.getValue(),
|
||||
cookie.getDomain(),
|
||||
cookie.getPath(),
|
||||
(long)cookie.getMaxAge(),
|
||||
httpOnly,
|
||||
cookie.getSecure(),
|
||||
comment,
|
||||
cookie.getVersion()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace (or add) a cookie.
|
||||
* Using name, path and domain, look for a matching set-cookie header and replace it.
|
||||
|
@ -190,7 +223,7 @@ public class Response implements HttpServletResponse
|
|||
|
||||
if (field.getHeader() == HttpHeader.SET_COOKIE)
|
||||
{
|
||||
CookieCompliance compliance = getHttpChannel().getHttpConfiguration().getResponseCookieCompliance();
|
||||
final CookieCompliance compliance = getHttpChannel().getHttpConfiguration().getResponseCookieCompliance();
|
||||
|
||||
HttpCookie oldCookie;
|
||||
if (field instanceof SetCookieHttpField)
|
||||
|
@ -226,39 +259,6 @@ public class Response implements HttpServletResponse
|
|||
addCookie(cookie);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCookie(Cookie cookie)
|
||||
{
|
||||
if (StringUtil.isBlank(cookie.getName()))
|
||||
throw new IllegalArgumentException("Cookie.name cannot be blank/null");
|
||||
|
||||
String comment = cookie.getComment();
|
||||
boolean httpOnly = cookie.isHttpOnly();
|
||||
|
||||
if (comment != null)
|
||||
{
|
||||
int i = comment.indexOf(HTTP_ONLY_COMMENT);
|
||||
if (i >= 0)
|
||||
{
|
||||
httpOnly = true;
|
||||
comment = StringUtil.strip(comment.trim(), HTTP_ONLY_COMMENT);
|
||||
if (comment.length() == 0)
|
||||
comment = null;
|
||||
}
|
||||
}
|
||||
|
||||
addCookie(new HttpCookie(
|
||||
cookie.getName(),
|
||||
cookie.getValue(),
|
||||
cookie.getDomain(),
|
||||
cookie.getPath(),
|
||||
(long)cookie.getMaxAge(),
|
||||
httpOnly,
|
||||
cookie.getSecure(),
|
||||
comment,
|
||||
cookie.getVersion()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsHeader(String name)
|
||||
{
|
||||
|
@ -976,7 +976,10 @@ public class Response implements HttpServletResponse
|
|||
{
|
||||
_contentType = contentType + ";charset=" + _characterEncoding;
|
||||
_mimeType = null;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new IllegalStateException(_encodingFrom.toString());
|
||||
}
|
||||
}
|
||||
else if (isWriting() && !charset.equalsIgnoreCase(_characterEncoding))
|
||||
|
|
|
@ -184,22 +184,6 @@ public class SecureRequestCustomizer implements HttpConfiguration.Customizer
|
|||
customizeSecure(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizes the request attributes for general secure settings.
|
||||
* The default impl calls {@link Request#setSecure(boolean)} with true
|
||||
* and sets a response header if the Strict-Transport-Security options
|
||||
* are set.
|
||||
*
|
||||
* @param request the request being customized
|
||||
*/
|
||||
protected void customizeSecure(Request request)
|
||||
{
|
||||
request.setSecure(true);
|
||||
|
||||
if (_stsField != null)
|
||||
request.getResponse().getHttpFields().add(_stsField);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Customizes the request attributes to be set for SSL requests.
|
||||
|
@ -279,6 +263,22 @@ public class SecureRequestCustomizer implements HttpConfiguration.Customizer
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizes the request attributes for general secure settings.
|
||||
* The default impl calls {@link Request#setSecure(boolean)} with true
|
||||
* and sets a response header if the Strict-Transport-Security options
|
||||
* are set.
|
||||
*
|
||||
* @param request the request being customized
|
||||
*/
|
||||
protected void customizeSecure(Request request)
|
||||
{
|
||||
request.setSecure(true);
|
||||
|
||||
if (_stsField != null)
|
||||
request.getResponse().getHttpFields().add(_stsField);
|
||||
}
|
||||
|
||||
private X509Certificate[] getCertChain(Request request, SSLSession sslSession)
|
||||
{
|
||||
// The in-use SslContextFactory should be present in the Connector's SslConnectionFactory
|
||||
|
|
|
@ -106,8 +106,8 @@ public class BufferedResponseHandler extends HandlerWrapper
|
|||
@Override
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
{
|
||||
ServletContext context = baseRequest.getServletContext();
|
||||
String path = context == null ? baseRequest.getRequestURI() : URIUtil.addPaths(baseRequest.getServletPath(), baseRequest.getPathInfo());
|
||||
final ServletContext context = baseRequest.getServletContext();
|
||||
final String path = context == null ? baseRequest.getRequestURI() : URIUtil.addPaths(baseRequest.getServletPath(), baseRequest.getPathInfo());
|
||||
LOG.debug("{} handle {} in {}", this, baseRequest, context);
|
||||
|
||||
HttpOutput out = baseRequest.getResponse().getHttpOutput();
|
||||
|
|
|
@ -1734,7 +1734,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
|
|||
@Override
|
||||
public String toString()
|
||||
{
|
||||
String[] vhosts = getVirtualHosts();
|
||||
final String[] vhosts = getVirtualHosts();
|
||||
|
||||
StringBuilder b = new StringBuilder();
|
||||
|
||||
|
@ -2725,14 +2725,6 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletRegistration.Dynamic addJspFile(String servletName, String jspFile)
|
||||
{
|
||||
// TODO new in 4.0
|
||||
LOG.warn(__unimplmented);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet)
|
||||
{
|
||||
|
@ -2747,6 +2739,14 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletRegistration.Dynamic addJspFile(String servletName, String jspFile)
|
||||
{
|
||||
// TODO new in 4.0
|
||||
LOG.warn(__unimplmented);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Filter> T createFilter(Class<T> c) throws ServletException
|
||||
{
|
||||
|
|
|
@ -133,9 +133,6 @@ public class DefaultHandler extends AbstractHandler
|
|||
writer.append("<p>No context on this server matched or handled this request.</p>\n");
|
||||
writer.append("<p>Contexts known to this server are:</p>\n");
|
||||
|
||||
Server server = getServer();
|
||||
Handler[] handlers = server == null ? null : server.getChildHandlersByClass(ContextHandler.class);
|
||||
|
||||
writer.append("<table class=\"contexts\"><thead><tr>");
|
||||
writer.append("<th>Context Path</th>");
|
||||
writer.append("<th>Display Name</th>");
|
||||
|
@ -143,6 +140,9 @@ public class DefaultHandler extends AbstractHandler
|
|||
writer.append("<th>LifeCycle</th>");
|
||||
writer.append("</tr></thead><tbody>\n");
|
||||
|
||||
Server server = getServer();
|
||||
Handler[] handlers = server == null ? null : server.getChildHandlersByClass(ContextHandler.class);
|
||||
|
||||
for (int i = 0; handlers != null && i < handlers.length; i++)
|
||||
{
|
||||
writer.append("<tr><td>");
|
||||
|
|
|
@ -183,6 +183,43 @@ public class ErrorHandler extends AbstractHandler
|
|||
baseRequest.getResponse().closeOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an acceptable error response for a mime type.
|
||||
* <p>This method is called for each mime type in the users agent's
|
||||
* <code>Accept</code> header, until {@link Request#isHandled()} is true and a
|
||||
* response of the appropriate type is generated.
|
||||
*
|
||||
* @param baseRequest The base request
|
||||
* @param request The servlet request (may be wrapped)
|
||||
* @param response The response (may be wrapped)
|
||||
* @param code the http error code
|
||||
* @param message the http error message
|
||||
* @param mimeType The mimetype to generate (may be */*or other wildcard)
|
||||
* @throws IOException if a response cannot be generated
|
||||
*/
|
||||
protected void generateAcceptableResponse(Request baseRequest, HttpServletRequest request, HttpServletResponse response, int code, String message, String mimeType)
|
||||
throws IOException
|
||||
{
|
||||
switch (mimeType)
|
||||
{
|
||||
case "text/html":
|
||||
case "text/*":
|
||||
case "*/*":
|
||||
{
|
||||
baseRequest.setHandled(true);
|
||||
Writer writer = getAcceptableWriter(baseRequest, request, response);
|
||||
if (writer != null)
|
||||
{
|
||||
response.setContentType(MimeTypes.Type.TEXT_HTML.asString());
|
||||
handleErrorPage(request, writer, code, message);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an acceptable writer for an error page.
|
||||
* <p>Uses the user-agent's <code>Accept-Charset</code> to get response
|
||||
|
@ -229,40 +266,6 @@ public class ErrorHandler extends AbstractHandler
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an acceptable error response for a mime type.
|
||||
* <p>This method is called for each mime type in the users agent's
|
||||
* <code>Accept</code> header, until {@link Request#isHandled()} is true and a
|
||||
* response of the appropriate type is generated.
|
||||
*
|
||||
* @param baseRequest The base request
|
||||
* @param request The servlet request (may be wrapped)
|
||||
* @param response The response (may be wrapped)
|
||||
* @param code the http error code
|
||||
* @param message the http error message
|
||||
* @param mimeType The mimetype to generate (may be */*or other wildcard)
|
||||
* @throws IOException if a response cannot be generated
|
||||
*/
|
||||
protected void generateAcceptableResponse(Request baseRequest, HttpServletRequest request, HttpServletResponse response, int code, String message, String mimeType)
|
||||
throws IOException
|
||||
{
|
||||
switch (mimeType)
|
||||
{
|
||||
case "text/html":
|
||||
case "text/*":
|
||||
case "*/*":
|
||||
{
|
||||
baseRequest.setHandled(true);
|
||||
Writer writer = getAcceptableWriter(baseRequest, request, response);
|
||||
if (writer != null)
|
||||
{
|
||||
response.setContentType(MimeTypes.Type.TEXT_HTML.asString());
|
||||
handleErrorPage(request, writer, code, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleErrorPage(HttpServletRequest request, Writer writer, int code, String message)
|
||||
throws IOException
|
||||
{
|
||||
|
|
|
@ -105,7 +105,7 @@ public class StatisticsHandler extends HandlerWrapper implements Graceful
|
|||
Request request = state.getBaseRequest();
|
||||
final long elapsed = System.currentTimeMillis() - request.getTimeStamp();
|
||||
|
||||
long d = _requestStats.decrement();
|
||||
final long d = _requestStats.decrement();
|
||||
_requestTimeStats.record(elapsed);
|
||||
|
||||
updateResponse(request);
|
||||
|
|
|
@ -126,6 +126,26 @@ public class ThreadLimitHandler extends HandlerWrapper
|
|||
return _threadLimit;
|
||||
}
|
||||
|
||||
protected int getThreadLimit(String ip)
|
||||
{
|
||||
if (!_includeExcludeSet.isEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!_includeExcludeSet.test(InetAddress.getByName(ip)))
|
||||
{
|
||||
LOG.debug("excluded {}", ip);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.ignore(e);
|
||||
}
|
||||
}
|
||||
return _threadLimit;
|
||||
}
|
||||
|
||||
public void setThreadLimit(int threadLimit)
|
||||
{
|
||||
if (threadLimit <= 0)
|
||||
|
@ -221,26 +241,6 @@ public class ThreadLimitHandler extends HandlerWrapper
|
|||
}
|
||||
}
|
||||
|
||||
protected int getThreadLimit(String ip)
|
||||
{
|
||||
if (!_includeExcludeSet.isEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!_includeExcludeSet.test(InetAddress.getByName(ip)))
|
||||
{
|
||||
LOG.debug("excluded {}", ip);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.ignore(e);
|
||||
}
|
||||
}
|
||||
return _threadLimit;
|
||||
}
|
||||
|
||||
protected Remote getRemote(Request baseRequest)
|
||||
{
|
||||
Remote remote = (Remote)baseRequest.getAttribute(REMOTE);
|
||||
|
|
|
@ -590,8 +590,8 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory
|
|||
@Override
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
{
|
||||
ServletContext context = baseRequest.getServletContext();
|
||||
String path = context == null ? baseRequest.getRequestURI() : URIUtil.addPaths(baseRequest.getServletPath(), baseRequest.getPathInfo());
|
||||
final ServletContext context = baseRequest.getServletContext();
|
||||
final String path = context == null ? baseRequest.getRequestURI() : URIUtil.addPaths(baseRequest.getServletPath(), baseRequest.getPathInfo());
|
||||
LOG.debug("{} handle {} in {}", this, baseRequest, context);
|
||||
|
||||
if (!_dispatchers.contains(baseRequest.getDispatcherType()))
|
||||
|
|
|
@ -110,6 +110,28 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
|
|||
*/
|
||||
public abstract Session newSession(HttpServletRequest request, SessionData data);
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.SessionCache#newSession(javax.servlet.http.HttpServletRequest, java.lang.String, long, long)
|
||||
*/
|
||||
@Override
|
||||
public Session newSession(HttpServletRequest request, String id, long time, long maxInactiveMs)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Creating new session id=" + id);
|
||||
Session session = newSession(request, _sessionDataStore.newSessionData(id, time, time, time, maxInactiveMs));
|
||||
session.getSessionData().setLastNode(_context.getWorkerName());
|
||||
try
|
||||
{
|
||||
if (isSaveOnCreate() && _sessionDataStore != null)
|
||||
_sessionDataStore.store(id, session.getSessionData());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.warn("Save of new session {} failed", id, e);
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the session matching the key
|
||||
*
|
||||
|
@ -718,7 +740,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
|
|||
|
||||
try (Lock lock = session.lock())
|
||||
{
|
||||
String oldId = session.getId();
|
||||
final String oldId = session.getId();
|
||||
session.checkValidForWrite(); //can't change id on invalid session
|
||||
session.getSessionData().setId(newId);
|
||||
session.getSessionData().setLastSaved(0); //pretend that the session has never been saved before to get a full save
|
||||
|
@ -761,28 +783,6 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
|
|||
return _saveOnInactiveEviction;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.SessionCache#newSession(javax.servlet.http.HttpServletRequest, java.lang.String, long, long)
|
||||
*/
|
||||
@Override
|
||||
public Session newSession(HttpServletRequest request, String id, long time, long maxInactiveMs)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Creating new session id=" + id);
|
||||
Session session = newSession(request, _sessionDataStore.newSessionData(id, time, time, time, maxInactiveMs));
|
||||
session.getSessionData().setLastNode(_context.getWorkerName());
|
||||
try
|
||||
{
|
||||
if (isSaveOnCreate() && _sessionDataStore != null)
|
||||
_sessionDataStore.store(id, session.getSessionData());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.warn("Save of new session {} failed", id, e);
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
|
|
@ -601,15 +601,15 @@ public class FileSessionDataStore extends AbstractSessionDataStore
|
|||
DataInputStream di = new DataInputStream(is);
|
||||
|
||||
id = di.readUTF();
|
||||
String contextPath = di.readUTF();
|
||||
String vhost = di.readUTF();
|
||||
String lastNode = di.readUTF();
|
||||
long created = di.readLong();
|
||||
long accessed = di.readLong();
|
||||
long lastAccessed = di.readLong();
|
||||
long cookieSet = di.readLong();
|
||||
long expiry = di.readLong();
|
||||
long maxIdle = di.readLong();
|
||||
final String contextPath = di.readUTF();
|
||||
final String vhost = di.readUTF();
|
||||
final String lastNode = di.readUTF();
|
||||
final long created = di.readLong();
|
||||
final long accessed = di.readLong();
|
||||
final long lastAccessed = di.readLong();
|
||||
final long cookieSet = di.readLong();
|
||||
final long expiry = di.readLong();
|
||||
final long maxIdle = di.readLong();
|
||||
|
||||
data = newSessionData(id, created, accessed, lastAccessed, maxIdle);
|
||||
data.setContextPath(contextPath);
|
||||
|
|
|
@ -234,6 +234,11 @@ public class SessionData implements Serializable
|
|||
_dirty = dirty;
|
||||
}
|
||||
|
||||
public void setDirty(String name)
|
||||
{
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name the name of the attribute
|
||||
* @return the value of the attribute named
|
||||
|
@ -261,11 +266,6 @@ public class SessionData implements Serializable
|
|||
return old;
|
||||
}
|
||||
|
||||
public void setDirty(String name)
|
||||
{
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
public void putAllAttributes(Map<String, Object> attributes)
|
||||
{
|
||||
_attributes.putAll(attributes);
|
||||
|
|
|
@ -146,6 +146,8 @@ public class ErrorPageErrorHandler extends ErrorHandler implements ErrorHandler.
|
|||
dbg.append(" (from global default)");
|
||||
LOG.debug(dbg.toString());
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException(pageSource.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,8 +85,9 @@ public class FilterMapping implements Dumpable
|
|||
return INCLUDE;
|
||||
case ERROR:
|
||||
return ERROR;
|
||||
default:
|
||||
throw new IllegalStateException(type.toString());
|
||||
}
|
||||
throw new IllegalArgumentException(type.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -109,8 +110,9 @@ public class FilterMapping implements Dumpable
|
|||
return DispatcherType.INCLUDE;
|
||||
case ERROR:
|
||||
return DispatcherType.ERROR;
|
||||
default:
|
||||
throw new IllegalArgumentException(Integer.toString(type));
|
||||
}
|
||||
throw new IllegalArgumentException(Integer.toString(type));
|
||||
}
|
||||
|
||||
private int _dispatches = DEFAULT;
|
||||
|
|
|
@ -109,6 +109,16 @@ public class ServletContextHandler extends ContextHandler
|
|||
return (ServletContextHandler)contextHandler;
|
||||
}
|
||||
|
||||
public static ServletContextHandler getServletContextHandler(ServletContext context)
|
||||
{
|
||||
ContextHandler handler = getContextHandler(context);
|
||||
if (handler == null)
|
||||
return null;
|
||||
if (handler instanceof ServletContextHandler)
|
||||
return (ServletContextHandler)handler;
|
||||
return null;
|
||||
}
|
||||
|
||||
public interface ServletContainerInitializerCaller extends LifeCycle {}
|
||||
|
||||
;
|
||||
|
@ -721,16 +731,6 @@ public class ServletContextHandler extends ContextHandler
|
|||
_objFactory.destroy(filter);
|
||||
}
|
||||
|
||||
public static ServletContextHandler getServletContextHandler(ServletContext context)
|
||||
{
|
||||
ContextHandler handler = getContextHandler(context);
|
||||
if (handler == null)
|
||||
return null;
|
||||
if (handler instanceof ServletContextHandler)
|
||||
return (ServletContextHandler)handler;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static class JspPropertyGroup implements JspPropertyGroupDescriptor
|
||||
{
|
||||
private List<String> _urlPatterns = new ArrayList<String>();
|
||||
|
|
|
@ -384,7 +384,7 @@ public class DoSFilter implements Filter
|
|||
long throttleMs = getThrottleMs();
|
||||
if (!Boolean.TRUE.equals(throttled) && throttleMs > 0)
|
||||
{
|
||||
int priority = getPriority(request, tracker);
|
||||
final int priority = getPriority(request, tracker);
|
||||
request.setAttribute(__THROTTLED, Boolean.TRUE);
|
||||
if (isInsertHeaders())
|
||||
response.addHeader("DoSFilter", "throttled");
|
||||
|
|
|
@ -77,12 +77,12 @@ public abstract class IncludeExcludeBasedFilter implements Filter
|
|||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException
|
||||
{
|
||||
String includedPaths = filterConfig.getInitParameter("includedPaths");
|
||||
String excludedPaths = filterConfig.getInitParameter("excludedPaths");
|
||||
String includedMimeTypes = filterConfig.getInitParameter("includedMimeTypes");
|
||||
String excludedMimeTypes = filterConfig.getInitParameter("excludedMimeTypes");
|
||||
String includedHttpMethods = filterConfig.getInitParameter("includedHttpMethods");
|
||||
String excludedHttpMethods = filterConfig.getInitParameter("excludedHttpMethods");
|
||||
final String includedPaths = filterConfig.getInitParameter("includedPaths");
|
||||
final String excludedPaths = filterConfig.getInitParameter("excludedPaths");
|
||||
final String includedMimeTypes = filterConfig.getInitParameter("includedMimeTypes");
|
||||
final String excludedMimeTypes = filterConfig.getInitParameter("excludedMimeTypes");
|
||||
final String includedHttpMethods = filterConfig.getInitParameter("includedHttpMethods");
|
||||
final String excludedHttpMethods = filterConfig.getInitParameter("excludedHttpMethods");
|
||||
|
||||
if (includedPaths != null)
|
||||
{
|
||||
|
|
|
@ -243,7 +243,7 @@ public class Main
|
|||
|
||||
public void listModules(StartArgs args)
|
||||
{
|
||||
List<String> tags = args.getListModules();
|
||||
final List<String> tags = args.getListModules();
|
||||
|
||||
StartLog.endStartLog();
|
||||
System.out.println();
|
||||
|
@ -275,7 +275,6 @@ public class Main
|
|||
public StartArgs processCommandLine(String[] cmdLine) throws Exception
|
||||
{
|
||||
// Processing Order is important!
|
||||
// ------------------------------------------------------------
|
||||
// 1) Configuration Locations
|
||||
CommandLineConfigSource cmdLineSource = new CommandLineConfigSource(cmdLine);
|
||||
baseHome = new BaseHome(cmdLineSource);
|
||||
|
@ -283,7 +282,6 @@ public class Main
|
|||
StartLog.debug("jetty.home=%s", baseHome.getHome());
|
||||
StartLog.debug("jetty.base=%s", baseHome.getBase());
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 2) Parse everything provided.
|
||||
// This would be the directory information +
|
||||
// the various start inis
|
||||
|
@ -306,13 +304,11 @@ public class Main
|
|||
normalizeURI(baseHome.getBasePath().toUri().toString()),
|
||||
base.source);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 3) Module Registration
|
||||
Modules modules = new Modules(baseHome, args);
|
||||
StartLog.debug("Registering all modules");
|
||||
modules.registerAll();
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 4) Active Module Resolution
|
||||
for (String enabledModule : args.getEnabledModules())
|
||||
{
|
||||
|
@ -343,21 +339,17 @@ public class Main
|
|||
module.setSkipFilesValidation(true);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 5) Lib & XML Expansion / Resolution
|
||||
args.expandSystemProperties();
|
||||
args.expandLibs();
|
||||
args.expandModules(activeModules);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 6) Resolve Extra XMLs
|
||||
args.resolveExtraXmls();
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 7) JPMS Expansion
|
||||
args.expandJPMS(activeModules);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 8) Resolve Property Files
|
||||
args.resolvePropertyFiles();
|
||||
|
||||
|
@ -497,12 +489,18 @@ public class Main
|
|||
}
|
||||
}
|
||||
|
||||
/* implement Apache commons daemon (jsvc) lifecycle methods (init, start, stop, destroy) */
|
||||
public void start() throws Exception
|
||||
{
|
||||
start(jsvcStartArgs);
|
||||
}
|
||||
|
||||
private void doStop(StartArgs args)
|
||||
{
|
||||
Prop stopHostProp = args.getProperties().getProp("STOP.HOST", true);
|
||||
Prop stopPortProp = args.getProperties().getProp("STOP.PORT", true);
|
||||
Prop stopKeyProp = args.getProperties().getProp("STOP.KEY", true);
|
||||
Prop stopWaitProp = args.getProperties().getProp("STOP.WAIT", true);
|
||||
final Prop stopHostProp = args.getProperties().getProp("STOP.HOST", true);
|
||||
final Prop stopPortProp = args.getProperties().getProp("STOP.PORT", true);
|
||||
final Prop stopKeyProp = args.getProperties().getProp("STOP.KEY", true);
|
||||
final Prop stopWaitProp = args.getProperties().getProp("STOP.WAIT", true);
|
||||
|
||||
String stopHost = "127.0.0.1";
|
||||
int stopPort = -1;
|
||||
|
@ -611,6 +609,12 @@ public class Main
|
|||
}
|
||||
}
|
||||
|
||||
/* implement Apache commons daemon (jsvc) lifecycle methods (init, start, stop, destroy) */
|
||||
public void stop() throws Exception
|
||||
{
|
||||
doStop(jsvcStartArgs);
|
||||
}
|
||||
|
||||
public void usage(boolean exit)
|
||||
{
|
||||
StartLog.endStartLog();
|
||||
|
@ -655,8 +659,7 @@ public class Main
|
|||
return resourcePrinted;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// implement Apache commons daemon (jsvc) lifecycle methods (init, start, stop, destroy)
|
||||
/* implement Apache commons daemon (jsvc) lifecycle methods (init, start, stop, destroy) */
|
||||
public void init(String[] args) throws Exception
|
||||
{
|
||||
try
|
||||
|
@ -674,22 +677,7 @@ public class Main
|
|||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// implement Apache commons daemon (jsvc) lifecycle methods (init, start, stop, destroy)
|
||||
public void start() throws Exception
|
||||
{
|
||||
start(jsvcStartArgs);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// implement Apache commons daemon (jsvc) lifecycle methods (init, start, stop, destroy)
|
||||
public void stop() throws Exception
|
||||
{
|
||||
doStop(jsvcStartArgs);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// implement Apache commons daemon (jsvc) lifecycle methods (init, start, stop, destroy)
|
||||
/* implement Apache commons daemon (jsvc) lifecycle methods (init, start, stop, destroy) */
|
||||
public void destroy()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -52,14 +52,6 @@ public class StartLog
|
|||
}
|
||||
}
|
||||
|
||||
public static void trace(String format, Object... args)
|
||||
{
|
||||
if (INSTANCE.trace)
|
||||
{
|
||||
out.printf("TRACE " + format + "%n", args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void debug(Throwable t)
|
||||
{
|
||||
if (INSTANCE.debug)
|
||||
|
@ -68,6 +60,14 @@ public class StartLog
|
|||
}
|
||||
}
|
||||
|
||||
public static void trace(String format, Object... args)
|
||||
{
|
||||
if (INSTANCE.trace)
|
||||
{
|
||||
out.printf("TRACE " + format + "%n", args);
|
||||
}
|
||||
}
|
||||
|
||||
public static StartLog getInstance()
|
||||
{
|
||||
return INSTANCE;
|
||||
|
@ -88,16 +88,16 @@ public class StartLog
|
|||
log("INFO", format, args);
|
||||
}
|
||||
|
||||
public static void warn(String format, Object... args)
|
||||
{
|
||||
log("WARN", format, args);
|
||||
}
|
||||
|
||||
public static void error(String format, Object... args)
|
||||
{
|
||||
log("ERROR", format, args);
|
||||
}
|
||||
|
||||
public static void warn(String format, Object... args)
|
||||
{
|
||||
log("WARN", format, args);
|
||||
}
|
||||
|
||||
public static void warn(Throwable t)
|
||||
{
|
||||
t.printStackTrace(logStream);
|
||||
|
|
|
@ -252,6 +252,8 @@ public class Version implements Comparable<Version>
|
|||
update = val;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException(state.toString());
|
||||
}
|
||||
|
||||
offset++;
|
||||
|
|
|
@ -160,44 +160,9 @@ public class JSON
|
|||
return buffer.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param s String containing JSON object or array.
|
||||
* @return A Map, Object array or primitive array parsed from the JSON.
|
||||
*/
|
||||
public static Object parse(String s)
|
||||
protected String toString(char[] buffer, int offset, int length)
|
||||
{
|
||||
return DEFAULT.parse(new StringSource(s), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param s String containing JSON object or array.
|
||||
* @param stripOuterComment If true, an outer comment around the JSON is ignored.
|
||||
* @return A Map, Object array or primitive array parsed from the JSON.
|
||||
*/
|
||||
public static Object parse(String s, boolean stripOuterComment)
|
||||
{
|
||||
return DEFAULT.parse(new StringSource(s), stripOuterComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param in Reader containing JSON object or array.
|
||||
* @return A Map, Object array or primitive array parsed from the JSON.
|
||||
* @throws IOException if unable to parse
|
||||
*/
|
||||
public static Object parse(Reader in) throws IOException
|
||||
{
|
||||
return DEFAULT.parse(new ReaderSource(in), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param in Reader containing JSON object or array.
|
||||
* @param stripOuterComment If true, an outer comment around the JSON is ignored.
|
||||
* @return A Map, Object array or primitive array parsed from the JSON.
|
||||
* @throws IOException if unable to parse
|
||||
*/
|
||||
public static Object parse(Reader in, boolean stripOuterComment) throws IOException
|
||||
{
|
||||
return DEFAULT.parse(new ReaderSource(in), stripOuterComment);
|
||||
return new String(buffer, offset, length);
|
||||
}
|
||||
|
||||
private void quotedEscape(Appendable buffer, String input)
|
||||
|
@ -558,13 +523,6 @@ public class JSON
|
|||
quotedEscape(buffer, string);
|
||||
}
|
||||
|
||||
// Parsing utilities
|
||||
|
||||
protected String toString(char[] buffer, int offset, int length)
|
||||
{
|
||||
return new String(buffer, offset, length);
|
||||
}
|
||||
|
||||
protected Map<String, Object> newMap()
|
||||
{
|
||||
return new HashMap<String, Object>();
|
||||
|
@ -679,6 +637,46 @@ public class JSON
|
|||
return convertor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param in Reader containing JSON object or array.
|
||||
* @param stripOuterComment If true, an outer comment around the JSON is ignored.
|
||||
* @return A Map, Object array or primitive array parsed from the JSON.
|
||||
* @throws IOException if unable to parse
|
||||
*/
|
||||
public static Object parse(Reader in, boolean stripOuterComment) throws IOException
|
||||
{
|
||||
return DEFAULT.parse(new ReaderSource(in), stripOuterComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param s String containing JSON object or array.
|
||||
* @return A Map, Object array or primitive array parsed from the JSON.
|
||||
*/
|
||||
public static Object parse(String s)
|
||||
{
|
||||
return DEFAULT.parse(new StringSource(s), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param s String containing JSON object or array.
|
||||
* @param stripOuterComment If true, an outer comment around the JSON is ignored.
|
||||
* @return A Map, Object array or primitive array parsed from the JSON.
|
||||
*/
|
||||
public static Object parse(String s, boolean stripOuterComment)
|
||||
{
|
||||
return DEFAULT.parse(new StringSource(s), stripOuterComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param in Reader containing JSON object or array.
|
||||
* @return A Map, Object array or primitive array parsed from the JSON.
|
||||
* @throws IOException if unable to parse
|
||||
*/
|
||||
public static Object parse(Reader in) throws IOException
|
||||
{
|
||||
return DEFAULT.parse(new ReaderSource(in), false);
|
||||
}
|
||||
|
||||
public Object parse(Source source, boolean stripOuterComment)
|
||||
{
|
||||
int commentState = 0; // 0=no comment, 1="/", 2="/*", 3="/* *" -1="//"
|
||||
|
@ -707,6 +705,9 @@ public class JSON
|
|||
commentState = 0;
|
||||
stripState = 2;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// handle /* C style */ comment
|
||||
|
@ -785,6 +786,9 @@ public class JSON
|
|||
break;
|
||||
case '*':
|
||||
commentState = 2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// handle /* C Style */ comment
|
||||
|
@ -1306,24 +1310,6 @@ public class JSON
|
|||
c = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addClass(Class type)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (c == 0)
|
||||
throw new IllegalStateException();
|
||||
_buffer.append(c);
|
||||
_buffer.append("\"class\":");
|
||||
append(_buffer, type.getName());
|
||||
c = ',';
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(String name, Object value)
|
||||
{
|
||||
|
@ -1399,6 +1385,24 @@ public class JSON
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addClass(Class type)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (c == 0)
|
||||
throw new IllegalStateException();
|
||||
_buffer.append(c);
|
||||
_buffer.append("\"class\":");
|
||||
append(_buffer, type.getName());
|
||||
c = ',';
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface Source
|
||||
|
|
|
@ -119,7 +119,6 @@ public class JSONPojoConvertor implements JSON.Convertor
|
|||
switch (m.getParameterCount())
|
||||
{
|
||||
case 0:
|
||||
|
||||
if (m.getReturnType() != null)
|
||||
{
|
||||
if (name.startsWith("is") && name.length() > 2)
|
||||
|
@ -140,6 +139,9 @@ public class JSONPojoConvertor implements JSON.Convertor
|
|||
addSetter(name, m);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -572,12 +572,6 @@ public class ArrayTernaryTrie<V> extends AbstractTrie<V>
|
|||
_trie = new ArrayTernaryTrie<>(insensitive, capacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean put(V v)
|
||||
{
|
||||
return put(v.toString(), v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
|
@ -590,24 +584,6 @@ public class ArrayTernaryTrie<V> extends AbstractTrie<V>
|
|||
return _trie.remove(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(String s)
|
||||
{
|
||||
return _trie.get(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(ByteBuffer b)
|
||||
{
|
||||
return _trie.get(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V getBest(byte[] b, int offset, int len)
|
||||
{
|
||||
return _trie.getBest(b, offset, len);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCaseInsensitive()
|
||||
{
|
||||
|
@ -626,6 +602,12 @@ public class ArrayTernaryTrie<V> extends AbstractTrie<V>
|
|||
_trie.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean put(V v)
|
||||
{
|
||||
return put(v.toString(), v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean put(String s, V v)
|
||||
{
|
||||
|
@ -644,6 +626,18 @@ public class ArrayTernaryTrie<V> extends AbstractTrie<V>
|
|||
return added;
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(String s)
|
||||
{
|
||||
return _trie.get(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(ByteBuffer b)
|
||||
{
|
||||
return _trie.get(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(String s, int offset, int len)
|
||||
{
|
||||
|
@ -656,6 +650,12 @@ public class ArrayTernaryTrie<V> extends AbstractTrie<V>
|
|||
return _trie.get(b, offset, len);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V getBest(byte[] b, int offset, int len)
|
||||
{
|
||||
return _trie.getBest(b, offset, len);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V getBest(String s)
|
||||
{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue