Mercurial Hosting > luan
changeset 977:d35b0a3a7a4a
remove __currentConnection
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 16 Oct 2016 01:31:05 -0600 |
parents | 0697c1219e70 |
children | bdb6eb0fbf93 |
files | src/org/eclipse/jetty/server/AbstractHttpConnection.java src/org/eclipse/jetty/server/AsyncHttpConnection.java src/org/eclipse/jetty/server/BlockingHttpConnection.java src/org/eclipse/jetty/server/Request.java src/org/eclipse/jetty/server/Response.java src/org/eclipse/jetty/server/handler/ContextHandler.java |
diffstat | 6 files changed, 0 insertions(+), 74 deletions(-) [+] |
line wrap: on
line diff
diff -r 0697c1219e70 -r d35b0a3a7a4a src/org/eclipse/jetty/server/AbstractHttpConnection.java --- a/src/org/eclipse/jetty/server/AbstractHttpConnection.java Sun Oct 16 01:14:44 2016 -0600 +++ b/src/org/eclipse/jetty/server/AbstractHttpConnection.java Sun Oct 16 01:31:05 2016 -0600 @@ -93,8 +93,6 @@ { private static final Logger LOG = LoggerFactory.getLogger(AbstractHttpConnection.class); - private static final ThreadLocal<AbstractHttpConnection> __currentConnection = new ThreadLocal<AbstractHttpConnection>(); - private int _requests; private final Connector _connector; @@ -124,16 +122,6 @@ private boolean _delayedHandling = false; private boolean _earlyEOF = false; - public static AbstractHttpConnection getCurrentConnection() - { - return __currentConnection.get(); - } - - protected static void setCurrentConnection(AbstractHttpConnection connection) - { - __currentConnection.set(connection); - } - protected AbstractHttpConnection(Connector connector, EndPoint endpoint) { super(endpoint);
diff -r 0697c1219e70 -r d35b0a3a7a4a src/org/eclipse/jetty/server/AsyncHttpConnection.java --- a/src/org/eclipse/jetty/server/AsyncHttpConnection.java Sun Oct 16 01:14:44 2016 -0600 +++ b/src/org/eclipse/jetty/server/AsyncHttpConnection.java Sun Oct 16 01:31:05 2016 -0600 @@ -59,8 +59,6 @@ try { - setCurrentConnection(this); - // While progress and the connection has not changed while (progress) { @@ -131,8 +129,6 @@ } finally { - setCurrentConnection(null); - // return buffers _parser.returnBuffers(); _generator.returnBuffers();
diff -r 0697c1219e70 -r d35b0a3a7a4a src/org/eclipse/jetty/server/BlockingHttpConnection.java --- a/src/org/eclipse/jetty/server/BlockingHttpConnection.java Sun Oct 16 01:14:44 2016 -0600 +++ b/src/org/eclipse/jetty/server/BlockingHttpConnection.java Sun Oct 16 01:31:05 2016 -0600 @@ -48,8 +48,6 @@ { try { - setCurrentConnection(this); - // do while the endpoint is open // AND the connection has not changed while (_endp.isOpen()) @@ -109,7 +107,6 @@ } finally { - setCurrentConnection(null); _parser.returnBuffers(); _generator.returnBuffers(); }
diff -r 0697c1219e70 -r d35b0a3a7a4a src/org/eclipse/jetty/server/Request.java --- a/src/org/eclipse/jetty/server/Request.java Sun Oct 16 01:14:44 2016 -0600 +++ b/src/org/eclipse/jetty/server/Request.java Sun Oct 16 01:31:05 2016 -0600 @@ -132,14 +132,6 @@ private static final Collection __defaultLocale = Collections.singleton(Locale.getDefault()); private static final int __NONE = 0, _STREAM = 1, __READER = 2; - - public static Request getRequest(HttpServletRequest request) - { - if (request instanceof Request) - return (Request)request; - - return AbstractHttpConnection.getCurrentConnection().getRequest(); - } private volatile Attributes _attributes; private MultiMap<String> _baseParameters; private String _characterEncoding;
diff -r 0697c1219e70 -r d35b0a3a7a4a src/org/eclipse/jetty/server/Response.java --- a/src/org/eclipse/jetty/server/Response.java Sun Oct 16 01:14:44 2016 -0600 +++ b/src/org/eclipse/jetty/server/Response.java Sun Oct 16 01:31:05 2016 -0600 @@ -81,15 +81,6 @@ */ public final static String HTTP_ONLY_COMMENT="__HTTP_ONLY__"; - - public static Response getResponse(HttpServletResponse response) - { - if (response instanceof Response) - return (Response)response; - - return AbstractHttpConnection.getCurrentConnection().getResponse(); - } - private final AbstractHttpConnection _connection; private int _status=SC_OK; private String _reason;
diff -r 0697c1219e70 -r d35b0a3a7a4a src/org/eclipse/jetty/server/handler/ContextHandler.java --- a/src/org/eclipse/jetty/server/handler/ContextHandler.java Sun Oct 16 01:14:44 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/ContextHandler.java Sun Oct 16 01:31:05 2016 -0600 @@ -133,7 +133,6 @@ private Map<String, String> _localeEncodingMap; private String[] _welcomeFiles; private String[] _vhosts; - private Set<String> _connectors; private EventListener[] _eventListeners; private Logger _logger; private boolean _allowNullPathInfo; @@ -361,35 +360,6 @@ } /* ------------------------------------------------------------ */ - /** - * @return an array of connector names that this context will accept a request from. - */ - public String[] getConnectorNames() - { - if (_connectors == null || _connectors.size() == 0) - return null; - - return _connectors.toArray(new String[_connectors.size()]); - } - - /* ------------------------------------------------------------ */ - /** - * Set the names of accepted connectors. - * - * Names are either "host:port" or a specific configured name for a connector. - * - * @param connectors - * If non null, an array of connector names that this context will accept a request from. - */ - public void setConnectorNames(String[] connectors) - { - if (connectors == null || connectors.length == 0) - _connectors = null; - else - _connectors = new HashSet<String>(Arrays.asList(connectors)); - } - - /* ------------------------------------------------------------ */ /* * @see javax.servlet.ServletContext#getAttribute(java.lang.String) */ @@ -870,14 +840,6 @@ return false; } - // Check the connector - if (_connectors != null && _connectors.size() > 0) - { - String connector = AbstractHttpConnection.getCurrentConnection().getConnector().getName(); - if (connector == null || !_connectors.contains(connector)) - return false; - } - // Are we not the root context? if (_contextPath.length() > 1) {