From a4d4b3ab571fa56b02d611f2b565d03ccccb1347 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 7 Aug 2014 09:22:22 +1000 Subject: [PATCH] fix work around classloaders for field preencoders --- .../org/eclipse/jetty/http/PreEncodedHttpField.java | 2 +- .../org/eclipse/jetty/server/AbstractConnector.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java b/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java index f8f983a0b35..6ae9e1fcb68 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java @@ -52,7 +52,7 @@ public class PreEncodedHttpField extends HttpField { try { - HttpFieldPreEncoder enc = iter.next(); + encoders.add(iter.next()); } catch(Error|RuntimeException e) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index 3106eec2575..027f5a26075 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -366,6 +366,19 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co _defaultProtocol=factory.getProtocol(); } } + + public void addIfAbsentConnectionFactory(ConnectionFactory factory) + { + synchronized (_factories) + { + if (_factories.containsKey(factory.getProtocol())) + return; + _factories.put(factory.getProtocol().toLowerCase(Locale.ENGLISH), factory); + addBean(factory); + if (_defaultProtocol==null) + _defaultProtocol=factory.getProtocol(); + } + } public ConnectionFactory removeConnectionFactory(String protocol) {