Index: 3rdParty_sources/undertow/io/undertow/Handlers.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/Attic/Handlers.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/Handlers.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/Handlers.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow; import io.undertow.attribute.ExchangeAttribute; @@ -24,11 +6,9 @@ import io.undertow.predicate.PredicatesHandler; import io.undertow.server.HttpHandler; import io.undertow.server.JvmRouteHandler; -import io.undertow.server.RoutingHandler; import io.undertow.server.handlers.AccessControlListHandler; import io.undertow.server.handlers.DateHandler; import io.undertow.server.handlers.DisableCacheHandler; -import io.undertow.server.handlers.ExceptionHandler; import io.undertow.server.handlers.GracefulShutdownHandler; import io.undertow.server.handlers.HttpContinueAcceptingHandler; import io.undertow.server.handlers.HttpContinueReadHandler; @@ -41,7 +21,6 @@ import io.undertow.server.handlers.PredicateHandler; import io.undertow.server.handlers.ProxyPeerAddressHandler; import io.undertow.server.handlers.RedirectHandler; -import io.undertow.server.handlers.RequestDumpingHandler; import io.undertow.server.handlers.RequestLimit; import io.undertow.server.handlers.RequestLimitingHandler; import io.undertow.server.handlers.ResponseCodeHandler; @@ -95,23 +74,6 @@ /** * * @param rewriteQueryParams If the query params should be rewritten - * @return The routing handler - */ - public static RoutingHandler routing(boolean rewriteQueryParams) { - return new RoutingHandler(rewriteQueryParams); - } - - /** - * - * @return a new routing handler - */ - public static RoutingHandler routing() { - return new RoutingHandler(); - } - - /** - * - * @param rewriteQueryParams If the query params should be rewritten * @return The path template handler */ public static PathTemplateHandler pathTemplate(boolean rewriteQueryParams) { @@ -481,25 +443,6 @@ return new DisableCacheHandler(next); } - /** - * Returns a handler that dumps requests to the log for debugging purposes. - * - * @param next The next handler - * @return The request dumping handler - */ - public static HttpHandler requestDump(final HttpHandler next) { - return new RequestDumpingHandler(next); - } - - /** - * Returns a handler that maps exceptions to additional handlers - * @param next The next handler - * @return The exception handler - */ - public static ExceptionHandler exceptionHandler(final HttpHandler next) { - return new ExceptionHandler(next); - } - private Handlers() { } Index: 3rdParty_sources/undertow/io/undertow/Undertow.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/Attic/Undertow.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/Undertow.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/Undertow.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,31 +1,17 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow; +import java.net.Inet4Address; +import java.net.InetSocketAddress; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; + +import io.undertow.server.protocol.ajp.AjpOpenListener; import io.undertow.security.api.AuthenticationMode; import io.undertow.security.api.GSSAPIServerSubjectFactory; import io.undertow.security.idm.IdentityManager; import io.undertow.server.HttpHandler; -import io.undertow.server.OpenListener; -import io.undertow.server.protocol.ajp.AjpOpenListener; import io.undertow.server.protocol.http.HttpOpenListener; -import io.undertow.server.protocol.spdy.SpdyOpenListener; import org.xnio.BufferAllocator; import org.xnio.ByteBufferSlicePool; import org.xnio.ChannelListener; @@ -46,11 +32,6 @@ import javax.net.ssl.KeyManager; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; -import java.net.Inet4Address; -import java.net.InetSocketAddress; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; /** * Convenience class used to build an Undertow server. @@ -66,7 +47,7 @@ private final int ioThreads; private final int workerThreads; private final boolean directBuffers; - private final List listeners = new ArrayList<>(); + private final List listeners = new ArrayList(); private final HttpHandler rootHandler; private final OptionMap workerOptions; private final OptionMap socketOptions; @@ -98,7 +79,7 @@ public synchronized void start() { xnio = Xnio.getInstance(Undertow.class.getClassLoader()); - channels = new ArrayList<>(); + channels = new ArrayList>(); try { worker = xnio.createWorker(OptionMap.builder() .set(Options.WORKER_IO_THREADS, ioThreads) @@ -121,6 +102,7 @@ .getMap(); + Pool buffers = new ByteBufferSlicePool(directBuffers ? BufferAllocator.DIRECT_BYTE_BUFFER_ALLOCATOR : BufferAllocator.BYTE_BUFFER_ALLOCATOR, bufferSize, bufferSize * buffersPerRegion); for (ListenerConfig listener : listeners) { @@ -131,32 +113,26 @@ AcceptingChannel server = worker.createStreamConnectionServer(new InetSocketAddress(Inet4Address.getByName(listener.host), listener.port), acceptListener, socketOptions); server.resumeAccepts(); channels.add(server); - } else { - OptionMap undertowOptions = OptionMap.builder().set(UndertowOptions.BUFFER_PIPELINED_DATA, true).addAll(serverOptions).getMap(); - if (listener.type == ListenerType.HTTP) { - HttpOpenListener openListener = new HttpOpenListener(buffers, undertowOptions, bufferSize); - openListener.setRootHandler(rootHandler); - ChannelListener> acceptListener = ChannelListeners.openListenerAdapter(openListener); - AcceptingChannel server = worker.createStreamConnectionServer(new InetSocketAddress(Inet4Address.getByName(listener.host), listener.port), acceptListener, socketOptions); - server.resumeAccepts(); - channels.add(server); - } else if (listener.type == ListenerType.HTTPS) { - OpenListener openListener = new HttpOpenListener(buffers, undertowOptions, bufferSize); - if(serverOptions.get(UndertowOptions.ENABLE_SPDY, false)) { - openListener = new SpdyOpenListener(buffers, new ByteBufferSlicePool(BufferAllocator.BYTE_BUFFER_ALLOCATOR, 1024, 1024), undertowOptions, bufferSize, (HttpOpenListener) openListener); - } - openListener.setRootHandler(rootHandler); - ChannelListener> acceptListener = ChannelListeners.openListenerAdapter(openListener); - XnioSsl xnioSsl; - if (listener.sslContext != null) { - xnioSsl = new JsseXnioSsl(xnio, OptionMap.create(Options.USE_DIRECT_BUFFERS, true), listener.sslContext); - } else { - xnioSsl = xnio.getSslProvider(listener.keyManagers, listener.trustManagers, OptionMap.create(Options.USE_DIRECT_BUFFERS, true)); - } - AcceptingChannel sslServer = xnioSsl.createSslConnectionServer(worker, new InetSocketAddress(Inet4Address.getByName(listener.host), listener.port), (ChannelListener) acceptListener, socketOptions); - sslServer.resumeAccepts(); - channels.add(sslServer); + } else if (listener.type == ListenerType.HTTP) { + HttpOpenListener openListener = new HttpOpenListener(buffers, OptionMap.builder().set(UndertowOptions.BUFFER_PIPELINED_DATA, true).addAll(serverOptions).getMap(), bufferSize); + openListener.setRootHandler(rootHandler); + ChannelListener> acceptListener = ChannelListeners.openListenerAdapter(openListener); + AcceptingChannel server = worker.createStreamConnectionServer(new InetSocketAddress(Inet4Address.getByName(listener.host), listener.port), acceptListener, socketOptions); + server.resumeAccepts(); + channels.add(server); + } else if (listener.type == ListenerType.HTTPS){ + HttpOpenListener openListener = new HttpOpenListener(buffers, OptionMap.builder().set(UndertowOptions.BUFFER_PIPELINED_DATA, true).addAll(serverOptions).getMap(), bufferSize); + openListener.setRootHandler(rootHandler); + ChannelListener> acceptListener = ChannelListeners.openListenerAdapter(openListener); + XnioSsl xnioSsl; + if(listener.sslContext != null) { + xnioSsl = new JsseXnioSsl(xnio, OptionMap.create(Options.USE_DIRECT_BUFFERS, true), listener.sslContext); + } else { + xnioSsl = xnio.getSslProvider(listener.keyManagers, listener.trustManagers, OptionMap.create(Options.USE_DIRECT_BUFFERS, true)); } + AcceptingChannel sslServer = xnioSsl.createSslConnectionServer(worker, new InetSocketAddress(Inet4Address.getByName(listener.host), listener.port), (ChannelListener) acceptListener, socketOptions); + sslServer.resumeAccepts(); + channels.add(sslServer); } } @@ -177,6 +153,7 @@ } + public static enum ListenerType { HTTP, HTTPS, @@ -199,7 +176,6 @@ this.trustManagers = trustManagers; this.sslContext = null; } - private ListenerConfig(final ListenerType type, final int port, final String host, SSLContext sslContext) { this.type = type; this.port = port; @@ -278,7 +254,7 @@ private int ioThreads; private int workerThreads; private boolean directBuffers; - private final List listeners = new ArrayList<>(); + private final List listeners = new ArrayList(); private HttpHandler handler; private final OptionMap.Builder workerOptions = OptionMap.builder(); @@ -335,6 +311,7 @@ return this; } + public Builder addAjpListener(int port, String host) { listeners.add(new ListenerConfig(ListenerType.AJP, port, host, null, null)); return this; Index: 3rdParty_sources/undertow/io/undertow/UndertowLogger.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/Attic/UndertowLogger.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/UndertowLogger.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/UndertowLogger.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow; @@ -142,14 +142,6 @@ void couldNotRegisterChangeListener(@Cause Exception e); @LogMessage(level = Logger.Level.ERROR) - @Message(id = 5025, value = "Could not initiate SPDY connection and no HTTP fallback defined") - void couldNotInitiateSpdyConnection(); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 5026, value = "Jetty ALPN support not found on boot class path, SPDY client will not be available.") - void jettyALPNNotFound(); - - @LogMessage(level = Logger.Level.ERROR) @Message(id = 5027, value = "Timing out request to %s") void timingOutRequest(String requestURI); @@ -164,16 +156,4 @@ @LogMessage(level = Logger.Level.ERROR) @Message(id = 5031, value = "Proxy request to %s could not connect to backend server %s") void proxyFailedToConnectToBackend(String requestURI, URI uri); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 5032, value = "Listener not making progress on framed channel, closing channel to prevent infinite loop") - void listenerNotProgressing(); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 5033, value = "Failed to initiate HTTP2 connection") - void couldNotInitiateHttp2Connection(); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 5034, value = "Remote endpoint failed to send initial settings frame in HTTP2 connection") - void remoteEndpointFailedToSendInitialSettings(); } Index: 3rdParty_sources/undertow/io/undertow/UndertowMessages.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/Attic/UndertowMessages.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/UndertowMessages.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/UndertowMessages.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow; @@ -220,7 +220,7 @@ IllegalStateException fileSystemWatcherNotStarted(); @Message(id = 65, value = "SSL must be specified to connect to a https URL") - IOException sslWasNull(); + IllegalArgumentException sslWasNull(); @Message(id = 66, value = "Incorrect magic number for AJP packet header") IOException wrongMagicNumber(); @@ -282,60 +282,6 @@ @Message(id = 85, value = "Could not generate unique session id") RuntimeException couldNotGenerateUniqueSessionId(); - @Message(id = 86, value = "SPDY needs to be provided with a heap buffer pool, for use in compressing and decompressing headers.") - IllegalArgumentException mustProvideHeapBuffer(); - - @Message(id = 87, value = "Unexpected SPDY frame type %s") - IOException unexpectedFrameType(int type); - - @Message(id = 88, value = "SPDY control frames cannot have body content") - IOException controlFrameCannotHaveBodyContent(); - - @Message(id = 89, value = "SPDY not supported") - IOException spdyNotSupported(); - - @Message(id = 90, value = "Jetty NPN not available") - IOException jettyNPNNotAvailable(); - @Message(id = 91, value = "Buffer has already been freed") IllegalStateException bufferAlreadyFreed(); - - @Message(id = 92, value = "A SPDY header was too large to fit in a response buffer, if you want to support larger headers please increase the buffer size") - IllegalStateException headersTooLargeToFitInHeapBuffer(); - - @Message(id = 93, value = "A SPDY stream was reset by the remote endpoint") - IOException spdyStreamWasReset(); - - @Message(id = 94, value = "Blocking await method called from IO thread. Blocking IO must be dispatched to a worker thread or deadlocks will result.") - IOException awaitCalledFromIoThread(); - - @Message(id = 95, value = "Recursive call to flushSenders()") - RuntimeException recursiveCallToFlushingSenders(); - - @Message(id = 96, value = "More data was written to the channel than specified in the content-length") - IllegalStateException fixedLengthOverflow(); - - @Message(id = 97, value = "AJP request already in progress") - IllegalStateException ajpRequestAlreadyInProgress(); - - @Message(id = 98, value = "HTTP ping data must be 8 bytes in length") - IllegalArgumentException httpPingDataMustBeLength8(); - - @Message(id = 99, value = "Received a ping of size other than 8") - String invalidPingSize(); - - @Message(id = 100, value = "stream id must be zero for frame type %s") - String streamIdMustBeZeroForFrameType(int frameType); - - @Message(id = 101, value = "stream id must not be zero for frame type %s") - String streamIdMustNotBeZeroForFrameType(int frameType); - - @Message(id = 102, value = "RST_STREAM received for idle stream") - String rstStreamReceivedForIdleStream(); - - @Message(id = 103, value = "Http2 stream was reset") - IOException http2StreamWasReset(); - - @Message(id = 104, value = "Incorrect HTTP2 preface") - IOException incorrectHttp2Preface(); } Index: 3rdParty_sources/undertow/io/undertow/UndertowOptions.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/Attic/UndertowOptions.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/UndertowOptions.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/UndertowOptions.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow; @@ -51,12 +51,8 @@ /** * The idle timeout in milliseconds after which the channel will be closed. - * - * If the underlying channel already has a read or write timeout set the smaller of the two values will be used - * for read/write timeouts. - * */ - public static final Option IDLE_TIMEOUT = Option.simple(UndertowOptions.class, "IDLE_TIMEOUT", Integer.class); + public static final Option IDLE_TIMEOUT = Option.simple(UndertowOptions.class, "IDLE_TIMEOUT", Long.class); /** * The maximum number of parameters that will be parsed. This is used to protect against hash vulnerabilities. @@ -156,29 +152,6 @@ */ public static final Option ALLOW_EQUALS_IN_COOKIE_VALUE = Option.simple(UndertowOptions.class, "ALLOW_EQUALS_IN_COOKIE_VALUE", Boolean.class); - /** - * If we should attempt to use SPDY for HTTPS connections. - */ - public static final Option ENABLE_SPDY = Option.simple(UndertowOptions.class, "ENABLE_SPDY", Boolean.class); - - /** - * If we should attempt to use HTTP2 for HTTPS connections. - */ - public static final Option ENABLE_HTTP2 = Option.simple(UndertowOptions.class, "ENABLE_HTTP2", Boolean.class); - - /** - * The size of the header table that is used in the encoder - */ - public static final Option HTTP2_SETTINGS_HEADER_TABLE_SIZE = Option.simple(UndertowOptions.class, "HTTP2_SETTINGS_HEADER_TABLE_SIZE", Integer.class); - public static final int HTTP2_SETTINGS_HEADER_TABLE_SIZE_DEFAULT = 4096; - - public static final Option HTTP2_SETTINGS_ENABLE_PUSH = Option.simple(UndertowOptions.class, "HTTP2_SETTINGS_ENABLE_PUSH", Boolean.class); - public static final Option HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = Option.simple(UndertowOptions.class, "HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS", Integer.class); - - public static final Option HTTP2_SETTINGS_INITIAL_WINDOW_SIZE = Option.simple(UndertowOptions.class, "HTTP2_SETTINGS_INITIAL_WINDOW_SIZE", Integer.class); - public static final Option HTTP2_SETTINGS_MAX_FRAME_SIZE = Option.simple(UndertowOptions.class, "HTTP2_SETTINGS_MAX_FRAME_SIZE", Integer.class); - public static final Option HTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = Option.simple(UndertowOptions.class, "HTTP2_SETTINGS_MAX_HEADER_LIST_SIZE", Integer.class); - private UndertowOptions() { } Index: 3rdParty_sources/undertow/io/undertow/Version.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/Attic/Version.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/Version.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/Version.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow; import java.util.Properties; Index: 3rdParty_sources/undertow/io/undertow/attribute/BytesSentAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/BytesSentAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/BytesSentAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/BytesSentAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/CompositeExchangeAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/CompositeExchangeAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/CompositeExchangeAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/CompositeExchangeAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/ConstantExchangeAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ConstantExchangeAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ConstantExchangeAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ConstantExchangeAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/CookieAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/CookieAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/CookieAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/CookieAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/DateTimeAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/DateTimeAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/DateTimeAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/DateTimeAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import java.util.Date; Index: 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ExchangeAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttributeBuilder.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ExchangeAttributeBuilder.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttributeBuilder.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttributeBuilder.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.attribute; Index: 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttributeParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ExchangeAttributeParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttributeParser.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttributeParser.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import java.util.ArrayList; @@ -43,7 +25,7 @@ ExchangeAttributeParser(final ClassLoader classLoader, List wrappers) { this.wrappers = wrappers; ServiceLoader loader = ServiceLoader.load(ExchangeAttributeBuilder.class, classLoader); - final List builders = new ArrayList<>(); + final List builders = new ArrayList(); for (ExchangeAttributeBuilder instance : loader) { builders.add(instance); } @@ -64,7 +46,7 @@ * @return */ public ExchangeAttribute parse(final String valueString) { - final List attributes = new ArrayList<>(); + final List attributes = new ArrayList(); int pos = 0; int state = 0; //0 = literal, 1 = %, 2 = %{, 3 = $, 4 = ${ for (int i = 0; i < valueString.length(); ++i) { Index: 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttributes.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ExchangeAttributes.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttributes.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ExchangeAttributes.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/IdentUsernameAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/IdentUsernameAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/IdentUsernameAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/IdentUsernameAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/LocalIPAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/LocalIPAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/LocalIPAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/LocalIPAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import java.net.InetSocketAddress; Index: 3rdParty_sources/undertow/io/undertow/attribute/LocalPortAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/LocalPortAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/LocalPortAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/LocalPortAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import java.net.InetSocketAddress; Index: 3rdParty_sources/undertow/io/undertow/attribute/LocalServerNameAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/LocalServerNameAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/LocalServerNameAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/LocalServerNameAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/attribute/PathParameterAttribute.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/attribute/PredicateContextAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/PredicateContextAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/PredicateContextAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/PredicateContextAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import java.util.Map; Index: 3rdParty_sources/undertow/io/undertow/attribute/QueryParameterAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/QueryParameterAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/QueryParameterAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/QueryParameterAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; @@ -62,7 +44,7 @@ @Override public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException { - final ArrayDeque value = new ArrayDeque<>(); + final ArrayDeque value = new ArrayDeque(); value.add(newValue); exchange.getQueryParameters().put(parameter, value); } Index: 3rdParty_sources/undertow/io/undertow/attribute/QueryStringAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/QueryStringAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/QueryStringAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/QueryStringAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; @@ -38,11 +20,7 @@ @Override public String readAttribute(final HttpServerExchange exchange) { - String qs = exchange.getQueryString(); - if(qs.isEmpty()) { - return qs; - } - return '?' + qs; + return exchange.getQueryString(); } @Override Index: 3rdParty_sources/undertow/io/undertow/attribute/ReadOnlyAttributeException.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ReadOnlyAttributeException.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ReadOnlyAttributeException.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ReadOnlyAttributeException.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.UndertowMessages; Index: 3rdParty_sources/undertow/io/undertow/attribute/RelativePathAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/RelativePathAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/RelativePathAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/RelativePathAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; @@ -57,7 +39,7 @@ final String newQueryString = newValue.substring(pos); exchange.setQueryString(newQueryString); - exchange.getQueryParameters().putAll(QueryParameterUtils.parseQueryString(newQueryString.substring(1), QueryParameterUtils.getQueryParamEncoding(exchange))); + exchange.getQueryParameters().putAll(QueryParameterUtils.parseQueryString(newQueryString.substring(1))); } } Index: 3rdParty_sources/undertow/io/undertow/attribute/RemoteIPAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/RemoteIPAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/RemoteIPAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/RemoteIPAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import java.net.InetSocketAddress; Index: 3rdParty_sources/undertow/io/undertow/attribute/RemoteUserAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/RemoteUserAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/RemoteUserAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/RemoteUserAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.security.api.SecurityContext; Index: 3rdParty_sources/undertow/io/undertow/attribute/RequestHeaderAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/RequestHeaderAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/RequestHeaderAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/RequestHeaderAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/RequestLineAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/RequestLineAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/RequestLineAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/RequestLineAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; @@ -38,17 +20,12 @@ @Override public String readAttribute(final HttpServerExchange exchange) { - StringBuilder sb = new StringBuilder() + return new StringBuilder() .append(exchange.getRequestMethod().toString()) .append(' ') - .append(exchange.getRequestURI()); - if (!exchange.getQueryString().isEmpty()) { - sb.append('?'); - sb.append(exchange.getQueryString()); - } - sb.append(' ') + .append(exchange.getRequestURI()) + .append(' ') .append(exchange.getProtocol().toString()).toString(); - return sb.toString(); } @Override Index: 3rdParty_sources/undertow/io/undertow/attribute/RequestMethodAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/RequestMethodAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/RequestMethodAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/RequestMethodAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/RequestProtocolAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/RequestProtocolAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/RequestProtocolAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/RequestProtocolAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/RequestURLAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/RequestURLAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/RequestURLAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/RequestURLAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; @@ -58,7 +40,7 @@ exchange.setResolvedPath(""); final String newQueryString = newValue.substring(pos); exchange.setQueryString(newQueryString); - exchange.getQueryParameters().putAll(QueryParameterUtils.parseQueryString(newQueryString.substring(1), QueryParameterUtils.getQueryParamEncoding(exchange))); + exchange.getQueryParameters().putAll(QueryParameterUtils.parseQueryString(newQueryString.substring(1))); } } Index: 3rdParty_sources/undertow/io/undertow/attribute/ResponseCodeAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ResponseCodeAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ResponseCodeAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ResponseCodeAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/ResponseHeaderAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ResponseHeaderAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ResponseHeaderAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ResponseHeaderAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/ResponseTimeAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ResponseTimeAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ResponseTimeAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ResponseTimeAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/SslCipherAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/SslCipherAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/SslCipherAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/SslCipherAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/SslClientCertAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/SslClientCertAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/SslClientCertAttribute.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/SslClientCertAttribute.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/SslSessionIdAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/SslSessionIdAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/SslSessionIdAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/SslSessionIdAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/attribute/ThreadNameAttribute.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/attribute/Attic/ThreadNameAttribute.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/attribute/ThreadNameAttribute.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/attribute/ThreadNameAttribute.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.attribute; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/channels/DelegatingStreamSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/channels/Attic/DelegatingStreamSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/channels/DelegatingStreamSinkChannel.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/channels/DelegatingStreamSinkChannel.java 8 Sep 2014 10:52:16 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.channels; import java.io.IOException; @@ -38,8 +20,8 @@ public abstract class DelegatingStreamSinkChannel implements StreamSinkChannel { protected final StreamSinkChannel delegate; - protected final ChannelListener.SimpleSetter writeSetter = new ChannelListener.SimpleSetter<>(); - protected final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter<>(); + protected final ChannelListener.SimpleSetter writeSetter = new ChannelListener.SimpleSetter(); + protected final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter(); public DelegatingStreamSinkChannel(final StreamSinkChannel delegate) { this.delegate = delegate; Index: 3rdParty_sources/undertow/io/undertow/channels/DelegatingStreamSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/channels/Attic/DelegatingStreamSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/channels/DelegatingStreamSourceChannel.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/channels/DelegatingStreamSourceChannel.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.channels; import java.io.IOException; @@ -37,8 +19,8 @@ */ public abstract class DelegatingStreamSourceChannel implements StreamSourceChannel { - protected final ChannelListener.SimpleSetter readSetter = new ChannelListener.SimpleSetter<>(); - protected final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter<>(); + protected final ChannelListener.SimpleSetter readSetter = new ChannelListener.SimpleSetter(); + protected final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter(); protected final StreamSourceChannel delegate; public DelegatingStreamSourceChannel(final StreamSourceChannel delegate) { Index: 3rdParty_sources/undertow/io/undertow/channels/DetachableStreamSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/channels/Attic/DetachableStreamSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/channels/DetachableStreamSinkChannel.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/channels/DetachableStreamSinkChannel.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.channels; import io.undertow.UndertowMessages; @@ -43,11 +25,11 @@ public abstract class DetachableStreamSinkChannel implements StreamSinkChannel { - protected final StreamSinkChannel delegate; + protected final ConduitStreamSinkChannel delegate; protected ChannelListener.SimpleSetter writeSetter; protected ChannelListener.SimpleSetter closeSetter; - public DetachableStreamSinkChannel(final StreamSinkChannel delegate) { + public DetachableStreamSinkChannel(final ConduitStreamSinkChannel delegate) { this.delegate = delegate; } @@ -137,13 +119,9 @@ @Override public ChannelListener.Setter getWriteSetter() { if (writeSetter == null) { - writeSetter = new ChannelListener.SimpleSetter<>(); + writeSetter = new ChannelListener.SimpleSetter(); if (!isFinished()) { - if(delegate instanceof ConduitStreamSinkChannel) { - ((ConduitStreamSinkChannel) delegate).setWriteListener(ChannelListeners.delegatingChannelListener(this, writeSetter)); - } else { - delegate.getWriteSetter().set(ChannelListeners.delegatingChannelListener(this, writeSetter)); - } + delegate.setWriteListener(ChannelListeners.delegatingChannelListener(this, writeSetter)); } } return writeSetter; @@ -152,9 +130,9 @@ @Override public ChannelListener.Setter getCloseSetter() { if (closeSetter == null) { - closeSetter = new ChannelListener.SimpleSetter<>(); + closeSetter = new ChannelListener.SimpleSetter(); if (!isFinished()) { - delegate.getCloseSetter().set(ChannelListeners.delegatingChannelListener(this, closeSetter)); + delegate.setCloseListener(ChannelListeners.delegatingChannelListener(this, closeSetter)); } } return closeSetter; @@ -256,13 +234,8 @@ } public void responseDone() { - if(delegate instanceof ConduitStreamSinkChannel) { - ((ConduitStreamSinkChannel) delegate).setCloseListener(null); - ((ConduitStreamSinkChannel) delegate).setWriteListener(null); - } else { - delegate.getCloseSetter().set(null); - delegate.getWriteSetter().set(null); - } + delegate.setCloseListener(null); + delegate.setWriteListener(null); if (delegate.isWriteResumed()) { delegate.suspendWrites(); } Index: 3rdParty_sources/undertow/io/undertow/channels/DetachableStreamSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/channels/Attic/DetachableStreamSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/channels/DetachableStreamSourceChannel.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/channels/DetachableStreamSourceChannel.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,27 +1,6 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.channels; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.channels.FileChannel; -import java.util.concurrent.TimeUnit; +import io.undertow.UndertowMessages; import org.xnio.ChannelListener; import org.xnio.ChannelListeners; import org.xnio.Option; @@ -32,7 +11,10 @@ import org.xnio.channels.StreamSourceChannel; import org.xnio.conduits.ConduitStreamSourceChannel; -import io.undertow.UndertowMessages; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.FileChannel; +import java.util.concurrent.TimeUnit; /** * A stream source channel that can be marked as detached. Once this is marked as detached then @@ -42,12 +24,12 @@ */ public abstract class DetachableStreamSourceChannel implements StreamSourceChannel{ - protected final StreamSourceChannel delegate; + protected final ConduitStreamSourceChannel delegate; protected ChannelListener.SimpleSetter readSetter; protected ChannelListener.SimpleSetter closeSetter; - public DetachableStreamSourceChannel(final StreamSourceChannel delegate) { + public DetachableStreamSourceChannel(final ConduitStreamSourceChannel delegate) { this.delegate = delegate; } @@ -121,13 +103,9 @@ public ChannelListener.Setter getReadSetter() { if (readSetter == null) { - readSetter = new ChannelListener.SimpleSetter<>(); + readSetter = new ChannelListener.SimpleSetter(); if (!isFinished()) { - if(delegate instanceof ConduitStreamSourceChannel) { - ((ConduitStreamSourceChannel)delegate).setReadListener(ChannelListeners.delegatingChannelListener(this, readSetter)); - } else { - delegate.getReadSetter().set(ChannelListeners.delegatingChannelListener(this, readSetter)); - } + delegate.setReadListener(ChannelListeners.delegatingChannelListener(this, readSetter)); } } return readSetter; @@ -174,13 +152,9 @@ public ChannelListener.Setter getCloseSetter() { if (closeSetter == null) { - closeSetter = new ChannelListener.SimpleSetter<>(); + closeSetter = new ChannelListener.SimpleSetter(); if (!isFinished()) { - if(delegate instanceof ConduitStreamSourceChannel) { - ((ConduitStreamSourceChannel)delegate).setCloseListener(ChannelListeners.delegatingChannelListener(this, closeSetter)); - } else { - delegate.getCloseSetter().set(ChannelListeners.delegatingChannelListener(this, closeSetter)); - } + delegate.setCloseListener(ChannelListeners.delegatingChannelListener(this, closeSetter)); } } return closeSetter; Index: 3rdParty_sources/undertow/io/undertow/channels/GatedStreamSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/channels/Attic/GatedStreamSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/channels/GatedStreamSinkChannel.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/channels/GatedStreamSinkChannel.java 8 Sep 2014 10:52:16 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.channels; @@ -48,8 +48,8 @@ */ public final class GatedStreamSinkChannel implements StreamSinkChannel { private final StreamSinkChannel delegate; - private final ChannelListener.SimpleSetter writeSetter = new ChannelListener.SimpleSetter<>(); - private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter<>(); + private final ChannelListener.SimpleSetter writeSetter = new ChannelListener.SimpleSetter(); + private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter(); /** * Construct a new instance. Index: 3rdParty_sources/undertow/io/undertow/channels/GatedStreamSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/channels/Attic/GatedStreamSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/channels/GatedStreamSourceChannel.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/channels/GatedStreamSourceChannel.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.channels; @@ -47,8 +47,8 @@ */ public final class GatedStreamSourceChannel implements StreamSourceChannel { private final StreamSourceChannel delegate; - private final ChannelListener.SimpleSetter readSetter = new ChannelListener.SimpleSetter<>(); - private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter<>(); + private final ChannelListener.SimpleSetter readSetter = new ChannelListener.SimpleSetter(); + private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter(); /** * Construct a new instance. Index: 3rdParty_sources/undertow/io/undertow/channels/ReadTimeoutStreamSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/channels/Attic/ReadTimeoutStreamSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/channels/ReadTimeoutStreamSourceChannel.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/channels/ReadTimeoutStreamSourceChannel.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.channels; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/channels/WriteTimeoutStreamSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/channels/Attic/WriteTimeoutStreamSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/channels/WriteTimeoutStreamSinkChannel.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/channels/WriteTimeoutStreamSinkChannel.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.channels; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/client/ClientCallback.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/ClientCallback.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ClientCallback.java 8 Sep 2014 09:46:51 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ClientCallback.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/client/ClientConnection.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/ClientConnection.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ClientConnection.java 8 Sep 2014 09:46:52 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ClientConnection.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; import org.xnio.ChannelListener; Index: 3rdParty_sources/undertow/io/undertow/client/ClientExchange.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/ClientExchange.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ClientExchange.java 8 Sep 2014 09:46:52 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ClientExchange.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; import io.undertow.util.Attachable; Index: 3rdParty_sources/undertow/io/undertow/client/ClientProvider.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/ClientProvider.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ClientProvider.java 8 Sep 2014 09:46:52 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ClientProvider.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; import org.xnio.OptionMap; @@ -24,7 +6,6 @@ import org.xnio.XnioWorker; import org.xnio.ssl.XnioSsl; -import java.net.InetSocketAddress; import java.net.URI; import java.nio.ByteBuffer; import java.util.Set; @@ -41,10 +22,6 @@ void connect(final ClientCallback listener, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool bufferPool, OptionMap options); - void connect(final ClientCallback listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool bufferPool, OptionMap options); - void connect(final ClientCallback listener, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool bufferPool, OptionMap options); - void connect(final ClientCallback listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool bufferPool, OptionMap options); - } Index: 3rdParty_sources/undertow/io/undertow/client/ClientRequest.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/ClientRequest.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ClientRequest.java 8 Sep 2014 09:46:51 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ClientRequest.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; import io.undertow.util.AbstractAttachable; Index: 3rdParty_sources/undertow/io/undertow/client/ClientResponse.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/ClientResponse.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ClientResponse.java 8 Sep 2014 09:46:51 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ClientResponse.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; import io.undertow.util.AbstractAttachable; Index: 3rdParty_sources/undertow/io/undertow/client/ContinueNotification.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/ContinueNotification.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ContinueNotification.java 8 Sep 2014 09:46:51 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ContinueNotification.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; /** Index: 3rdParty_sources/undertow/io/undertow/client/ProxiedRequestAttachments.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/ProxiedRequestAttachments.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ProxiedRequestAttachments.java 8 Sep 2014 09:46:52 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ProxiedRequestAttachments.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; import io.undertow.util.AttachmentKey; @@ -41,5 +23,6 @@ public static final AttachmentKey SSL_SESSION_ID = AttachmentKey.create(byte[].class); public static final AttachmentKey SSL_KEY_SIZE = AttachmentKey.create(Integer.class); public static final AttachmentKey SECRET = AttachmentKey.create(String.class); + public static final AttachmentKey STORED_METHOD = AttachmentKey.create(String.class); } Index: 3rdParty_sources/undertow/io/undertow/client/UndertowClient.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/UndertowClient.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/UndertowClient.java 8 Sep 2014 09:46:52 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/UndertowClient.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; import org.xnio.FutureResult; @@ -24,10 +6,8 @@ import org.xnio.Pool; import org.xnio.XnioIoThread; import org.xnio.XnioWorker; -import org.xnio.ssl.XnioSsl; import java.io.IOException; -import java.net.InetSocketAddress; import java.net.URI; import java.nio.ByteBuffer; import java.util.Collections; @@ -53,7 +33,7 @@ private UndertowClient(final ClassLoader classLoader) { ServiceLoader providers = ServiceLoader.load(ClientProvider.class, classLoader); - final Map map = new HashMap<>(); + final Map map = new HashMap(); for (ClientProvider provider : providers) { for (String scheme : provider.handlesSchemes()) { map.put(scheme, provider); @@ -63,20 +43,8 @@ } public IoFuture connect(final URI uri, final XnioWorker worker, Pool bufferPool, OptionMap options) { - return connect(uri, worker, null, bufferPool, options); - } - - public IoFuture connect(InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, Pool bufferPool, OptionMap options) { - return connect(bindAddress, uri, worker, null, bufferPool, options); - } - - public IoFuture connect(final URI uri, final XnioWorker worker, XnioSsl ssl, Pool bufferPool, OptionMap options) { - return connect((InetSocketAddress) null, uri, worker, ssl, bufferPool, options); - } - - public IoFuture connect(InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool bufferPool, OptionMap options) { ClientProvider provider = getClientProvider(uri); - final FutureResult result = new FutureResult<>(); + final FutureResult result = new FutureResult(); provider.connect(new ClientCallback() { @Override public void completed(ClientConnection r) { @@ -87,26 +55,14 @@ public void failed(IOException e) { result.setException(e); } - }, bindAddress, uri, worker, ssl, bufferPool, options); + }, uri, worker, null, bufferPool, options + ); return result.getIoFuture(); } public IoFuture connect(final URI uri, final XnioIoThread ioThread, Pool bufferPool, OptionMap options) { - return connect((InetSocketAddress) null, uri, ioThread, null, bufferPool, options); - } - - - public IoFuture connect(InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, Pool bufferPool, OptionMap options) { - return connect(bindAddress, uri, ioThread, null, bufferPool, options); - } - - public IoFuture connect(final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool bufferPool, OptionMap options) { - return connect((InetSocketAddress) null, uri, ioThread, ssl, bufferPool, options); - } - - public IoFuture connect(InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool bufferPool, OptionMap options) { ClientProvider provider = getClientProvider(uri); - final FutureResult result = new FutureResult<>(); + final FutureResult result = new FutureResult(); provider.connect(new ClientCallback() { @Override public void completed(ClientConnection r) { @@ -117,47 +73,22 @@ public void failed(IOException e) { result.setException(e); } - }, bindAddress, uri, ioThread, ssl, bufferPool, options); + }, uri, ioThread, null, bufferPool, options + ); return result.getIoFuture(); } - public void connect(final ClientCallback listener, final URI uri, final XnioWorker worker, Pool bufferPool, OptionMap options) { - connect(listener, uri, worker, null, bufferPool, options); - } - public void connect(final ClientCallback listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, Pool bufferPool, OptionMap options) { - connect(listener, bindAddress, uri, worker, null, bufferPool, options); - } - - public void connect(final ClientCallback listener, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool bufferPool, OptionMap options) { + public void connect(final ClientCallback listener, final URI uri, final XnioWorker worker, Pool bufferPool, OptionMap options) { ClientProvider provider = getClientProvider(uri); - provider.connect(listener, uri, worker, ssl, bufferPool, options); + provider.connect(listener, uri, worker, null, bufferPool, options); } - public void connect(final ClientCallback listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, XnioSsl ssl, Pool bufferPool, OptionMap options) { - ClientProvider provider = getClientProvider(uri); - provider.connect(listener, bindAddress, uri, worker, ssl, bufferPool, options); - } - public void connect(final ClientCallback listener, final URI uri, final XnioIoThread ioThread, Pool bufferPool, OptionMap options) { - connect(listener, uri, ioThread, null, bufferPool, options); - } - - - public void connect(final ClientCallback listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, Pool bufferPool, OptionMap options) { - connect(listener, bindAddress, uri, ioThread, null, bufferPool, options); - } - - public void connect(final ClientCallback listener, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool bufferPool, OptionMap options) { ClientProvider provider = getClientProvider(uri); - provider.connect(listener, uri, ioThread, ssl, bufferPool, options); + provider.connect(listener, uri, ioThread, null, bufferPool, options); } - public void connect(final ClientCallback listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, XnioSsl ssl, Pool bufferPool, OptionMap options) { - ClientProvider provider = getClientProvider(uri); - provider.connect(listener, bindAddress, uri, ioThread, ssl, bufferPool, options); - } - private ClientProvider getClientProvider(URI uri) { ClientProvider provider = clientProviders.get(uri.getScheme()); if (provider == null) { Index: 3rdParty_sources/undertow/io/undertow/client/UndertowClientMessages.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/Attic/UndertowClientMessages.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/UndertowClientMessages.java 8 Sep 2014 09:46:51 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/UndertowClientMessages.java 8 Sep 2014 10:52:09 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client; import io.undertow.util.HttpString; Index: 3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientConnection.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/ajp/Attic/AjpClientConnection.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientConnection.java 8 Sep 2014 09:47:10 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientConnection.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,89 +1,101 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. + * Copyright 2012, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. * - * http://www.apache.org/licenses/LICENSE-2.0 + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package io.undertow.client.ajp; -import static io.undertow.util.Headers.CLOSE; -import static io.undertow.util.Headers.CONNECTION; -import static io.undertow.util.Headers.CONTENT_LENGTH; -import static io.undertow.util.Headers.TRANSFER_ENCODING; -import static io.undertow.util.Headers.UPGRADE; -import static org.xnio.Bits.anyAreSet; -import static org.xnio.IoUtils.safeClose; - -import java.io.Closeable; -import java.io.IOException; -import java.net.SocketAddress; -import java.nio.ByteBuffer; -import java.util.ArrayDeque; -import java.util.Deque; +import io.undertow.UndertowLogger; +import io.undertow.client.ClientCallback; +import io.undertow.client.ClientConnection; +import io.undertow.client.ClientExchange; +import io.undertow.client.ClientRequest; +import io.undertow.client.ClientResponse; +import io.undertow.client.UndertowClientMessages; +import io.undertow.conduits.ConduitListener; +import io.undertow.util.AbstractAttachable; +import io.undertow.util.Protocols; import org.xnio.ChannelExceptionHandler; import org.xnio.ChannelListener; import org.xnio.ChannelListeners; +import org.xnio.IoUtils; import org.xnio.Option; import org.xnio.OptionMap; import org.xnio.Pool; +import org.xnio.Pooled; import org.xnio.StreamConnection; import org.xnio.XnioIoThread; import org.xnio.XnioWorker; -import org.xnio.channels.Channels; import org.xnio.channels.StreamSinkChannel; +import org.xnio.channels.StreamSourceChannel; +import org.xnio.conduits.ConduitStreamSinkChannel; +import org.xnio.conduits.ConduitStreamSourceChannel; +import org.xnio.conduits.PushBackStreamSourceConduit; +import org.xnio.conduits.StreamSinkConduit; +import org.xnio.conduits.StreamSourceConduit; -import io.undertow.UndertowLogger; -import io.undertow.UndertowMessages; -import io.undertow.client.ClientCallback; -import io.undertow.client.ClientConnection; -import io.undertow.client.ClientExchange; -import io.undertow.client.ClientRequest; -import io.undertow.client.ClientResponse; -import io.undertow.client.UndertowClientMessages; -import io.undertow.protocols.ajp.AbstractAjpClientStreamSourceChannel; -import io.undertow.protocols.ajp.AjpClientChannel; -import io.undertow.protocols.ajp.AjpClientRequestClientStreamSinkChannel; -import io.undertow.protocols.ajp.AjpClientResponseStreamSourceChannel; -import io.undertow.util.AbstractAttachable; -import io.undertow.util.Protocols; +import java.io.Closeable; +import java.io.IOException; +import java.net.SocketAddress; +import java.nio.ByteBuffer; +import java.util.ArrayDeque; +import java.util.Deque; +import static io.undertow.client.UndertowClientMessages.MESSAGES; +import static io.undertow.util.Headers.CLOSE; +import static io.undertow.util.Headers.CONNECTION; +import static io.undertow.util.Headers.CONTENT_LENGTH; +import static io.undertow.util.Headers.TRANSFER_ENCODING; +import static io.undertow.util.Headers.UPGRADE; +import static org.xnio.Bits.allAreSet; +import static org.xnio.Bits.anyAreSet; +import static org.xnio.IoUtils.safeClose; + /** * @author David M. Lloyd */ class AjpClientConnection extends AbstractAttachable implements Closeable, ClientConnection { - public final ChannelListener requestFinishListener = new ChannelListener() { + public final ConduitListener requestFinishListener = new ConduitListener() { @Override - public void handleEvent(AjpClientRequestClientStreamSinkChannel channel) { + public void handleEvent(StreamSinkConduit channel) { currentRequest.terminateRequest(); } }; - public final ChannelListener responseFinishedListener = new ChannelListener() { + public final ConduitListener responseFinishedListener = new ConduitListener() { @Override - public void handleEvent(AjpClientResponseStreamSourceChannel channel) { + public void handleEvent(StreamSourceConduit channel) { currentRequest.terminateResponse(); } }; - private final Deque pendingQueue = new ArrayDeque<>(); + private final Deque pendingQueue = new ArrayDeque(); private AjpClientExchange currentRequest; + private AjpResponseBuilder pendingResponse; private final OptionMap options; - private final AjpClientChannel connection; + private final StreamConnection connection; + private final PushBackStreamSourceConduit pushBackStreamSourceConduit; private final Pool bufferPool; + private final StreamSinkConduit originalSinkConduit; private static final int UPGRADED = 1 << 28; private static final int UPGRADE_REQUESTED = 1 << 29; @@ -92,22 +104,23 @@ private int state; - private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter<>(); - private final ClientReceiveListener clientReceiveListener = new ClientReceiveListener(); + private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter(); + private final ClientReadListener clientReadListener = new ClientReadListener(); - AjpClientConnection(final AjpClientChannel connection, final OptionMap options, final Pool bufferPool) { + AjpClientConnection(final StreamConnection connection, final OptionMap options, final Pool bufferPool) { this.options = options; this.connection = connection; + this.pushBackStreamSourceConduit = new PushBackStreamSourceConduit(connection.getSourceChannel().getConduit()); + this.connection.getSourceChannel().setConduit(pushBackStreamSourceConduit); this.bufferPool = bufferPool; + this.originalSinkConduit = connection.getSinkChannel().getConduit(); - connection.addCloseTask(new ChannelListener() { - @Override - public void handleEvent(AjpClientChannel channel) { + connection.getCloseSetter().set(new ChannelListener() { + + public void handleEvent(StreamConnection channel) { ChannelListeners.invokeChannelListener(AjpClientConnection.this, closeSetter.get()); } }); - connection.getReceiveSetter().set(new ClientReceiveListener()); - connection.resumeReceives(); } @Override @@ -121,6 +134,10 @@ return connection.getPeerAddress(); } + StreamConnection getConnection() { + return connection; + } + @Override public A getPeerAddress(Class type) { return connection.getPeerAddress(type); @@ -193,6 +210,7 @@ private void initiateRequest(AjpClientExchange AjpClientExchange) { currentRequest = AjpClientExchange; + pendingResponse = new AjpResponseBuilder(); ClientRequest request = AjpClientExchange.getRequest(); String connectionString = request.getRequestHeaders().getFirst(CONNECTION); @@ -207,7 +225,13 @@ state |= UPGRADE_REQUESTED; } + //setup the client request conduits + final ConduitStreamSourceChannel sourceChannel = connection.getSourceChannel(); + sourceChannel.setReadListener(clientReadListener); + sourceChannel.resumeReads(); + long length = 0; + ConduitStreamSinkChannel sinkChannel = connection.getSinkChannel(); String fixedLengthString = request.getRequestHeaders().getFirst(CONTENT_LENGTH); String transferEncodingString = request.getRequestHeaders().getLast(TRANSFER_ENCODING); @@ -216,42 +240,65 @@ } else if (transferEncodingString != null) { length = -1; } + final AjpClientRequestConduit ajpClientRequestConduit = new AjpClientRequestConduit(originalSinkConduit, bufferPool, currentRequest, requestFinishListener, length); + currentRequest.setAjpClientRequestConduit(ajpClientRequestConduit); + sinkChannel.setConduit(ajpClientRequestConduit); - AjpClientRequestClientStreamSinkChannel sinkChannel = connection.sendRequest(request.getMethod(), request.getPath(), request.getProtocol(), request.getRequestHeaders(), request, requestFinishListener); - currentRequest.setRequestChannel(sinkChannel); - AjpClientExchange.invokeReadReadyCallback(AjpClientExchange); if (length == 0) { //if there is no content we flush the response channel. //otherwise it is up to the user try { sinkChannel.shutdownWrites(); if (!sinkChannel.flush()) { - handleFailedFlush(sinkChannel); + sinkChannel.setWriteListener(ChannelListeners.flushingChannelListener(null, new ChannelExceptionHandler() { + @Override + public void handleException(ConduitStreamSinkChannel channel, IOException exception) { + handleError(exception); + } + })); } } catch (IOException e) { handleError(e); } + } else if (!sinkChannel.isWriteResumed()) { + try { + //TODO: this needs some more thought + if (!sinkChannel.flush()) { + sinkChannel.setWriteListener(new ChannelListener() { + @Override + public void handleEvent(ConduitStreamSinkChannel channel) { + try { + if (channel.flush()) { + channel.suspendWrites(); + } + } catch (IOException e) { + handleError(e); + } + } + }); + sinkChannel.resumeWrites(); + } + } catch (IOException e) { + handleError(e); + } } } - private void handleFailedFlush(AjpClientRequestClientStreamSinkChannel sinkChannel) { - sinkChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, new ChannelExceptionHandler() { - @Override - public void handleException(StreamSinkChannel channel, IOException exception) { - handleError(exception); - } - })); - sinkChannel.resumeWrites(); - } - private void handleError(IOException exception) { currentRequest.setFailed(exception); - safeClose(connection); + IoUtils.safeClose(connection); } public StreamConnection performUpgrade() throws IOException { - throw UndertowMessages.MESSAGES.upgradeNotSupported(); + + // Upgrade the connection + // Set the upgraded flag already to prevent new requests after this one + if (allAreSet(state, UPGRADED | CLOSE_REQ | CLOSED)) { + throw new IOException(UndertowClientMessages.MESSAGES.connectionClosed()); + } + state |= UPGRADED; + return connection; } public void close() throws IOException { @@ -266,18 +313,28 @@ * Notification that the current request is finished */ public void requestDone() { - currentRequest = null; + connection.getSinkChannel().setConduit(originalSinkConduit); + connection.getSourceChannel().setConduit(pushBackStreamSourceConduit); + connection.getSinkChannel().suspendWrites(); + connection.getSinkChannel().setWriteListener(null); + if (anyAreSet(state, CLOSE_REQ)) { - safeClose(connection); + currentRequest = null; + IoUtils.safeClose(connection); } else if (anyAreSet(state, UPGRADE_REQUESTED)) { - safeClose(connection); //we don't support upgrade, just close the connection to be safe + connection.getSourceChannel().suspendReads(); + currentRequest = null; return; } + currentRequest = null; AjpClientExchange next = pendingQueue.poll(); - if (next != null) { + if (next == null) { + connection.getSourceChannel().setReadListener(clientReadListener); + connection.getSourceChannel().resumeReads(); + } else { initiateRequest(next); } } @@ -286,36 +343,219 @@ state |= CLOSE_REQ; } + public void installReadBodyListener() { + connection.getSourceChannel().setConduit(pushBackStreamSourceConduit); + connection.getSourceChannel().setReadListener(new ResponseReceivedReadListener()); + connection.getSourceChannel().resumeReads(); + } - class ClientReceiveListener implements ChannelListener { + class ClientReadListener implements ChannelListener { - public void handleEvent(AjpClientChannel channel) { + public void handleEvent(StreamSourceChannel channel) { + + AjpResponseBuilder builder = pendingResponse; + final Pooled pooled = bufferPool.allocate(); + final ByteBuffer buffer = pooled.getResource(); + buffer.clear(); + boolean free = true; + try { - AbstractAjpClientStreamSourceChannel result = channel.receive(); - if(result == null) { + if (builder == null) { + //read ready when no request pending + buffer.clear(); + try { + int res = channel.read(buffer); + if (res == -1) { + UndertowLogger.CLIENT_LOGGER.debugf("Connection to %s was closed by the target server", connection.getPeerAddress()); + IoUtils.safeClose(AjpClientConnection.this); + } else if (res != 0) { + UndertowLogger.CLIENT_LOGGER.debugf("Target server %s sent unexpected data when no request pending, closing connection", connection.getPeerAddress()); + IoUtils.safeClose(AjpClientConnection.this); + } + //otherwise it is a spurious notification + } catch (IOException e) { + if (UndertowLogger.CLIENT_LOGGER.isDebugEnabled()) { + UndertowLogger.CLIENT_LOGGER.debugf(e, "Connection closed with IOException"); + } + safeClose(connection); + } return; } + final AjpResponseParseState state = builder.getParseState(); + int res; + do { + try { + res = channel.read(buffer); + } catch (IOException e) { + if (UndertowLogger.CLIENT_LOGGER.isDebugEnabled()) { + UndertowLogger.CLIENT_LOGGER.debugf(e, "Connection closed with IOException"); + } + safeClose(channel); + currentRequest.setFailed(new IOException(MESSAGES.connectionClosed())); + return; + } - if(result instanceof AjpClientResponseStreamSourceChannel) { - AjpClientResponseStreamSourceChannel response = (AjpClientResponseStreamSourceChannel) result; - response.setFinishListener(responseFinishedListener); - ClientResponse cr = new ClientResponse(response.getStatusCode(), response.getReasonPhrase(), currentRequest.getRequest().getProtocol(), response.getHeaders()); - if (response.getStatusCode() == 100) { - currentRequest.setContinueResponse(cr); + buffer.flip(); + + if (res == 0 && !buffer.hasRemaining()) { + if (!channel.isReadResumed()) { + channel.getReadSetter().set(this); + channel.resumeReads(); + } + return; + } else if (res == -1 && !buffer.hasRemaining()) { + channel.suspendReads(); + IoUtils.safeClose(AjpClientConnection.this); + try { + final StreamSinkChannel requestChannel = connection.getSinkChannel(); + requestChannel.shutdownWrites(); + // will return false if there's a response queued ahead of this one, so we'll set up a listener then + if (!requestChannel.flush()) { + requestChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, null)); + requestChannel.resumeWrites(); + } + // Cancel the current active request + currentRequest.setFailed(new IOException(MESSAGES.connectionClosed())); + } catch (IOException e) { + if (UndertowLogger.CLIENT_LOGGER.isDebugEnabled()) { + UndertowLogger.CLIENT_LOGGER.debugf(e, "Connection closed with IOException when attempting to shut down reads"); + } + // Cancel the current active request + currentRequest.setFailed(e); + IoUtils.safeClose(channel); + return; + } + return; + } + + AjpResponseParser.INSTANCE.parse(buffer, state, builder); + + //this is a bit hacky + //if the state=6 it is a ready body chunk response and not headers + //in which case we notify the conduit and reset the state + if (state.isComplete()) { + if (state.prefix == 6) { + currentRequest.getAjpClientRequestConduit().setBodyChunkRequested(state.currentIntegerPart); + state.reset(); + buffer.compact(); + } else if (buffer.hasRemaining()) { + free = false; + pushBackStreamSourceConduit.pushBack(pooled); + } } else { - currentRequest.setResponseChannel(response); - currentRequest.setResponse(cr); + buffer.clear(); } + + } while (!state.isComplete()); + + final ClientResponse response = builder.build(); + + //check if an updated worked + if (anyAreSet(AjpClientConnection.this.state, UPGRADE_REQUESTED)) { + String connectionString = response.getResponseHeaders().getFirst(CONNECTION); + if (connectionString == null || !UPGRADE.equalToString(connectionString)) { + //just unset the upgrade requested flag + AjpClientConnection.this.state &= ~UPGRADE_REQUESTED; + } + } + + if (builder.getStatusCode() == 100) { + pendingResponse = new AjpResponseBuilder(); + currentRequest.setContinueResponse(response); } else { - //TODO: ping, pong ETC - Channels.drain(result, Long.MAX_VALUE); + connection.getSourceChannel().setConduit(new AjpClientResponseConduit(connection.getSourceChannel().getConduit(), AjpClientConnection.this, currentRequest.getAjpClientRequestConduit(), responseFinishedListener)); + channel.getReadSetter().set(null); + channel.suspendReads(); + pendingResponse = null; + currentRequest.setResponse(response); } + } catch (Exception e) { UndertowLogger.CLIENT_LOGGER.exceptionProcessingRequest(e); - safeClose(connection); - currentRequest.setFailed(e instanceof IOException ? (IOException) e : new IOException(e)); + IoUtils.safeClose(connection); + currentRequest.setFailed( e instanceof IOException ? (IOException) e : new IOException(e)); + } finally { + if (free) pooled.free(); } } } + + /** + * Listener that only listens for read body chunk messages, as even after the response is done the server + * can still be reading the request. + */ + class ResponseReceivedReadListener implements ChannelListener { + + private AjpResponseBuilder builder = new AjpResponseBuilder(); + + public void handleEvent(StreamSourceChannel channel) { + + final Pooled pooled = bufferPool.allocate(); + final ByteBuffer buffer = pooled.getResource(); + buffer.clear(); + boolean free = true; + + try { + final AjpResponseParseState state = builder.getParseState(); + int res; + do { + try { + res = channel.read(buffer); + } catch (IOException e) { + if (UndertowLogger.CLIENT_LOGGER.isDebugEnabled()) { + UndertowLogger.CLIENT_LOGGER.debugf(e, "Connection closed with IOException"); + } + safeClose(channel); + currentRequest.setFailed(new IOException(MESSAGES.connectionClosed())); + return; + } + + buffer.flip(); + + if (res == 0 && !buffer.hasRemaining()) { + if (!channel.isReadResumed()) { + channel.getReadSetter().set(this); + channel.resumeReads(); + } + return; + } else if (res == -1 && !buffer.hasRemaining()) { + channel.suspendReads(); + IoUtils.safeClose(connection); + currentRequest.setFailed(new IOException(UndertowClientMessages.MESSAGES.connectionClosed())); + return; + } + + AjpResponseParser.INSTANCE.parse(buffer, state, builder); + + //this is a bit hacky + //if the state=6 it is a ready body chunk response and not headers + //in which case we notify the conduit and reset the state + if (state.isComplete()) { + if (state.prefix == 6) { + currentRequest.getAjpClientRequestConduit().setBodyChunkRequested(state.currentIntegerPart); + state.reset(); + buffer.compact(); + } else { + //todo: ping? + UndertowLogger.CLIENT_LOGGER.debugf("Received invalid AJP response code %s with no request active, closing connection", state.prefix); + //invalid, at this point read body chunk is all the server should be sending + IoUtils.safeClose(connection); + currentRequest.setFailed(UndertowClientMessages.MESSAGES.receivedInvalidChunk(state.prefix)); + } + } else { + buffer.clear(); + } + + } while (!state.isComplete()); + + } catch (Exception e) { + UndertowLogger.CLIENT_LOGGER.exceptionProcessingRequest(e); + IoUtils.safeClose(connection); + } finally { + if (free) pooled.free(); + } + } + } + } Index: 3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientExchange.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/ajp/Attic/AjpClientExchange.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientExchange.java 8 Sep 2014 09:47:10 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientExchange.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client.ajp; import io.undertow.channels.DetachableStreamSinkChannel; @@ -26,9 +8,6 @@ import io.undertow.client.ClientRequest; import io.undertow.client.ClientResponse; import io.undertow.client.ContinueNotification; -import io.undertow.protocols.ajp.AjpClientChannel; -import io.undertow.protocols.ajp.AjpClientRequestClientStreamSinkChannel; -import io.undertow.protocols.ajp.AjpClientResponseStreamSourceChannel; import io.undertow.util.AbstractAttachable; import io.undertow.util.Headers; import org.xnio.channels.StreamSinkChannel; @@ -50,15 +29,12 @@ private ClientCallback responseCallback; private ClientCallback readyCallback; private ContinueNotification continueNotification; - private AjpClientChannel ajpClientChannel; + private AjpClientRequestConduit ajpClientRequestConduit; private ClientResponse response; private ClientResponse continueResponse; private IOException failedReason; - private AjpClientResponseStreamSourceChannel responseChannel; - private AjpClientRequestClientStreamSinkChannel requestChannel; - private int state = 0; private static final int REQUEST_TERMINATED = 1; private static final int RESPONSE_TERMINATED = 1 << 1; @@ -89,6 +65,8 @@ state |= RESPONSE_TERMINATED; if (anyAreSet(state, REQUEST_TERMINATED)) { clientConnection.requestDone(); + } else { + clientConnection.installReadBodyListener(); } } @@ -142,7 +120,7 @@ @Override public StreamSinkChannel getRequestChannel() { - return new DetachableStreamSinkChannel(requestChannel) { + return new DetachableStreamSinkChannel(clientConnection.getConnection().getSinkChannel()) { @Override protected boolean isFinished() { return anyAreSet(state, REQUEST_TERMINATED); @@ -152,7 +130,7 @@ @Override public StreamSourceChannel getResponseChannel() { - return new DetachableStreamSourceChannel(responseChannel) { + return new DetachableStreamSourceChannel(clientConnection.getConnection().getSourceChannel()) { @Override protected boolean isFinished() { return anyAreSet(state, RESPONSE_TERMINATED); @@ -180,18 +158,18 @@ return clientConnection; } - void setResponseChannel(AjpClientResponseStreamSourceChannel responseChannel) { - this.responseChannel = responseChannel; - } - - void setRequestChannel(AjpClientRequestClientStreamSinkChannel requestChannel) { - this.requestChannel = requestChannel; - } - void invokeReadReadyCallback(final ClientExchange result) { if(readyCallback != null) { readyCallback.completed(result); readyCallback = null; } } + + public AjpClientRequestConduit getAjpClientRequestConduit() { + return ajpClientRequestConduit; + } + + public void setAjpClientRequestConduit(AjpClientRequestConduit ajpClientRequestConduit) { + this.ajpClientRequestConduit = ajpClientRequestConduit; + } } Index: 3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientProvider.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/ajp/Attic/AjpClientProvider.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientProvider.java 8 Sep 2014 09:47:10 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientProvider.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,28 +1,8 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client.ajp; import io.undertow.client.ClientCallback; import io.undertow.client.ClientConnection; import io.undertow.client.ClientProvider; -import io.undertow.protocols.ajp.AjpClientChannel; - import org.xnio.ChannelListener; import org.xnio.IoFuture; import org.xnio.OptionMap; @@ -46,67 +26,45 @@ @Override public Set handlesSchemes() { - return new HashSet<>(Arrays.asList(new String[]{"ajp"})); + return new HashSet(Arrays.asList(new String[]{"ajp"})); } @Override public void connect(final ClientCallback listener, final URI uri, final XnioWorker worker, final XnioSsl ssl, final Pool bufferPool, final OptionMap options) { - connect(listener, null, uri, worker, ssl, bufferPool, options); - } - - @Override - public void connect(final ClientCallback listener, final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final Pool bufferPool, final OptionMap options) { - connect(listener, null, uri, ioThread, ssl, bufferPool, options); - } - - @Override - public void connect(final ClientCallback listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, final XnioSsl ssl, final Pool bufferPool, final OptionMap options) { - ChannelListener openListener = new ChannelListener() { + worker.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 8009 : uri.getPort()), new ChannelListener() { @Override public void handleEvent(StreamConnection connection) { handleConnected(connection, listener, uri, ssl, bufferPool, options); } - }; - IoFuture.Notifier notifier = new IoFuture.Notifier() { + }, options).addNotifier(new IoFuture.Notifier() { @Override public void notify(IoFuture ioFuture, Object o) { if (ioFuture.getStatus() == IoFuture.Status.FAILED) { listener.failed(ioFuture.getException()); } } - }; - if(bindAddress == null) { - worker.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 8009 : uri.getPort()), openListener, options).addNotifier(notifier, null); - } else { - worker.openStreamConnection(bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 8009 : uri.getPort()), openListener, null, options).addNotifier(notifier, null); - } + }, null); } @Override - public void connect(final ClientCallback listener, InetSocketAddress bindAddress,final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final Pool bufferPool, final OptionMap options) { - ChannelListener openListener = new ChannelListener() { + public void connect(final ClientCallback listener, final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final Pool bufferPool, final OptionMap options) { + ioThread.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 8009 : uri.getPort()), new ChannelListener() { @Override public void handleEvent(StreamConnection connection) { handleConnected(connection, listener, uri, ssl, bufferPool, options); } - }; - IoFuture.Notifier notifier = new IoFuture.Notifier() { + }, options).addNotifier(new IoFuture.Notifier() { @Override public void notify(IoFuture ioFuture, Object o) { - if (ioFuture.getStatus() == IoFuture.Status.FAILED) { + if(ioFuture.getStatus() == IoFuture.Status.FAILED) { listener.failed(ioFuture.getException()); } } - }; - if(bindAddress == null) { - ioThread.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 8009 : uri.getPort()), openListener, options).addNotifier(notifier, null); - } else { - ioThread.openStreamConnection(bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 8009 : uri.getPort()), openListener, null, options).addNotifier(notifier, null); - } + }, null); } private void handleConnected(StreamConnection connection, ClientCallback listener, URI uri, XnioSsl ssl, Pool bufferPool, OptionMap options) { - listener.completed(new AjpClientConnection(new AjpClientChannel(connection, bufferPool) , options, bufferPool)); + listener.completed(new AjpClientConnection(connection, options, bufferPool)); } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientRequestConduit.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/ajp/AjpClientResponseConduit.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/ajp/AjpResponseBuilder.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/ajp/AjpResponseParseState.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/ajp/AjpResponseParser.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/client/http/ClientFixedLengthStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/http/Attic/ClientFixedLengthStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/http/ClientFixedLengthStreamSinkConduit.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/http/ClientFixedLengthStreamSinkConduit.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client.http; import io.undertow.conduits.AbstractFixedLengthStreamSinkConduit; Index: 3rdParty_sources/undertow/io/undertow/client/http/HttpClientConnection.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/http/Attic/HttpClientConnection.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/http/HttpClientConnection.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/http/HttpClientConnection.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,19 +1,23 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. + * Copyright 2012, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. * - * http://www.apache.org/licenses/LICENSE-2.0 + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package io.undertow.client.http; @@ -37,6 +41,7 @@ import org.xnio.ChannelExceptionHandler; import org.xnio.ChannelListener; import org.xnio.ChannelListeners; +import org.xnio.IoUtils; import org.xnio.Option; import org.xnio.OptionMap; import org.xnio.Pool; @@ -88,7 +93,7 @@ } }; - private final Deque pendingQueue = new ArrayDeque<>(); + private final Deque pendingQueue = new ArrayDeque(); private HttpClientExchange currentRequest; private HttpResponseBuilder pendingResponse; @@ -108,7 +113,7 @@ private int state; - private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter<>(); + private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter(); HttpClientConnection(final StreamConnection connection, final OptionMap options, final Pool bufferPool) { this.options = options; @@ -285,6 +290,27 @@ } catch (IOException e) { handleError(e); } + } else if (!sinkChannel.isWriteResumed()) { + try { + //TODO: this needs some more thought + if (!sinkChannel.flush()) { + sinkChannel.setWriteListener(new ChannelListener() { + @Override + public void handleEvent(ConduitStreamSinkChannel channel) { + try { + if (channel.flush()) { + channel.suspendWrites(); + } + } catch (IOException e) { + handleError(e); + } + } + }); + sinkChannel.resumeWrites(); + } + } catch (IOException e) { + handleError(e); + } } } @@ -326,7 +352,7 @@ if (anyAreSet(state, CLOSE_REQ)) { currentRequest = null; this.state |= CLOSED; - safeClose(connection); + IoUtils.safeClose(connection); } else if (anyAreSet(state, UPGRADE_REQUESTED)) { connection.getSourceChannel().suspendReads(); currentRequest = null; @@ -363,10 +389,10 @@ int res = channel.read(buffer); if(res == -1) { UndertowLogger.CLIENT_LOGGER.debugf("Connection to %s was closed by the target server", connection.getPeerAddress()); - safeClose(HttpClientConnection.this); + IoUtils.safeClose(HttpClientConnection.this); } else if(res != 0) { UndertowLogger.CLIENT_LOGGER.debugf("Target server %s sent unexpected data when no request pending, closing connection", connection.getPeerAddress()); - safeClose(HttpClientConnection.this); + IoUtils.safeClose(HttpClientConnection.this); } //otherwise it is a spurious notification } catch (IOException e) { @@ -400,7 +426,7 @@ return; } else if (res == -1) { channel.suspendReads(); - safeClose(HttpClientConnection.this); + IoUtils.safeClose(HttpClientConnection.this); // Cancel the current active request currentRequest.setFailed(new IOException(MESSAGES.connectionClosed())); return; @@ -448,7 +474,7 @@ } catch (Exception e) { UndertowLogger.CLIENT_LOGGER.exceptionProcessingRequest(e); - safeClose(connection); + IoUtils.safeClose(connection); currentRequest.setFailed(new IOException(e)); } finally { if (free) pooled.free(); Index: 3rdParty_sources/undertow/io/undertow/client/http/HttpClientExchange.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/http/Attic/HttpClientExchange.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/http/HttpClientExchange.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/http/HttpClientExchange.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client.http; import io.undertow.channels.DetachableStreamSinkChannel; Index: 3rdParty_sources/undertow/io/undertow/client/http/HttpClientProvider.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/http/Attic/HttpClientProvider.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/http/HttpClientProvider.java 8 Sep 2014 09:47:09 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/http/HttpClientProvider.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,38 +1,16 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client.http; import io.undertow.UndertowMessages; -import io.undertow.UndertowOptions; import io.undertow.client.ClientCallback; import io.undertow.client.ClientConnection; import io.undertow.client.ClientProvider; -import io.undertow.client.http2.Http2ClientProvider; -import io.undertow.client.spdy.SpdyClientProvider; import org.xnio.ChannelListener; import org.xnio.IoFuture; import org.xnio.OptionMap; import org.xnio.Pool; import org.xnio.StreamConnection; import org.xnio.XnioIoThread; import org.xnio.XnioWorker; -import org.xnio.ssl.SslConnection; import org.xnio.ssl.XnioSsl; import java.io.IOException; @@ -50,107 +28,63 @@ @Override public Set handlesSchemes() { - return new HashSet<>(Arrays.asList(new String[]{"http", "https"})); + return new HashSet(Arrays.asList(new String[]{"http", "https"})); } @Override public void connect(final ClientCallback listener, final URI uri, final XnioWorker worker, final XnioSsl ssl, final Pool bufferPool, final OptionMap options) { - connect(listener, null, uri, worker, ssl, bufferPool, options); - } - - @Override - public void connect(final ClientCallback listener, final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final Pool bufferPool, final OptionMap options) { - connect(listener, null, uri, ioThread, ssl, bufferPool, options); - } - - @Override - public void connect(ClientCallback listener, InetSocketAddress bindAddress, URI uri, XnioWorker worker, XnioSsl ssl, Pool bufferPool, OptionMap options) { - if (uri.getScheme().equals("https")) { - if (ssl == null) { - listener.failed(UndertowMessages.MESSAGES.sslWasNull()); - return; + if(uri.getScheme().equals("https")) { + if(ssl == null) { + throw UndertowMessages.MESSAGES.sslWasNull(); } - if (bindAddress == null) { - ssl.openSslConnection(worker, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, bufferPool, options), options).addNotifier(createNotifier(listener), null); - } else { - ssl.openSslConnection(worker, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, bufferPool, options), options).addNotifier(createNotifier(listener), null); - } - } else { - if (bindAddress == null) { - worker.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort()), createOpenListener(listener, bufferPool, options), options).addNotifier(createNotifier(listener), null); - } else { - worker.openStreamConnection(bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort()), createOpenListener(listener, bufferPool, options), null, options).addNotifier(createNotifier(listener), null); - } - } - } - @Override - public void connect(ClientCallback listener, InetSocketAddress bindAddress, URI uri, XnioIoThread ioThread, XnioSsl ssl, Pool bufferPool, OptionMap options) { - if (uri.getScheme().equals("https")) { - if (ssl == null) { - listener.failed(UndertowMessages.MESSAGES.sslWasNull()); - return; - } - if (bindAddress == null) { - ssl.openSslConnection(ioThread, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, bufferPool, options), options).addNotifier(createNotifier(listener), null); - } else { - ssl.openSslConnection(ioThread, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, bufferPool, options), options).addNotifier(createNotifier(listener), null); - } - } else { - if (bindAddress == null) { - ioThread.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort()), createOpenListener(listener, bufferPool, options), options).addNotifier(createNotifier(listener), null); - } else { - ioThread.openStreamConnection(bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort()), createOpenListener(listener, bufferPool, options), null, options).addNotifier(createNotifier(listener), null); - } } - } + worker.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80: uri.getPort()), new ChannelListener() { + @Override + public void handleEvent(StreamConnection connection) { + handleConnected(connection, listener, uri, ssl, bufferPool, options); + } + }, options).addNotifier(new IoFuture.Notifier() { - private IoFuture.Notifier createNotifier(final ClientCallback listener) { - return new IoFuture.Notifier() { @Override public void notify(IoFuture ioFuture, Object o) { - if (ioFuture.getStatus() == IoFuture.Status.FAILED) { + if(ioFuture.getStatus() == IoFuture.Status.FAILED) { listener.failed(ioFuture.getException()); } } - }; + }, null); } - private ChannelListener createOpenListener(final ClientCallback listener, final Pool bufferPool, final OptionMap options) { - return new ChannelListener() { + @Override + public void connect(final ClientCallback listener, final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final Pool bufferPool, final OptionMap options) { + if(uri.getScheme().equals("https")) { + if(ssl == null) { + throw UndertowMessages.MESSAGES.sslWasNull(); + } + } + ioThread.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort()), new ChannelListener() { @Override public void handleEvent(StreamConnection connection) { - handleConnected(connection, listener, bufferPool, options); + handleConnected(connection, listener, uri, ssl, bufferPool, options); } - }; + }, options).addNotifier(new IoFuture.Notifier() { + @Override + public void notify(IoFuture ioFuture, Object o) { + if(ioFuture.getStatus() == IoFuture.Status.FAILED) { + listener.failed(ioFuture.getException()); + } + } + }, null); } - - private void handleConnected(final StreamConnection connection, final ClientCallback listener, final Pool bufferPool, final OptionMap options) { - if (options.get(UndertowOptions.ENABLE_SPDY, false) && connection instanceof SslConnection && SpdyClientProvider.isEnabled()) { - try { - SpdyClientProvider.handlePotentialSpdyConnection(connection, listener, bufferPool, options, new ChannelListener() { - @Override - public void handleEvent(SslConnection channel) { - listener.completed(new HttpClientConnection(connection, options, bufferPool)); - } - }); - } catch (Exception e) { - listener.failed(new IOException(e)); - } - } else if (options.get(UndertowOptions.ENABLE_HTTP2, false) && connection instanceof SslConnection && Http2ClientProvider.isEnabled()) { - try { - Http2ClientProvider.handlePotentialHttp2Connection(connection, listener, bufferPool, options, new ChannelListener() { - @Override - public void handleEvent(SslConnection channel) { - listener.completed(new HttpClientConnection(connection, options, bufferPool)); - } - }); - } catch (Exception e) { - listener.failed(new IOException(e)); - } + private void handleConnected(StreamConnection connection, ClientCallback listener, URI uri, XnioSsl ssl, Pool bufferPool, OptionMap options) { + if(uri.getScheme().equals("https")) { + listener.failed(new IOException("ssl not implemented yet")); } else { listener.completed(new HttpClientConnection(connection, options, bufferPool)); } + } + + } Index: 3rdParty_sources/undertow/io/undertow/client/http/HttpRequestConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/http/Attic/HttpRequestConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/http/HttpRequestConduit.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/http/HttpRequestConduit.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.client.http; Index: 3rdParty_sources/undertow/io/undertow/client/http/HttpResponseBuilder.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/http/Attic/HttpResponseBuilder.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/http/HttpResponseBuilder.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/http/HttpResponseBuilder.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client.http; import io.undertow.client.ClientResponse; Index: 3rdParty_sources/undertow/io/undertow/client/http/HttpResponseParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/http/Attic/HttpResponseParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/http/HttpResponseParser.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/http/HttpResponseParser.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client.http; import io.undertow.annotationprocessor.HttpResponseParserConfig; @@ -350,7 +332,7 @@ * @return */ protected static Map httpStrings() { - final Map results = new HashMap<>(); + final Map results = new HashMap(); final Class[] classs = {Headers.class, Methods.class, Protocols.class}; for (Class c : classs) { Index: 3rdParty_sources/undertow/io/undertow/client/http/ResponseParseState.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/client/http/Attic/ResponseParseState.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/client/http/ResponseParseState.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/client/http/ResponseParseState.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.client.http; import io.undertow.util.HttpString; Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/http2/Http2ClearClientProvider.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/http2/Http2ClientConnection.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/http2/Http2ClientExchange.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/http2/Http2ClientProvider.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/spdy/SpdyClientConnection.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/spdy/SpdyClientExchange.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/client/spdy/SpdyClientProvider.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/conduits/AbstractFixedLengthStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/AbstractFixedLengthStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/AbstractFixedLengthStreamSinkConduit.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/AbstractFixedLengthStreamSinkConduit.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; @@ -48,8 +48,6 @@ private long state; - private boolean broken = false; - private static final int CONF_FLAG_CONFIGURABLE = 1 << 0; private static final int CONF_FLAG_PASS_CLOSE = 1 << 1; @@ -104,9 +102,6 @@ int res = 0; try { return res = next.write(src); - } catch (IOException e) { - broken = true; - throw e; } finally { src.limit(oldLimit); exitWrite(val, (long) res); @@ -146,9 +141,6 @@ long res = 0L; try { return res = next.write(srcs, offset, length); - } catch (IOException e) { - broken = true; - throw e; } finally { if (limits != null) { for (int i = offset; i < offset + length; ++i) { @@ -161,22 +153,12 @@ @Override public long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException { - try { - return Conduits.writeFinalBasic(this, srcs, offset, length); - } catch (IOException e) { - broken = true; - throw e; - } + return Conduits.writeFinalBasic(this, srcs, offset, length); } @Override public int writeFinal(ByteBuffer src) throws IOException { - try { - return Conduits.writeFinalBasic(this, src); - } catch (IOException e) { - broken = true; - throw e; - } + return Conduits.writeFinalBasic(this, src); } public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { @@ -191,9 +173,6 @@ long res = 0L; try { return res = next.transferFrom(src, position, min(count, (val & MASK_COUNT))); - } catch (IOException e) { - broken = true; - throw e; } finally { exitWrite(val, res); } @@ -211,9 +190,6 @@ long res = 0L; try { return res = next.transferFrom(source, min(count, (val & MASK_COUNT)), throughBuffer); - } catch (IOException e) { - broken = true; - throw e; } finally { exitWrite(val, res); } @@ -227,9 +203,6 @@ boolean flushed = false; try { return flushed = next.flush(); - } catch (IOException e) { - broken = true; - throw e; } finally { exitFlush(val, flushed); } @@ -250,7 +223,7 @@ public void terminateWrites() throws IOException { final long val = enterShutdown(); - if (anyAreSet(val, MASK_COUNT) && !broken) { + if (anyAreSet(val, MASK_COUNT)) { try { throw new FixedLengthUnderflowException((val & MASK_COUNT) + " bytes remaining"); } finally { Index: 3rdParty_sources/undertow/io/undertow/conduits/AbstractFramedStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/AbstractFramedStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/AbstractFramedStreamSinkConduit.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/AbstractFramedStreamSinkConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.conduits; import io.undertow.UndertowMessages; @@ -48,7 +30,7 @@ */ public class AbstractFramedStreamSinkConduit extends AbstractStreamSinkConduit { - private final Deque frameQueue = new ArrayDeque<>(); + private final Deque frameQueue = new ArrayDeque(); /** * The total amount of data that has been queued to be written out */ Index: 3rdParty_sources/undertow/io/undertow/conduits/BrokenStreamSourceConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/BrokenStreamSourceConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/BrokenStreamSourceConduit.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/BrokenStreamSourceConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; Index: 3rdParty_sources/undertow/io/undertow/conduits/ChunkReader.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/ChunkReader.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/ChunkReader.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/ChunkReader.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.conduits; import io.undertow.UndertowMessages; Index: 3rdParty_sources/undertow/io/undertow/conduits/ChunkedStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/ChunkedStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/ChunkedStreamSinkConduit.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/ChunkedStreamSinkConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; @@ -197,13 +197,6 @@ } - @Override - public void truncateWrites() throws IOException { - if(lastChunkBuffer != null) { - lastChunkBuffer.free(); - } - super.truncateWrites(); - } @Override public long write(final ByteBuffer[] srcs, final int offset, final int length) throws IOException { @@ -346,7 +339,7 @@ ByteBuffer data = ByteBuffer.allocate(lastChunkBuffer.remaining()); data.put(lastChunkBuffer); data.flip(); - this.lastChunkBuffer = new ImmediatePooled<>(data); + this.lastChunkBuffer = new ImmediatePooled(data); lastChunkBufferPooled.free(); } Index: 3rdParty_sources/undertow/io/undertow/conduits/ChunkedStreamSourceConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/ChunkedStreamSourceConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/ChunkedStreamSourceConduit.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/ChunkedStreamSourceConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,17 +9,17 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; +import io.undertow.UndertowLogger; import io.undertow.UndertowMessages; -import io.undertow.server.Connectors; import io.undertow.server.HttpServerExchange; import io.undertow.server.protocol.http.HttpAttachments; import io.undertow.server.protocol.http.HttpServerConnection; @@ -95,7 +95,7 @@ this.bufferWrapper = bufferWrapper; this.finishListener = finishListener; this.remainingAllowed = Long.MIN_VALUE; - this.chunkReader = new ChunkReader<>(attachable, HttpAttachments.REQUEST_TRAILERS, finishListener, this); + this.chunkReader = new ChunkReader(attachable, HttpAttachments.REQUEST_TRAILERS, finishListener, this); this.exchange = exchange; } @@ -118,10 +118,15 @@ remainingAllowed -= written; if (remainingAllowed < 0) { //max entity size is exceeded - Connectors.terminateRequest(exchange); + //we need to forcibly close the read side + try { + next.terminateReads(); + } catch (IOException e) { + UndertowLogger.REQUEST_LOGGER.debug("Exception terminating reads due to exceeding max size", e); + } closed = true; - exchange.setPersistent(false); finishListener.handleEvent(this); + exchange.setPersistent(false); throw UndertowMessages.MESSAGES.requestEntityWasTooLarge(exchange.getMaxEntitySize()); } } Index: 3rdParty_sources/undertow/io/undertow/conduits/ConduitListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/ConduitListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/ConduitListener.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/ConduitListener.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.conduits; import java.util.EventListener; Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/conduits/DebuggingStreamSinkConduit.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/conduits/DebuggingStreamSourceConduit.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/conduits/DeflatingStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/DeflatingStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/DeflatingStreamSinkConduit.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/DeflatingStreamSinkConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,33 +1,15 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.conduits; -import static org.xnio.Bits.allAreClear; -import static org.xnio.Bits.allAreSet; -import static org.xnio.Bits.anyAreSet; - import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; import java.nio.channels.FileChannel; import java.util.concurrent.TimeUnit; import java.util.zip.Deflater; + +import io.undertow.server.HttpServerExchange; +import io.undertow.util.ConduitFactory; +import io.undertow.util.Headers; import org.xnio.IoUtils; import org.xnio.Pooled; import org.xnio.XnioIoThread; @@ -38,10 +20,8 @@ import org.xnio.conduits.StreamSinkConduit; import org.xnio.conduits.WriteReadyHandler; -import io.undertow.UndertowLogger; -import io.undertow.server.HttpServerExchange; -import io.undertow.util.ConduitFactory; -import io.undertow.util.Headers; +import static org.xnio.Bits.allAreClear; +import static org.xnio.Bits.anyAreSet; /** * Channel that handles deflate compression @@ -61,7 +41,7 @@ /** * The streams buffer. This is freed when the next is shutdown */ - protected Pooled currentBuffer; + protected final Pooled currentBuffer; /** * there may have been some additional data that did not fit into the first buffer */ @@ -81,6 +61,7 @@ } protected DeflatingStreamSinkConduit(final ConduitFactory conduitFactory, final HttpServerExchange exchange, int deflateLevel) { + deflater = new Deflater(deflateLevel, true); this.currentBuffer = exchange.getConnection().getBufferPool().allocate(); this.exchange = exchange; @@ -89,33 +70,28 @@ @Override public int write(final ByteBuffer src) throws IOException { - if (anyAreSet(state, SHUTDOWN | CLOSED) || currentBuffer == null) { + if (anyAreSet(SHUTDOWN | CLOSED, state)) { throw new ClosedChannelException(); } - try { - if (!performFlushIfRequired()) { + if (!performFlushIfRequired()) { + return 0; + } + if (src.remaining() == 0) { + return 0; + } + //we may already have some input, if so compress it + if(!deflater.needsInput()) { + deflateData(); + if(!deflater.needsInput()) { return 0; } - if (src.remaining() == 0) { - return 0; - } - //we may already have some input, if so compress it - if (!deflater.needsInput()) { - deflateData(); - if (!deflater.needsInput()) { - return 0; - } - } - byte[] data = new byte[src.remaining()]; - src.get(data); - preDeflate(data); - deflater.setInput(data); - deflateData(); - return data.length; - } catch (IOException e) { - freeBuffer(); - throw e; } + byte[] data = new byte[src.remaining()]; + src.get(data); + preDeflate(data); + deflater.setInput(data); + deflateData(); + return data.length; } protected void preDeflate(byte[] data) { @@ -124,25 +100,20 @@ @Override public long write(final ByteBuffer[] srcs, final int offset, final int length) throws IOException { - if (anyAreSet(state, SHUTDOWN | CLOSED) || currentBuffer == null) { + if (anyAreSet(SHUTDOWN | CLOSED, state)) { throw new ClosedChannelException(); } - try { - int total = 0; - for (int i = offset; i < offset + length; ++i) { - if (srcs[i].hasRemaining()) { - int ret = write(srcs[i]); - total += ret; - if (ret == 0) { - return total; - } + int total = 0; + for (int i = offset; i < offset + length; ++i) { + if (srcs[i].hasRemaining()) { + int ret = write(srcs[i]); + total += ret; + if (ret == 0) { + return total; } } - return total; - } catch (IOException e) { - freeBuffer(); - throw e; } + return total; } @Override @@ -157,7 +128,7 @@ @Override public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { - if (anyAreSet(state, SHUTDOWN | CLOSED)) { + if (anyAreSet(SHUTDOWN | CLOSED, state)) { throw new ClosedChannelException(); } if (!performFlushIfRequired()) { @@ -169,7 +140,7 @@ @Override public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException { - if (anyAreSet(state, SHUTDOWN | CLOSED)) { + if (anyAreSet(SHUTDOWN | CLOSED, state)) { throw new ClosedChannelException(); } if (!performFlushIfRequired()) { @@ -196,7 +167,7 @@ @Override public boolean isWriteResumed() { if (next == null) { - return anyAreSet(state, WRITES_RESUMED); + return anyAreSet(WRITES_RESUMED, state); } else { return next.isWriteResumed(); } @@ -239,6 +210,7 @@ }); } + @Override public void terminateWrites() throws IOException { deflater.finish(); @@ -280,89 +252,73 @@ @Override public boolean flush() throws IOException { - if (currentBuffer == null) { - if (anyAreSet(state, NEXT_SHUTDOWN)) { - return next.flush(); - } else { - return true; - } - } + boolean nextCreated = false; try { - boolean nextCreated = false; - try { - if (anyAreSet(state, SHUTDOWN)) { - if (anyAreSet(state, NEXT_SHUTDOWN)) { - return next.flush(); - } else { - if (!performFlushIfRequired()) { + if (anyAreSet(SHUTDOWN, state)) { + if (anyAreSet(NEXT_SHUTDOWN, state)) { + return next.flush(); + } else { + if (!performFlushIfRequired()) { + return false; + } + //if the deflater has not been fully flushed we need to flush it + if (!deflater.finished()) { + deflateData(); + //if could not fully flush + if (!deflater.finished()) { return false; } - //if the deflater has not been fully flushed we need to flush it - if (!deflater.finished()) { - deflateData(); - //if could not fully flush - if (!deflater.finished()) { - return false; - } - } - final ByteBuffer buffer = currentBuffer.getResource(); - if (allAreClear(state, WRITTEN_TRAILER)) { - state |= WRITTEN_TRAILER; - byte[] data = getTrailer(); - if (data != null) { - if (data.length <= buffer.remaining()) { - buffer.put(data); - } else if (additionalBuffer == null) { - additionalBuffer = ByteBuffer.wrap(data); - } else { - byte[] newData = new byte[additionalBuffer.remaining() + data.length]; - int pos = 0; - while (additionalBuffer.hasRemaining()) { - newData[pos++] = additionalBuffer.get(); - } - for (byte aData : data) { - newData[pos++] = aData; - } - this.additionalBuffer = ByteBuffer.wrap(newData); + } + final ByteBuffer buffer = currentBuffer.getResource(); + if (allAreClear(WRITTEN_TRAILER, state)) { + state |= WRITTEN_TRAILER; + byte[] data = getTrailer(); + if(data != null) { + if(data.length <= buffer.remaining()) { + buffer.put(data); + } else if(additionalBuffer == null) { + additionalBuffer = ByteBuffer.wrap(data); + } else { + byte[] newData = new byte[additionalBuffer.remaining() + data.length]; + int pos = 0; + while (additionalBuffer.hasRemaining()) { + newData[pos++] = additionalBuffer.get(); } + for (byte aData : data) { + newData[pos++] = aData; + } + this.additionalBuffer = ByteBuffer.wrap(newData); } } + } - //ok the deflater is flushed, now we need to flush the buffer - if (!anyAreSet(state, FLUSHING_BUFFER)) { - buffer.flip(); - state |= FLUSHING_BUFFER; - if (next == null) { - nextCreated = true; - this.next = createNextChannel(); - } + //ok the deflater is flushed, now we need to flush the buffer + if (!anyAreSet(FLUSHING_BUFFER, state)) { + buffer.flip(); + state |= FLUSHING_BUFFER; + if (next == null) { + nextCreated = true; + this.next = createNextChannel(); } - if (performFlushIfRequired()) { - state |= NEXT_SHUTDOWN; - freeBuffer(); - next.terminateWrites(); - return next.flush(); - } else { - return false; - } } - } else { - return performFlushIfRequired(); - } - } finally { - if (nextCreated) { - if (anyAreSet(state, WRITES_RESUMED) && !anyAreSet(state ,NEXT_SHUTDOWN)) { - try { - next.resumeWrites(); - } catch (Exception e) { - UndertowLogger.REQUEST_LOGGER.debug("Failed to resume", e); - } + if (performFlushIfRequired()) { + state |= NEXT_SHUTDOWN; + currentBuffer.free(); + next.terminateWrites(); + return next.flush(); + } else { + return false; } } + } else { + return performFlushIfRequired(); } - } catch (IOException e) { - freeBuffer(); - throw e; + } finally { + if (nextCreated) { + if (anyAreSet(WRITES_RESUMED, state) && !anyAreSet(NEXT_SHUTDOWN, state)) { + next.resumeWrites(); + } + } } } @@ -379,7 +335,7 @@ * @return false if there is still more to flush */ private boolean performFlushIfRequired() throws IOException { - if (anyAreSet(state, FLUSHING_BUFFER)) { + if (anyAreSet(FLUSHING_BUFFER, state)) { final ByteBuffer[] bufs = new ByteBuffer[additionalBuffer == null ? 1 : 2]; long totalLength = 0; bufs[0] = currentBuffer.getResource(); @@ -408,7 +364,7 @@ private StreamSinkConduit createNextChannel() { - if (deflater.finished() && allAreSet(state, WRITTEN_TRAILER)) { + if (deflater.finished()) { //the deflater was fully flushed before we created the channel. This means that what is in the buffer is //all there is int remaining = currentBuffer.getResource().remaining(); @@ -436,7 +392,7 @@ Pooled pooled = this.currentBuffer; final ByteBuffer outputBuffer = pooled.getResource(); - final boolean shutdown = anyAreSet(state, SHUTDOWN); + final boolean shutdown = anyAreSet(SHUTDOWN, state); byte[] buffer = new byte[1024]; //TODO: we should pool this and make it configurable or something while (!deflater.needsInput() || (shutdown && !deflater.finished())) { @@ -466,7 +422,7 @@ } } finally { if (nextCreated) { - if (anyAreSet(state, WRITES_RESUMED)) { + if (anyAreSet(WRITES_RESUMED, state)) { next.resumeWrites(); } } @@ -476,15 +432,10 @@ @Override public void truncateWrites() throws IOException { - freeBuffer(); + if (!anyAreSet(NEXT_SHUTDOWN, state)) { + currentBuffer.free(); + } state |= CLOSED; next.truncateWrites(); } - - private void freeBuffer() { - if (currentBuffer != null) { - currentBuffer.free(); - currentBuffer = null; - } - } } Index: 3rdParty_sources/undertow/io/undertow/conduits/EmptyStreamSourceConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/EmptyStreamSourceConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/EmptyStreamSourceConduit.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/EmptyStreamSourceConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; Index: 3rdParty_sources/undertow/io/undertow/conduits/FinishableStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/FinishableStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/FinishableStreamSinkConduit.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/FinishableStreamSinkConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; Index: 3rdParty_sources/undertow/io/undertow/conduits/FinishableStreamSourceConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/FinishableStreamSourceConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/FinishableStreamSourceConduit.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/FinishableStreamSourceConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,19 +1,20 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. * + * Copyright 2012 Red Hat, Inc. and/or its affiliates, and individual + * contributors as indicated by the @author tags. + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; Index: 3rdParty_sources/undertow/io/undertow/conduits/FixedLengthStreamSourceConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/FixedLengthStreamSourceConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/FixedLengthStreamSourceConduit.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/FixedLengthStreamSourceConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,25 +1,26 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. * + * Copyright 2012 Red Hat, Inc. and/or its affiliates, and individual + * contributors as indicated by the @author tags. + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; +import io.undertow.UndertowLogger; import io.undertow.UndertowMessages; -import io.undertow.server.Connectors; import io.undertow.server.HttpServerExchange; import org.xnio.channels.StreamSinkChannel; import org.xnio.conduits.AbstractStreamSourceConduit; @@ -154,10 +155,14 @@ if (exchange.getMaxEntitySize() > 0 && exchange.getMaxEntitySize() < (state & MASK_COUNT)) { //max entity size is exceeded //we need to forcibly close the read side - Connectors.terminateRequest(exchange); - exchange.setPersistent(false); + try { + next.terminateReads(); + } catch (IOException e) { + UndertowLogger.REQUEST_LOGGER.debug("Exception terminating reads due to exceeding max size", e); + } finishListener.handleEvent(this); - this.state |= FLAG_FINISHED | FLAG_CLOSED; + state |= FLAG_FINISHED | FLAG_CLOSED; + exchange.setPersistent(false); throw UndertowMessages.MESSAGES.requestEntityWasTooLarge(exchange.getMaxEntitySize()); } } Index: 3rdParty_sources/undertow/io/undertow/conduits/GzipStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/GzipStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/GzipStreamSinkConduit.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/GzipStreamSinkConduit.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.conduits; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/conduits/HeadStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/HeadStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/HeadStreamSinkConduit.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/HeadStreamSinkConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; Index: 3rdParty_sources/undertow/io/undertow/conduits/IdleTimeoutConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/IdleTimeoutConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/IdleTimeoutConduit.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/IdleTimeoutConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; @@ -30,9 +30,9 @@ import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.channels.ClosedChannelException; import java.nio.channels.FileChannel; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; /** * Conduit that adds support to close a channel once for a specified time no @@ -41,12 +41,10 @@ * @author Norman Maurer */ public class IdleTimeoutConduit implements StreamSinkConduit, StreamSourceConduit { - - private static final int DELTA = 100; private volatile XnioExecutor.Key handle; + private static final AtomicReferenceFieldUpdater KEY_UPDATER = AtomicReferenceFieldUpdater.newUpdater(IdleTimeoutConduit.class, XnioExecutor.Key.class, "handle"); + private volatile long idleTimeout; - private volatile long expireTime = -1; - private volatile boolean timedOut = true; private final StreamSinkConduit sink; private final StreamSourceConduit source; @@ -57,20 +55,9 @@ private final Runnable timeoutCommand = new Runnable() { @Override public void run() { - handle = null; - if(expireTime == -1) { - return; - } - long current = System.currentTimeMillis(); - if(current < expireTime) { - //timeout has been bumped, re-schedule - handle = sink.getWriteThread().executeAfter(timeoutCommand, (expireTime - current) + DELTA, TimeUnit.MILLISECONDS); - return; - } - UndertowLogger.REQUEST_LOGGER.tracef("Timing out channel %s due to inactivity"); - timedOut = true; - doClose(); + safeClose(sink); + safeClose(source); if (sink.isWriteResumed()) { if(writeReadyHandler != null) { writeReadyHandler.writeReady(); @@ -84,105 +71,92 @@ } }; - protected void doClose() { - safeClose(sink); - safeClose(source); - } - public IdleTimeoutConduit(StreamSinkConduit sink, StreamSourceConduit source) { this.sink = sink; this.source = source; } - private void handleIdleTimeout() throws ClosedChannelException { - if(timedOut) { - return; - } + private void handleIdleTimeout() { long idleTimeout = this.idleTimeout; - if(idleTimeout <= 0) { - return; - } - long currentTime = System.currentTimeMillis(); - long expireTimeVar = expireTime; - if(expireTimeVar != -1 && currentTime > expireTimeVar) { - timedOut = true; - doClose(); - throw new ClosedChannelException(); - } - expireTime = currentTime + idleTimeout; XnioExecutor.Key key = handle; - if (key == null) { - handle = sink.getWriteThread().executeAfter(timeoutCommand, idleTimeout, TimeUnit.MILLISECONDS); + if (key != null) { + key.remove(); } + if (idleTimeout > 0) { + XnioExecutor.Key k = sink.getWriteThread().executeAfter(timeoutCommand, idleTimeout, TimeUnit.MILLISECONDS); + if (!KEY_UPDATER.compareAndSet(this, key, k)) { + k.remove(); + } + } } @Override public int write(ByteBuffer src) throws IOException { - handleIdleTimeout(); int w = sink.write(src); + handleIdleTimeout(); return w; } @Override public long write(ByteBuffer[] srcs, int offset, int length) throws IOException { - handleIdleTimeout(); long w = sink.write(srcs, offset, length); + handleIdleTimeout(); return w; } @Override public int writeFinal(ByteBuffer src) throws IOException { - handleIdleTimeout(); int w = sink.writeFinal(src); + handleIdleTimeout(); return w; } @Override public long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException { - handleIdleTimeout(); long w = sink.writeFinal(srcs, offset, length); + handleIdleTimeout(); return w; } @Override public long transferTo(long position, long count, FileChannel target) throws IOException { - handleIdleTimeout(); long w = source.transferTo(position, count, target); + handleIdleTimeout(); return w; } @Override public long transferTo(long count, ByteBuffer throughBuffer, StreamSinkChannel target) throws IOException { - handleIdleTimeout(); long w = source.transferTo(count, throughBuffer, target); + handleIdleTimeout(); return w; } @Override public long read(ByteBuffer[] dsts, int offset, int length) throws IOException { - handleIdleTimeout(); long r = source.read(dsts, offset, length); + handleIdleTimeout(); return r; } @Override public int read(ByteBuffer dst) throws IOException { - handleIdleTimeout(); int r = source.read(dst); + handleIdleTimeout(); return r; } @Override public long transferFrom(FileChannel src, long position, long count) throws IOException { - handleIdleTimeout(); long r = sink.transferFrom(src, position, count); + handleIdleTimeout(); return r; } @Override public long transferFrom(StreamSourceChannel source, long count, ByteBuffer throughBuffer) throws IOException { - handleIdleTimeout(); long r = sink.transferFrom(source, count, throughBuffer); + handleIdleTimeout(); return r; } @@ -322,13 +296,15 @@ public void setIdleTimeout(long idleTimeout) { this.idleTimeout = idleTimeout; - if(idleTimeout > 0) { - expireTime = System.currentTimeMillis() + idleTimeout; - } else { - expireTime = -1; + XnioExecutor.Key key = handle; + if (key != null) { + key.remove(); } - if (idleTimeout > 0 && handle == null) { - handle = sink.getWriteThread().executeAfter(timeoutCommand, idleTimeout + DELTA, TimeUnit.MILLISECONDS); + if (idleTimeout > 0) { + XnioExecutor.Key k = sink.getWriteThread().executeAfter(timeoutCommand, idleTimeout, TimeUnit.MILLISECONDS); + if (!KEY_UPDATER.compareAndSet(this, key, k)) { + k.remove(); + } } } } Index: 3rdParty_sources/undertow/io/undertow/conduits/PreChunkedStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/PreChunkedStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/PreChunkedStreamSinkConduit.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/PreChunkedStreamSinkConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.conduits; @@ -65,7 +65,7 @@ public PreChunkedStreamSinkConduit(final StreamSinkConduit next, final ConduitListener finishListener, final Attachable attachable) { super(next); //we don't want the reader to call the finish listener, so we pass null - this.chunkReader = new ChunkReader<>(attachable, HttpAttachments.RESPONSE_TRAILERS, null, this); + this.chunkReader = new ChunkReader(attachable, HttpAttachments.RESPONSE_TRAILERS, null, this); this.finishListener = finishListener; } Index: 3rdParty_sources/undertow/io/undertow/conduits/ReadDataStreamSourceConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/ReadDataStreamSourceConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/ReadDataStreamSourceConduit.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/ReadDataStreamSourceConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.conduits; import io.undertow.server.AbstractServerConnection; Index: 3rdParty_sources/undertow/io/undertow/conduits/ReadTimeoutStreamSourceConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/ReadTimeoutStreamSourceConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/ReadTimeoutStreamSourceConduit.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/ReadTimeoutStreamSourceConduit.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,27 +1,6 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.conduits; import io.undertow.UndertowLogger; -import io.undertow.UndertowOptions; -import io.undertow.server.OpenListener; - import org.xnio.ChannelListeners; import org.xnio.IoUtils; import org.xnio.Options; @@ -33,7 +12,6 @@ import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.channels.ClosedChannelException; import java.nio.channels.FileChannel; import java.util.concurrent.TimeUnit; @@ -47,63 +25,37 @@ private XnioExecutor.Key handle; private final StreamConnection connection; - private volatile long expireTime = -1; - private final OpenListener openListener; private static final int FUZZ_FACTOR = 50; //we add 50ms to the timeout to make sure the underlying channel has actually timed out private final Runnable timeoutCommand = new Runnable() { @Override public void run() { - handle = null; - if (expireTime == -1) { - return; - } - long current = System.currentTimeMillis(); - if (current < expireTime) { - //timeout has been bumped, re-schedule - handle = connection.getIoThread().executeAfter(timeoutCommand, (expireTime - current) + FUZZ_FACTOR, TimeUnit.MILLISECONDS); - return; - } UndertowLogger.REQUEST_LOGGER.tracef("Timing out channel %s due to inactivity"); IoUtils.safeClose(connection); if (connection.getSourceChannel().isReadResumed()) { ChannelListeners.invokeChannelListener(connection.getSourceChannel(), connection.getSourceChannel().getReadListener()); } - if (connection.getSinkChannel().isWriteResumed()) { + if(connection.getSinkChannel().isWriteResumed()) { ChannelListeners.invokeChannelListener(connection.getSinkChannel(), connection.getSinkChannel().getWriteListener()); } } }; - public ReadTimeoutStreamSourceConduit(final StreamSourceConduit delegate, StreamConnection connection, OpenListener openListener) { + public ReadTimeoutStreamSourceConduit(final StreamSourceConduit delegate, StreamConnection connection) { super(delegate); this.connection = connection; - this.openListener = openListener; } private void handleReadTimeout(final long ret) throws IOException { - if (!connection.isOpen()) { - return; + Integer readTimeout = connection.getOption(Options.READ_TIMEOUT); + if (readTimeout != null && readTimeout > 0) { + if (ret == 0 && handle == null) { + handle = super.getReadThread().executeAfter(timeoutCommand, readTimeout + FUZZ_FACTOR, TimeUnit.MILLISECONDS); + } else if (ret > 0 && handle != null) { + handle.remove(); + } } - if (ret == 0 && handle != null) { - return; - } - Integer timeout = getTimeout(); - if (timeout == null || timeout <= 0) { - return; - } - long currentTime = System.currentTimeMillis(); - long expireTimeVar = expireTime; - if (expireTimeVar != -1 && currentTime > expireTimeVar) { - IoUtils.safeClose(connection); - throw new ClosedChannelException(); - } - expireTime = currentTime + timeout; - XnioExecutor.Key key = handle; - if (key == null) { - handle = connection.getIoThread().executeAfter(timeoutCommand, timeout, TimeUnit.MILLISECONDS); - } } @Override @@ -136,7 +88,7 @@ @Override public void awaitReadable() throws IOException { - Integer timeout = getTimeout(); + Integer timeout = connection.getOption(Options.READ_TIMEOUT); if (timeout != null && timeout > 0) { super.awaitReadable(timeout + FUZZ_FACTOR, TimeUnit.MILLISECONDS); } else { @@ -146,23 +98,12 @@ @Override public void awaitReadable(long time, TimeUnit timeUnit) throws IOException { - Integer timeout = getTimeout(); + Integer timeout = connection.getOption(Options.READ_TIMEOUT); if (timeout != null && timeout > 0) { long millis = timeUnit.toMillis(time); super.awaitReadable(Math.min(millis, timeout + FUZZ_FACTOR), TimeUnit.MILLISECONDS); } else { super.awaitReadable(time, timeUnit); } } - - private Integer getTimeout() throws IOException { - Integer timeout = connection.getSourceChannel().getOption(Options.READ_TIMEOUT); - Integer idleTimeout = openListener.getUndertowOptions().get(UndertowOptions.IDLE_TIMEOUT); - if ((timeout == null || timeout <= 0) && idleTimeout != null) { - timeout = idleTimeout; - } else if (timeout != null && idleTimeout != null && idleTimeout > 0) { - timeout = Math.min(timeout, idleTimeout); - } - return timeout; - } } Index: 3rdParty_sources/undertow/io/undertow/conduits/WriteTimeoutStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/conduits/Attic/WriteTimeoutStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/conduits/WriteTimeoutStreamSinkConduit.java 8 Sep 2014 09:46:55 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/conduits/WriteTimeoutStreamSinkConduit.java 8 Sep 2014 10:52:10 -0000 1.1.2.2 @@ -1,27 +1,6 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.conduits; import io.undertow.UndertowLogger; -import io.undertow.UndertowOptions; -import io.undertow.server.OpenListener; - import org.xnio.ChannelListeners; import org.xnio.IoUtils; import org.xnio.Options; @@ -33,12 +12,11 @@ import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.channels.ClosedChannelException; import java.nio.channels.FileChannel; import java.util.concurrent.TimeUnit; /** - * Wrapper for write timeout. This should always be the first wrapper applied to the underlying channel. + * Wrapper for read timeout. This should always be the first wrapper applied to the underlying channel. * * @author Stuart Douglas * @see org.xnio.Options#READ_TIMEOUT @@ -47,63 +25,37 @@ private XnioExecutor.Key handle; private final StreamConnection connection; - private volatile long expireTime = -1; - private final OpenListener openListener; private static final int FUZZ_FACTOR = 50; //we add 50ms to the timeout to make sure the underlying channel has actually timed out private final Runnable timeoutCommand = new Runnable() { @Override public void run() { - handle = null; - if (expireTime == -1) { - return; - } - long current = System.currentTimeMillis(); - if (current < expireTime) { - //timeout has been bumped, re-schedule - handle = connection.getIoThread().executeAfter(timeoutCommand, (expireTime - current) + FUZZ_FACTOR, TimeUnit.MILLISECONDS); - return; - } UndertowLogger.REQUEST_LOGGER.tracef("Timing out channel %s due to inactivity"); IoUtils.safeClose(connection); if (connection.getSourceChannel().isReadResumed()) { ChannelListeners.invokeChannelListener(connection.getSourceChannel(), connection.getSourceChannel().getReadListener()); } - if (connection.getSinkChannel().isWriteResumed()) { + if(connection.getSinkChannel().isWriteResumed()) { ChannelListeners.invokeChannelListener(connection.getSinkChannel(), connection.getSinkChannel().getWriteListener()); } } }; - public WriteTimeoutStreamSinkConduit(final StreamSinkConduit delegate, StreamConnection connection, OpenListener openListener) { + public WriteTimeoutStreamSinkConduit(final StreamSinkConduit delegate, StreamConnection connection) { super(delegate); this.connection = connection; - this.openListener = openListener; } private void handleWriteTimeout(final long ret) throws IOException { - if (!connection.isOpen()) { - return; + Integer writeTimout = connection.getOption(Options.WRITE_TIMEOUT); + if (writeTimout != null && writeTimout > 0) { + if (ret == 0 && handle == null) { + handle = super.getWriteThread().executeAfter(timeoutCommand, writeTimout + FUZZ_FACTOR, TimeUnit.MILLISECONDS); + } else if (ret > 0 && handle != null) { + handle.remove(); + } } - if (ret == 0 && handle != null) { - return; - } - Integer timeout = getTimeout(); - if (timeout == null || timeout <= 0) { - return; - } - long currentTime = System.currentTimeMillis(); - long expireTimeVar = expireTime; - if (expireTimeVar != -1 && currentTime > expireTimeVar) { - IoUtils.safeClose(connection); - throw new ClosedChannelException(); - } - expireTime = currentTime + timeout; - XnioExecutor.Key key = handle; - if (key == null) { - handle = connection.getIoThread().executeAfter(timeoutCommand, timeout, TimeUnit.MILLISECONDS); - } } @Override @@ -150,7 +102,7 @@ @Override public void awaitWritable() throws IOException { - Integer timeout = getTimeout(); + Integer timeout = connection.getOption(Options.WRITE_TIMEOUT); if (timeout != null && timeout > 0) { super.awaitWritable(timeout + FUZZ_FACTOR, TimeUnit.MILLISECONDS); } else { @@ -160,23 +112,12 @@ @Override public void awaitWritable(long time, TimeUnit timeUnit) throws IOException { - Integer timeout = getTimeout(); + Integer timeout = connection.getOption(Options.WRITE_TIMEOUT); if (timeout != null && timeout > 0) { long millis = timeUnit.toMillis(time); super.awaitWritable(Math.min(millis, timeout + FUZZ_FACTOR), TimeUnit.MILLISECONDS); } else { super.awaitWritable(time, timeUnit); } } - - private Integer getTimeout() throws IOException { - Integer timeout = connection.getSourceChannel().getOption(Options.WRITE_TIMEOUT); - Integer idleTimeout = openListener.getUndertowOptions().get(UndertowOptions.IDLE_TIMEOUT); - if ((timeout == null || timeout <= 0) && idleTimeout != null) { - timeout = idleTimeout; - } else if (timeout != null && idleTimeout != null && idleTimeout > 0) { - timeout = Math.min(timeout, idleTimeout); - } - return timeout; - } } Index: 3rdParty_sources/undertow/io/undertow/io/AsyncSenderImpl.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/io/Attic/AsyncSenderImpl.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/io/AsyncSenderImpl.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/io/AsyncSenderImpl.java 8 Sep 2014 10:52:16 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.io; import java.io.IOException; @@ -273,26 +255,22 @@ @Override public void send(final String data, final Charset charset, final IoCallback callback) { ByteBuffer bytes = ByteBuffer.wrap(data.getBytes(charset)); - if (bytes.remaining() == 0) { - callback.onComplete(exchange, this); - } else { - int i = 0; - ByteBuffer[] bufs = null; - while (bytes.hasRemaining()) { - Pooled pooled = exchange.getConnection().getBufferPool().allocate(); - if (bufs == null) { - int noBufs = (bytes.remaining() + pooled.getResource().remaining() - 1) / pooled.getResource().remaining(); //round up division trick - pooledBuffers = new Pooled[noBufs]; - bufs = new ByteBuffer[noBufs]; - } - pooledBuffers[i] = pooled; - bufs[i] = pooled.getResource(); - Buffers.copy(pooled.getResource(), bytes); - pooled.getResource().flip(); - ++i; + int i = 0; + ByteBuffer[] bufs = null; + while (bytes.hasRemaining()) { + Pooled pooled = exchange.getConnection().getBufferPool().allocate(); + if (bufs == null) { + int noBufs = (bytes.remaining() + pooled.getResource().remaining() - 1) / pooled.getResource().remaining(); //round up division trick + pooledBuffers = new Pooled[noBufs]; + bufs = new ByteBuffer[noBufs]; } - send(bufs, callback); + pooledBuffers[i] = pooled; + bufs[i] = pooled.getResource(); + Buffers.copy(pooled.getResource(), bytes); + pooled.getResource().flip(); + ++i; } + send(bufs, callback); } @Override Index: 3rdParty_sources/undertow/io/undertow/io/BlockingSenderImpl.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/io/Attic/BlockingSenderImpl.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/io/BlockingSenderImpl.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/io/BlockingSenderImpl.java 8 Sep 2014 10:52:16 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.io; Index: 3rdParty_sources/undertow/io/undertow/io/BufferWritableOutputStream.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/io/Attic/BufferWritableOutputStream.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/io/BufferWritableOutputStream.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/io/BufferWritableOutputStream.java 8 Sep 2014 10:52:16 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.io; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/io/DefaultIoCallback.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/io/Attic/DefaultIoCallback.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/io/DefaultIoCallback.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/io/DefaultIoCallback.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.io; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/io/IoCallback.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/io/Attic/IoCallback.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/io/IoCallback.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/io/IoCallback.java 8 Sep 2014 10:52:16 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.io; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/io/Sender.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/io/Attic/Sender.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/io/Sender.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/io/Sender.java 8 Sep 2014 10:52:16 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.io; import java.nio.ByteBuffer; Index: 3rdParty_sources/undertow/io/undertow/io/UndertowInputStream.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/io/Attic/UndertowInputStream.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/io/UndertowInputStream.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/io/UndertowInputStream.java 8 Sep 2014 10:52:16 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.io; import io.undertow.UndertowMessages; Index: 3rdParty_sources/undertow/io/undertow/io/UndertowOutputStream.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/io/Attic/UndertowOutputStream.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/io/UndertowOutputStream.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/io/UndertowOutputStream.java 8 Sep 2014 10:52:16 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.io; @@ -313,9 +313,6 @@ if (channel == null) { channel = exchange.getResponseChannel(); } - if(channel == null) { - return; - } StreamSinkChannel channel = this.channel; channel.shutdownWrites(); Channels.flushBlocking(channel); Index: 3rdParty_sources/undertow/io/undertow/predicate/AndPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/AndPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/AndPredicate.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/AndPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/predicate/AuthenticationRequiredPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/AuthenticationRequiredPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/AuthenticationRequiredPredicate.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/AuthenticationRequiredPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -36,13 +36,13 @@ @Override public Map> parameters() { - final Map> params = new HashMap<>(); + final Map> params = new HashMap>(); return params; } @Override public Set requiredParameters() { - final Set params = new HashSet<>(); + final Set params = new HashSet(); return params; } Index: 3rdParty_sources/undertow/io/undertow/predicate/ContainsPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/ContainsPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/ContainsPredicate.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/ContainsPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.predicate; @@ -65,15 +65,15 @@ @Override public Map> parameters() { - final Map> params = new HashMap<>(); + final Map> params = new HashMap>(); params.put("value", ExchangeAttribute.class); params.put("search", String[].class); return params; } @Override public Set requiredParameters() { - final Set params = new HashSet<>(); + final Set params = new HashSet(); params.add("value"); params.add("search"); return params; Index: 3rdParty_sources/undertow/io/undertow/predicate/EqualsPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/EqualsPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/EqualsPredicate.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/EqualsPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.predicate; @@ -69,7 +69,7 @@ @Override public Map> parameters() { - final Map> params = new HashMap<>(); + final Map> params = new HashMap>(); params.put("value", ExchangeAttribute[].class); return params; } Index: 3rdParty_sources/undertow/io/undertow/predicate/ExistsPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/ExistsPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/ExistsPredicate.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/ExistsPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.predicate; @@ -57,7 +57,7 @@ @Override public Map> parameters() { - final Map> params = new HashMap<>(); + final Map> params = new HashMap>(); params.put("value", ExchangeAttribute.class); return params; } Index: 3rdParty_sources/undertow/io/undertow/predicate/FalsePredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/FalsePredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/FalsePredicate.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/FalsePredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/predicate/MaxContentSizePredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/MaxContentSizePredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/MaxContentSizePredicate.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/MaxContentSizePredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,27 +1,5 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - import io.undertow.server.HttpServerExchange; import io.undertow.util.Headers; @@ -42,38 +20,9 @@ @Override public boolean resolve(final HttpServerExchange value) { final String length = value.getResponseHeaders().getFirst(Headers.CONTENT_LENGTH); - if (length == null) { + if(length == null) { return false; } return Long.parseLong(length) > maxSize; } - - public static class Builder implements PredicateBuilder { - - @Override - public String name() { - return "max-content-size"; - } - - @Override - public Map> parameters() { - return Collections.>singletonMap("value", Long.class); - } - - @Override - public Set requiredParameters() { - return Collections.singleton("value"); - } - - @Override - public String defaultParameter() { - return "value"; - } - - @Override - public Predicate build(final Map config) { - Long max = (Long) config.get("value"); - return new MaxContentSizePredicate(max); - } - } } Index: 3rdParty_sources/undertow/io/undertow/predicate/MethodPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/MethodPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/MethodPredicate.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/MethodPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/predicate/MinContentSizePredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/MinContentSizePredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/MinContentSizePredicate.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/MinContentSizePredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,27 +1,5 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - import io.undertow.server.HttpServerExchange; import io.undertow.util.Headers; @@ -42,38 +20,9 @@ @Override public boolean resolve(final HttpServerExchange value) { final String length = value.getResponseHeaders().getFirst(Headers.CONTENT_LENGTH); - if (length == null) { + if(length == null) { return false; } return Long.parseLong(length) < minSize; } - - public static class Builder implements PredicateBuilder { - - @Override - public String name() { - return "min-content-size"; - } - - @Override - public Map> parameters() { - return Collections.>singletonMap("value", Long.class); - } - - @Override - public Set requiredParameters() { - return Collections.singleton("value"); - } - - @Override - public String defaultParameter() { - return "value"; - } - - @Override - public Predicate build(final Map config) { - Long max = (Long) config.get("value"); - return new MinContentSizePredicate(max); - } - } } Index: 3rdParty_sources/undertow/io/undertow/predicate/NotPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/NotPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/NotPredicate.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/NotPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/predicate/OrPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/OrPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/OrPredicate.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/OrPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/predicate/PathMatchPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/PathMatchPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/PathMatchPredicate.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/PathMatchPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import java.util.Collections; @@ -33,7 +15,7 @@ private final PathMatcher pathMatcher; public PathMatchPredicate(final String... paths) { - PathMatcher matcher = new PathMatcher<>(); + PathMatcher matcher = new PathMatcher(); for(String path : paths) { if(!path.startsWith("/")) { matcher.addExactPath("/" + path, Boolean.TRUE); Index: 3rdParty_sources/undertow/io/undertow/predicate/PathPrefixPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/PathPrefixPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/PathPrefixPredicate.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/PathPrefixPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import java.util.Collections; @@ -33,7 +15,7 @@ private final PathMatcher pathMatcher; public PathPrefixPredicate(final String... paths) { - PathMatcher matcher = new PathMatcher<>(); + PathMatcher matcher = new PathMatcher(); for(String path : paths) { if(!path.startsWith("/")) { matcher.addPrefixPath("/" + path, Boolean.TRUE); @@ -48,13 +30,7 @@ public boolean resolve(final HttpServerExchange value) { final String relativePath = value.getRelativePath(); PathMatcher.PathMatch result = pathMatcher.match(relativePath); - - boolean matches = result.getValue() == Boolean.TRUE; - if(matches) { - Map context = value.getAttachment(PREDICATE_CONTEXT); - context.put("remaining", result.getRemaining()); - } - return matches; + return result.getValue() == Boolean.TRUE; } public static class Builder implements PredicateBuilder { Index: 3rdParty_sources/undertow/io/undertow/predicate/PathSuffixPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/PathSuffixPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/PathSuffixPredicate.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/PathSuffixPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import java.util.Collections; Index: 3rdParty_sources/undertow/io/undertow/predicate/PathTemplatePredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/PathTemplatePredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/PathTemplatePredicate.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/PathTemplatePredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import java.util.HashMap; @@ -43,7 +25,7 @@ @Override public boolean resolve(final HttpServerExchange exchange) { - final Map params = new HashMap<>(); + final Map params = new HashMap(); boolean result = this.value.matches(attribute.readAttribute(exchange), params); if (result) { Map context = exchange.getAttachment(PREDICATE_CONTEXT); @@ -63,15 +45,15 @@ @Override public Map> parameters() { - final Map> params = new HashMap<>(); + final Map> params = new HashMap>(); params.put("value", String.class); params.put("match", ExchangeAttribute.class); return params; } @Override public Set requiredParameters() { - final Set params = new HashSet<>(); + final Set params = new HashSet(); params.add("value"); return params; } Index: 3rdParty_sources/undertow/io/undertow/predicate/Predicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/Predicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/Predicate.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/Predicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import java.util.Map; Index: 3rdParty_sources/undertow/io/undertow/predicate/PredicateBuilder.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/PredicateBuilder.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/PredicateBuilder.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/PredicateBuilder.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.predicate; Index: 3rdParty_sources/undertow/io/undertow/predicate/PredicateParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/PredicateParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/PredicateParser.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/PredicateParser.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.predicate; @@ -73,7 +73,7 @@ private static Map loadBuilders(final ClassLoader classLoader) { ServiceLoader loader = ServiceLoader.load(PredicateBuilder.class, classLoader); - final Map ret = new HashMap<>(); + final Map ret = new HashMap(); for (PredicateBuilder builder : loader) { if (ret.containsKey(builder.name())) { if (ret.get(builder.name()).getClass() != builder.getClass()) { @@ -102,11 +102,11 @@ //shunting yard algorithm //gets rid or parentheses and fixes up operator ordering Deque tokens = tokenize(string); - Deque operatorStack = new ArrayDeque<>(); + Deque operatorStack = new ArrayDeque(); //the output, consisting of predicate nodes and string representations of operators //it is a bit yuck mixing up the types, but whatever - Deque output = new ArrayDeque<>(); + Deque output = new ArrayDeque(); while (!tokens.isEmpty()) { Token token = tokens.poll(); @@ -198,7 +198,7 @@ } Token next = tokens.peek(); if (next.token.equals("[")) { - final Map values = new HashMap<>(); + final Map values = new HashMap(); tokens.poll(); next = tokens.poll(); @@ -296,7 +296,7 @@ } Class componentType = type.getComponentType(); - final List values = new ArrayList<>(); + final List values = new ArrayList(); Token token = tokens.poll(); while (token != null) { Token commaOrEnd = tokens.poll(); @@ -327,7 +327,7 @@ } private static void checkParameters(final String string, int pos, final Map values, final PredicateBuilder builder) { - final Set required = new HashSet<>(builder.requiredParameters()); + final Set required = new HashSet(builder.requiredParameters()); for (String key : values.keySet()) { required.remove(key); } @@ -414,7 +414,7 @@ int pos = 0; StringBuilder current = new StringBuilder(); - Deque ret = new ArrayDeque<>(); + Deque ret = new ArrayDeque(); while (pos < string.length()) { char c = string.charAt(pos); if (currentStringDelim != 0) { Index: 3rdParty_sources/undertow/io/undertow/predicate/Predicates.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/Predicates.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/Predicates.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/Predicates.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import io.undertow.attribute.ExchangeAttribute; Index: 3rdParty_sources/undertow/io/undertow/predicate/PredicatesHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/PredicatesHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/PredicatesHandler.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/PredicatesHandler.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import io.undertow.server.HandlerWrapper; @@ -35,7 +17,7 @@ public class PredicatesHandler implements HttpHandler { private volatile Holder[] handlers = new Holder[0]; - private volatile HttpHandler next; + private final HttpHandler next; //non-static, so multiple handlers can co-exist private final AttachmentKey CURRENT_POSITION = AttachmentKey.create(Integer.class); @@ -87,14 +69,6 @@ return addPredicatedHandler(handler.getPredicate(), handler.getHandler()); } - public void setNext(HttpHandler next) { - this.next = next; - } - - public HttpHandler getNext() { - return next; - } - private static final class Holder { final Predicate predicate; final HttpHandler handler; Index: 3rdParty_sources/undertow/io/undertow/predicate/RegularExpressionPredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/RegularExpressionPredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/RegularExpressionPredicate.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/RegularExpressionPredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import java.util.HashMap; @@ -85,7 +67,7 @@ @Override public Map> parameters() { - final Map> params = new HashMap<>(); + final Map> params = new HashMap>(); params.put("pattern", String.class); params.put("value", ExchangeAttribute.class); params.put("full-match", Boolean.class); @@ -94,7 +76,7 @@ @Override public Set requiredParameters() { - final Set params = new HashSet<>(); + final Set params = new HashSet(); params.add("pattern"); return params; } Index: 3rdParty_sources/undertow/io/undertow/predicate/TruePredicate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/predicate/Attic/TruePredicate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/predicate/TruePredicate.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/predicate/TruePredicate.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.predicate; import io.undertow.server.HttpServerExchange; Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AbstractAjpClientStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AbstractAjpClientStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AbstractAjpParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AjpClientChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AjpClientFramePriority.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AjpClientRequestClientStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AjpClientResponseStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AjpConstants.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AjpResponseParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/ajp/AjpUtils.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/AbstractHttp2StreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/AbstractHttp2StreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/ConnectionErrorException.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/HPackHuffman.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Hpack.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/HpackDecoder.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/HpackEncoder.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/HpackException.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2Channel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2DataFrameParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2DataStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2FrameHeaderParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2FramePriority.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2GoAwayParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2GoAwayStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2GoAwayStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2HeaderBlockParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2HeadersParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2HeadersStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2NoDataStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2PingParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2PingStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2PingStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2PrefaceStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2ProtocolUtils.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2PushBackParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2RstStreamParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2RstStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2RstStreamStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2Setting.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2SettingsParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2SettingsStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2SettingsStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2StreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2StreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2WindowUpdateParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/Http2WindowUpdateStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/http2/StreamErrorException.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyControlFrameStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyFramePriority.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyGoAwayParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyGoAwayStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyGoAwayStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyHeaderBlockParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyHeadersParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyPingParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyPingStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyPingStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyProtocolUtils.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyPushBackParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyRstStreamParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyRstStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyRstStreamStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdySetting.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdySettingsParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdySettingsStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyStreamStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdySynReplyParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdySynReplyStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdySynReplyStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdySynStreamParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdySynStreamStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdySynStreamStreamSourceChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyWindowUpdateParser.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/SpdyWindowUpdateStreamSinkChannel.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/protocols/spdy/StreamErrorException.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/security/api/AuthenticatedSessionManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/AuthenticatedSessionManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/AuthenticatedSessionManager.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/AuthenticatedSessionManager.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/api/AuthenticationMechanism.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/AuthenticationMechanism.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/AuthenticationMechanism.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/AuthenticationMechanism.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/api/AuthenticationMechanismFactory.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/AuthenticationMechanismFactory.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/AuthenticationMechanismFactory.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/AuthenticationMechanismFactory.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.security.api; import io.undertow.server.handlers.form.FormParserFactory; Index: 3rdParty_sources/undertow/io/undertow/security/api/AuthenticationMode.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/AuthenticationMode.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/AuthenticationMode.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/AuthenticationMode.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/api/GSSAPIServerSubjectFactory.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/GSSAPIServerSubjectFactory.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/GSSAPIServerSubjectFactory.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/GSSAPIServerSubjectFactory.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/api/NonceManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/NonceManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/NonceManager.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/NonceManager.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/api/NotificationReceiver.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/NotificationReceiver.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/NotificationReceiver.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/NotificationReceiver.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/api/SecurityContext.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/SecurityContext.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/SecurityContext.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/SecurityContext.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/api/SecurityContextFactory.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/SecurityContextFactory.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/SecurityContextFactory.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/SecurityContextFactory.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/api/SecurityNotification.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/SecurityNotification.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/SecurityNotification.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/SecurityNotification.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/api/SessionNonceManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/api/Attic/SessionNonceManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/api/SessionNonceManager.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/api/SessionNonceManager.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.api; Index: 3rdParty_sources/undertow/io/undertow/security/handlers/AbstractConfidentialityHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/handlers/Attic/AbstractConfidentialityHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/handlers/AbstractConfidentialityHandler.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/handlers/AbstractConfidentialityHandler.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.handlers; @@ -41,7 +41,7 @@ @Override public void handleRequest(HttpServerExchange exchange) throws Exception { - if (isConfidential(exchange) || !confidentialityRequired(exchange)) { + if (isConfidential(exchange) || (confidentialityRequired(exchange) == false)) { next.handleRequest(exchange); } else { try { @@ -74,8 +74,6 @@ * * This method currently returns true for all requests, sub-classes can override this to provide a custom check. * - * TODO: we should deprecate this and just use a predicate to decide to execute the handler instead - * * @param exchange - The {@see HttpServerExchange} for the request being processed. * @return true if the request requires confidentiality, false otherwise. */ Index: 3rdParty_sources/undertow/io/undertow/security/handlers/AuthenticationCallHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/handlers/Attic/AuthenticationCallHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/handlers/AuthenticationCallHandler.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/handlers/AuthenticationCallHandler.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.handlers; Index: 3rdParty_sources/undertow/io/undertow/security/handlers/AuthenticationConstraintHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/handlers/Attic/AuthenticationConstraintHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/handlers/AuthenticationConstraintHandler.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/handlers/AuthenticationConstraintHandler.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.handlers; Index: 3rdParty_sources/undertow/io/undertow/security/handlers/AuthenticationMechanismsHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/handlers/Attic/AuthenticationMechanismsHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/handlers/AuthenticationMechanismsHandler.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/handlers/AuthenticationMechanismsHandler.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.handlers; Index: 3rdParty_sources/undertow/io/undertow/security/handlers/NotificationReceiverHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/handlers/Attic/NotificationReceiverHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/handlers/NotificationReceiverHandler.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/handlers/NotificationReceiverHandler.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.handlers; Index: 3rdParty_sources/undertow/io/undertow/security/handlers/SecurityActions.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/handlers/Attic/SecurityActions.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/handlers/SecurityActions.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/handlers/SecurityActions.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.handlers; Index: 3rdParty_sources/undertow/io/undertow/security/handlers/SecurityInitialHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/handlers/Attic/SecurityInitialHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/handlers/SecurityInitialHandler.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/handlers/SecurityInitialHandler.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.handlers; Index: 3rdParty_sources/undertow/io/undertow/security/handlers/SinglePortConfidentialityHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/handlers/Attic/SinglePortConfidentialityHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/handlers/SinglePortConfidentialityHandler.java 8 Sep 2014 09:47:03 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/handlers/SinglePortConfidentialityHandler.java 8 Sep 2014 10:52:17 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.handlers; Index: 3rdParty_sources/undertow/io/undertow/security/idm/Account.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/idm/Attic/Account.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/idm/Account.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/idm/Account.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.idm; Index: 3rdParty_sources/undertow/io/undertow/security/idm/Credential.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/idm/Attic/Credential.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/idm/Credential.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/idm/Credential.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.idm; Index: 3rdParty_sources/undertow/io/undertow/security/idm/DigestAlgorithm.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/idm/Attic/DigestAlgorithm.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/idm/DigestAlgorithm.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/idm/DigestAlgorithm.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.idm; @@ -37,7 +37,7 @@ static { DigestAlgorithm[] algorithms = DigestAlgorithm.values(); - Map byToken = new HashMap<>(algorithms.length); + Map byToken = new HashMap(algorithms.length); for (DigestAlgorithm current : algorithms) { byToken.put(current.token, current); } Index: 3rdParty_sources/undertow/io/undertow/security/idm/DigestCredential.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/idm/Attic/DigestCredential.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/idm/DigestCredential.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/idm/DigestCredential.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.idm; Index: 3rdParty_sources/undertow/io/undertow/security/idm/ExternalCredential.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/idm/Attic/ExternalCredential.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/idm/ExternalCredential.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/idm/ExternalCredential.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.security.idm; import java.io.Serializable; Index: 3rdParty_sources/undertow/io/undertow/security/idm/GSSContextCredential.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/idm/Attic/GSSContextCredential.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/idm/GSSContextCredential.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/idm/GSSContextCredential.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.idm; Index: 3rdParty_sources/undertow/io/undertow/security/idm/IdentityManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/idm/Attic/IdentityManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/idm/IdentityManager.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/idm/IdentityManager.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.idm; Index: 3rdParty_sources/undertow/io/undertow/security/idm/PasswordCredential.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/idm/Attic/PasswordCredential.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/idm/PasswordCredential.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/idm/PasswordCredential.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.idm; Index: 3rdParty_sources/undertow/io/undertow/security/idm/X509CertificateCredential.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/idm/Attic/X509CertificateCredential.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/idm/X509CertificateCredential.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/idm/X509CertificateCredential.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.idm; Index: 3rdParty_sources/undertow/io/undertow/security/impl/AuthenticationInfoToken.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/AuthenticationInfoToken.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/AuthenticationInfoToken.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/AuthenticationInfoToken.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; @@ -41,13 +41,13 @@ private static final HeaderTokenParser TOKEN_PARSER; static { - Map expected = new LinkedHashMap<>( + Map expected = new LinkedHashMap( AuthenticationInfoToken.values().length); for (AuthenticationInfoToken current : AuthenticationInfoToken.values()) { expected.put(current.getName(), current); } - TOKEN_PARSER = new HeaderTokenParser<>(Collections.unmodifiableMap(expected)); + TOKEN_PARSER = new HeaderTokenParser(Collections.unmodifiableMap(expected)); } private final String name; Index: 3rdParty_sources/undertow/io/undertow/security/impl/BasicAuthenticationMechanism.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/BasicAuthenticationMechanism.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/BasicAuthenticationMechanism.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/BasicAuthenticationMechanism.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; Index: 3rdParty_sources/undertow/io/undertow/security/impl/CachedAuthenticatedSessionMechanism.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/CachedAuthenticatedSessionMechanism.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/CachedAuthenticatedSessionMechanism.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/CachedAuthenticatedSessionMechanism.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; Index: 3rdParty_sources/undertow/io/undertow/security/impl/ClientCertAuthenticationMechanism.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/ClientCertAuthenticationMechanism.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/ClientCertAuthenticationMechanism.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/ClientCertAuthenticationMechanism.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; Index: 3rdParty_sources/undertow/io/undertow/security/impl/DigestAuthenticationMechanism.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/DigestAuthenticationMechanism.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/DigestAuthenticationMechanism.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/DigestAuthenticationMechanism.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,5 @@ /* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +8,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; @@ -73,7 +72,7 @@ private static final Set MANDATORY_REQUEST_TOKENS; static { - Set mandatoryTokens = new HashSet<>(); + Set mandatoryTokens = new HashSet(); mandatoryTokens.add(DigestAuthorizationToken.USERNAME); mandatoryTokens.add(DigestAuthorizationToken.REALM); mandatoryTokens.add(DigestAuthorizationToken.NONCE); @@ -113,7 +112,7 @@ this.nonceManager = nonceManager; this.mechanismName = mechanismName; - if (!supportedQops.isEmpty()) { + if (supportedQops.size() > 0) { StringBuilder sb = new StringBuilder(); Iterator it = supportedQops.iterator(); sb.append(it.next().getToken()); @@ -167,12 +166,12 @@ DigestContext context = exchange.getAttachment(DigestContext.ATTACHMENT_KEY); Map parsedHeader = context.getParsedHeader(); // Step 1 - Verify the set of tokens received to ensure valid values. - Set mandatoryTokens = new HashSet<>(MANDATORY_REQUEST_TOKENS); - if (!supportedAlgorithms.contains(DigestAlgorithm.MD5)) { + Set mandatoryTokens = new HashSet(MANDATORY_REQUEST_TOKENS); + if (supportedAlgorithms.contains(DigestAlgorithm.MD5) == false) { // If we don't support MD5 then the client must choose an algorithm as we can not fall back to MD5. mandatoryTokens.add(DigestAuthorizationToken.ALGORITHM); } - if (!supportedQops.isEmpty() && !supportedQops.contains(DigestQop.AUTH)) { + if (supportedQops.isEmpty() == false && supportedQops.contains(DigestQop.AUTH) == false) { // If we do not support auth then we are mandating auth-int so force the client to send a QOP mandatoryTokens.add(DigestAuthorizationToken.MESSAGE_QOP); } @@ -181,7 +180,7 @@ // This check is early as is increases the list of mandatory tokens. if (parsedHeader.containsKey(DigestAuthorizationToken.MESSAGE_QOP)) { qop = DigestQop.forName(parsedHeader.get(DigestAuthorizationToken.MESSAGE_QOP)); - if (qop == null || !supportedQops.contains(qop)) { + if (qop == null || supportedQops.contains(qop) == false) { // We are also ensuring the client is not trying to force a qop that has been disabled. REQUEST_LOGGER.invalidTokenReceived(DigestAuthorizationToken.MESSAGE_QOP.getName(), parsedHeader.get(DigestAuthorizationToken.MESSAGE_QOP)); @@ -206,7 +205,7 @@ } // Perform some validation of the remaining tokens. - if (!realmName.equals(parsedHeader.get(DigestAuthorizationToken.REALM))) { + if (realmName.equals(parsedHeader.get(DigestAuthorizationToken.REALM)) == false) { REQUEST_LOGGER.invalidTokenReceived(DigestAuthorizationToken.REALM.getName(), parsedHeader.get(DigestAuthorizationToken.REALM)); // TODO - This actually needs to result in a HTTP 400 Bad Request response and not a new challenge. @@ -216,7 +215,7 @@ // TODO - Validate the URI if (parsedHeader.containsKey(DigestAuthorizationToken.OPAQUE)) { - if (!OPAQUE_VALUE.equals(parsedHeader.get(DigestAuthorizationToken.OPAQUE))) { + if (OPAQUE_VALUE.equals(parsedHeader.get(DigestAuthorizationToken.OPAQUE)) == false) { REQUEST_LOGGER.invalidTokenReceived(DigestAuthorizationToken.OPAQUE.getName(), parsedHeader.get(DigestAuthorizationToken.OPAQUE)); return AuthenticationMechanismOutcome.NOT_AUTHENTICATED; @@ -226,7 +225,7 @@ DigestAlgorithm algorithm; if (parsedHeader.containsKey(DigestAuthorizationToken.ALGORITHM)) { algorithm = DigestAlgorithm.forName(parsedHeader.get(DigestAuthorizationToken.ALGORITHM)); - if (algorithm == null || !supportedAlgorithms.contains(algorithm)) { + if (algorithm == null || supportedAlgorithms.contains(algorithm) == false) { // We are also ensuring the client is not trying to force an algorithm that has been disabled. REQUEST_LOGGER.invalidTokenReceived(DigestAuthorizationToken.ALGORITHM.getName(), parsedHeader.get(DigestAuthorizationToken.ALGORITHM)); @@ -274,7 +273,7 @@ } // Step 3 - Verify that the nonce was eligible to be used. - if (!validateNonceUse(context, parsedHeader, exchange)) { + if (validateNonceUse(context, parsedHeader, exchange) == false) { // TODO - This is the right place to make use of the decision but the check needs to be much much sooner // otherwise a failure server // side could leave a packet that could be 're-played' after the failed auth. @@ -426,12 +425,12 @@ String theChallenge = rb.toString(); HeaderMap responseHeader = exchange.getResponseHeaders(); - if (supportedAlgorithms.isEmpty()) { - responseHeader.add(WWW_AUTHENTICATE, theChallenge); - } else { + if (supportedAlgorithms.size() > 0) { for (DigestAlgorithm current : supportedAlgorithms) { responseHeader.add(WWW_AUTHENTICATE, String.format(theChallenge, current.getToken())); } + } else { + responseHeader.add(WWW_AUTHENTICATE, theChallenge); } return new ChallengeResult(true, UNAUTHORIZED); @@ -442,7 +441,7 @@ DigestQop qop = context.getQop(); String currentNonce = context.getNonce(); String nextNonce = nonceManager.nextNonce(currentNonce, exchange); - if (qop != null || !nextNonce.equals(currentNonce)) { + if (qop != null || nextNonce.equals(currentNonce) == false) { StringBuilder sb = new StringBuilder(); sb.append(NEXT_NONCE).append("=\"").append(nextNonce).append("\""); if (qop != null) { @@ -586,7 +585,7 @@ @Override public byte[] getSessionData() { - if (!context.getAlgorithm().isSession()) { + if (context.getAlgorithm().isSession() == false) { throw MESSAGES.noSessionData(); } Index: 3rdParty_sources/undertow/io/undertow/security/impl/DigestAuthorizationToken.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/DigestAuthorizationToken.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/DigestAuthorizationToken.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/DigestAuthorizationToken.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; @@ -48,13 +48,13 @@ private static final HeaderTokenParser TOKEN_PARSER; static { - Map expected = new LinkedHashMap<>( + Map expected = new LinkedHashMap( DigestAuthorizationToken.values().length); for (DigestAuthorizationToken current : DigestAuthorizationToken.values()) { expected.put(current.getName(), current); } - TOKEN_PARSER = new HeaderTokenParser<>(Collections.unmodifiableMap(expected)); + TOKEN_PARSER = new HeaderTokenParser(Collections.unmodifiableMap(expected)); } private final String name; Index: 3rdParty_sources/undertow/io/undertow/security/impl/DigestQop.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/DigestQop.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/DigestQop.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/DigestQop.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; @@ -35,7 +35,7 @@ static { DigestQop[] qops = DigestQop.values(); - Map byToken = new HashMap<>(qops.length); + Map byToken = new HashMap(qops.length); for (DigestQop current : qops) { byToken.put(current.token, current); } Index: 3rdParty_sources/undertow/io/undertow/security/impl/DigestWWWAuthenticateToken.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/DigestWWWAuthenticateToken.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/DigestWWWAuthenticateToken.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/DigestWWWAuthenticateToken.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; @@ -45,13 +45,13 @@ private static final HeaderTokenParser TOKEN_PARSER; static { - Map expected = new LinkedHashMap<>( + Map expected = new LinkedHashMap( DigestWWWAuthenticateToken.values().length); for (DigestWWWAuthenticateToken current : DigestWWWAuthenticateToken.values()) { expected.put(current.getName(), current); } - TOKEN_PARSER = new HeaderTokenParser<>(Collections.unmodifiableMap(expected)); + TOKEN_PARSER = new HeaderTokenParser(Collections.unmodifiableMap(expected)); } private final String name; Index: 3rdParty_sources/undertow/io/undertow/security/impl/ExternalAuthenticationMechanism.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/ExternalAuthenticationMechanism.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/ExternalAuthenticationMechanism.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/ExternalAuthenticationMechanism.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.security.impl; import io.undertow.security.api.AuthenticationMechanism; Index: 3rdParty_sources/undertow/io/undertow/security/impl/FormAuthenticationMechanism.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/FormAuthenticationMechanism.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/FormAuthenticationMechanism.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/FormAuthenticationMechanism.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; Index: 3rdParty_sources/undertow/io/undertow/security/impl/GSSAPIAuthenticationMechanism.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/GSSAPIAuthenticationMechanism.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/GSSAPIAuthenticationMechanism.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/GSSAPIAuthenticationMechanism.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; @@ -267,7 +267,7 @@ } Principal getPrincipal() { - if (!isEstablished()) { + if (isEstablished() == false) { throw new IllegalStateException("No established GSSContext to use for the Principal."); } Index: 3rdParty_sources/undertow/io/undertow/security/impl/InMemorySingleSignOnManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/InMemorySingleSignOnManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/InMemorySingleSignOnManager.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/InMemorySingleSignOnManager.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.security.impl; import java.util.Collections; @@ -37,7 +19,7 @@ private static final SecureRandomSessionIdGenerator SECURE_RANDOM_SESSION_ID_GENERATOR = new SecureRandomSessionIdGenerator(); - private final Map ssoEntries = new ConcurrentHashMap<>(); + private final Map ssoEntries = new ConcurrentHashMap(); @Override public SingleSignOn findSingleSignOn(String ssoId) { @@ -61,7 +43,7 @@ private final String id; private final Account account; private final String mechanismName; - private final Map sessions = new CopyOnWriteMap<>(); + private final Map sessions = new CopyOnWriteMap(); SimpleSingleSignOnEntry(String id, Account account, String mechanismName) { this.id = id; Index: 3rdParty_sources/undertow/io/undertow/security/impl/SecurityActions.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/SecurityActions.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/SecurityActions.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/SecurityActions.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; Index: 3rdParty_sources/undertow/io/undertow/security/impl/SecurityContextFactoryImpl.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/SecurityContextFactoryImpl.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/SecurityContextFactoryImpl.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/SecurityContextFactoryImpl.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; Index: 3rdParty_sources/undertow/io/undertow/security/impl/SecurityContextImpl.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/SecurityContextImpl.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/SecurityContextImpl.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/SecurityContextImpl.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; @@ -55,9 +55,9 @@ private String programaticMechName = "Programatic"; private AuthenticationState authenticationState = AuthenticationState.NOT_ATTEMPTED; private final HttpServerExchange exchange; - private final List authMechanisms = new ArrayList<>(); + private final List authMechanisms = new ArrayList(); private final IdentityManager identityManager; - private final List notificationReceivers = new ArrayList<>(); + private final List notificationReceivers = new ArrayList(); // Maybe this will need to be a custom mechanism that doesn't exchange tokens with the client but will then Index: 3rdParty_sources/undertow/io/undertow/security/impl/SimpleNonceManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/SimpleNonceManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/SimpleNonceManager.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/SimpleNonceManager.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.security.impl; Index: 3rdParty_sources/undertow/io/undertow/security/impl/SingleSignOn.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/SingleSignOn.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/SingleSignOn.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/SingleSignOn.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,23 +1,7 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.security.impl; +import java.io.Closeable; + import io.undertow.security.idm.Account; import io.undertow.server.session.Session; import io.undertow.server.session.SessionManager; @@ -26,7 +10,7 @@ * @author Stuart Douglas * @author Paul Ferraro */ -public interface SingleSignOn extends Iterable, AutoCloseable { +public interface SingleSignOn extends Iterable, Closeable { /** * Returns the unique identifier for this SSO. Index: 3rdParty_sources/undertow/io/undertow/security/impl/SingleSignOnAuthenticationMechanism.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/SingleSignOnAuthenticationMechanism.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/SingleSignOnAuthenticationMechanism.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/SingleSignOnAuthenticationMechanism.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.security.impl; import io.undertow.security.api.AuthenticationMechanism; @@ -68,9 +50,9 @@ public AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, SecurityContext securityContext) { Cookie cookie = exchange.getRequestCookies().get(cookieName); if (cookie != null) { - final String ssoId = cookie.getValue(); - try (SingleSignOn sso = this.manager.findSingleSignOn(ssoId)) { - if (sso != null) { + final SingleSignOn sso = this.manager.findSingleSignOn(cookie.getValue()); + if (sso != null) { + try { Account verified = securityContext.getIdentityManager().verify(sso.getAccount()); if (verified == null) { //we return not attempted here to allow other mechanisms to proceed as normal @@ -83,11 +65,21 @@ @Override public void handleNotification(SecurityNotification notification) { if (notification.getEventType() == SecurityNotification.EventType.LOGGED_OUT) { - manager.removeSingleSignOn(ssoId); + try { + sso.remove(session); + for (Session associatedSession : sso) { + associatedSession.invalidate(null); + } + manager.removeSingleSignOn(sso.getId()); + } finally { + sso.close(); + } } } }); return AuthenticationMechanismOutcome.AUTHENTICATED; + } finally { + sso.close(); } } clearSsoCookie(exchange); @@ -127,10 +119,14 @@ SecurityContext sc = exchange.getSecurityContext(); Account account = sc.getAuthenticatedAccount(); if (account != null) { - try (SingleSignOn sso = manager.createSingleSignOn(account, sc.getMechanismName())) { + SingleSignOn sso = manager.createSingleSignOn(account, sc.getMechanismName()); + try { + Session session = getSession(exchange); registerSessionIfRequired(sso, session); exchange.getResponseCookies().put(cookieName, new CookieImpl(cookieName, sso.getId()).setHttpOnly(httpOnly).setSecure(secure).setDomain(domain).setPath(path)); + } finally { + sso.close(); } } return factory.create(); @@ -148,19 +144,18 @@ public void sessionDestroyed(Session session, HttpServerExchange exchange, SessionDestroyedReason reason) { String ssoId = (String) session.getAttribute(SSO_SESSION_ATTRIBUTE); if (ssoId != null) { - try (SingleSignOn sso = manager.findSingleSignOn(ssoId)) { - if (sso != null) { + SingleSignOn sso = manager.findSingleSignOn(ssoId); + if (sso != null) { + try { sso.remove(session); if (reason == SessionDestroyedReason.INVALIDATED) { for (Session associatedSession : sso) { associatedSession.invalidate(null); - sso.remove(associatedSession); } - } - // If there are no more associated sessions, remove the SSO altogether - if (!sso.iterator().hasNext()) { manager.removeSingleSignOn(ssoId); } + } finally { + sso.close(); } } } Index: 3rdParty_sources/undertow/io/undertow/security/impl/SingleSignOnManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/security/impl/Attic/SingleSignOnManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/security/impl/SingleSignOnManager.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/security/impl/SingleSignOnManager.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.security.impl; import io.undertow.security.idm.Account; Index: 3rdParty_sources/undertow/io/undertow/server/AbstractServerConnection.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/AbstractServerConnection.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/AbstractServerConnection.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/AbstractServerConnection.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server; @@ -48,7 +48,7 @@ protected final OptionMap undertowOptions; protected final StreamSourceConduit originalSourceConduit; protected final StreamSinkConduit originalSinkConduit; - protected final List closeListeners = new LinkedList<>(); + protected final List closeListeners = new LinkedList(); protected HttpServerExchange current; @@ -272,10 +272,6 @@ throw UndertowMessages.MESSAGES.upgradeNotSupported(); } - @Override - protected void maxEntitySizeUpdated(HttpServerExchange exchange) { - } - private class CloseSetter implements ChannelListener.Setter, ChannelListener { private ChannelListener listener; Index: 3rdParty_sources/undertow/io/undertow/server/BasicSSLSessionInfo.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/BasicSSLSessionInfo.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/BasicSSLSessionInfo.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/BasicSSLSessionInfo.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; import io.undertow.UndertowMessages; Index: 3rdParty_sources/undertow/io/undertow/server/BlockingHttpExchange.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/BlockingHttpExchange.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/BlockingHttpExchange.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/BlockingHttpExchange.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,24 +1,5 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; -import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -31,7 +12,7 @@ * * @author Stuart Douglas */ -public interface BlockingHttpExchange extends Closeable { +public interface BlockingHttpExchange { /** * Returns the input stream that is in use for this exchange. Index: 3rdParty_sources/undertow/io/undertow/server/ConduitWrapper.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/ConduitWrapper.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/ConduitWrapper.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/ConduitWrapper.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server; Index: 3rdParty_sources/undertow/io/undertow/server/ConnectionSSLSessionInfo.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/ConnectionSSLSessionInfo.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/ConnectionSSLSessionInfo.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/ConnectionSSLSessionInfo.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; import io.undertow.UndertowOptions; Index: 3rdParty_sources/undertow/io/undertow/server/Connectors.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/Connectors.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/Connectors.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/Connectors.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; import io.undertow.UndertowLogger; @@ -80,9 +62,7 @@ Pooled[] bufs = exchange.getAttachment(HttpServerExchange.BUFFERED_REQUEST_DATA); if (bufs != null) { for (Pooled i : bufs) { - if(i != null) { - i.free(); - } + i.free(); } } nextListener.proceed(); @@ -146,7 +126,7 @@ header.append(DateUtils.toOldCookieDateString(expires)); } else if (cookie.getMaxAge() > 0) { Date expires = new Date(); - expires.setTime(expires.getTime() + cookie.getMaxAge() * 1000L); + expires.setTime(expires.getTime() + cookie.getMaxAge() * 1000); header.append("; Expires="); header.append(DateUtils.toOldCookieDateString(expires)); } @@ -217,7 +197,7 @@ if (!exchange.isResponseStarted()) { exchange.setResponseCode(500); } - UndertowLogger.REQUEST_LOGGER.errorf(t, "Undertow request failed %s", exchange); + UndertowLogger.REQUEST_LOGGER.errorf(t, "Blocking request failed %s", exchange); exchange.endExchange(); } } Index: 3rdParty_sources/undertow/io/undertow/server/DefaultResponseListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/DefaultResponseListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/DefaultResponseListener.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/DefaultResponseListener.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; /** Index: 3rdParty_sources/undertow/io/undertow/server/ExchangeCompletionListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/ExchangeCompletionListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/ExchangeCompletionListener.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/ExchangeCompletionListener.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; /** Index: 3rdParty_sources/undertow/io/undertow/server/HandlerWrapper.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/HandlerWrapper.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/HandlerWrapper.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/HandlerWrapper.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; /** Index: 3rdParty_sources/undertow/io/undertow/server/HttpHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/HttpHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/HttpHandler.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/HttpHandler.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server; Index: 3rdParty_sources/undertow/io/undertow/server/HttpServerExchange.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/HttpServerExchange.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/HttpServerExchange.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/HttpServerExchange.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server; @@ -99,8 +99,8 @@ static final AttachmentKey[]> BUFFERED_REQUEST_DATA = AttachmentKey.create(Pooled[].class); private final ServerConnection connection; - private final HeaderMap requestHeaders; - private final HeaderMap responseHeaders; + private final HeaderMap requestHeaders = new HeaderMap(); + private final HeaderMap responseHeaders = new HeaderMap(); private int exchangeCompletionListenersCount = 0; private ExchangeCompletionListener[] exchangeCompleteListeners; @@ -282,20 +282,14 @@ private InetSocketAddress destinationAddress; public HttpServerExchange(final ServerConnection connection, long maxEntitySize) { - this(connection, new HeaderMap(), new HeaderMap(), maxEntitySize); + this.connection = connection; + this.maxEntitySize = maxEntitySize; } public HttpServerExchange(final ServerConnection connection) { this(connection, 0); } - public HttpServerExchange(final ServerConnection connection, final HeaderMap requestHeaders, final HeaderMap responseHeaders, long maxEntitySize) { - this.connection = connection; - this.maxEntitySize = maxEntitySize; - this.requestHeaders = requestHeaders; - this.responseHeaders = responseHeaders; - } - /** * Get the request protocol string. Normally this is one of the strings listed in {@link Protocols}. * @@ -498,10 +492,6 @@ return this; } - /** - * - * @return The query string, without the leading ? - */ public String getQueryString() { return queryString; } @@ -963,18 +953,18 @@ */ public Map> getQueryParameters() { if (queryParameters == null) { - queryParameters = new TreeMap<>(); + queryParameters = new TreeMap>(); } return queryParameters; } public HttpServerExchange addQueryParam(final String name, final String param) { if (queryParameters == null) { - queryParameters = new TreeMap<>(); + queryParameters = new TreeMap>(); } Deque list = queryParameters.get(name); if (list == null) { - queryParameters.put(name, list = new ArrayDeque<>(2)); + queryParameters.put(name, list = new ArrayDeque(2)); } list.add(param); return this; @@ -988,18 +978,18 @@ */ public Map> getPathParameters() { if (pathParameters == null) { - pathParameters = new TreeMap<>(); + pathParameters = new TreeMap>(); } return pathParameters; } public HttpServerExchange addPathParam(final String name, final String param) { if (pathParameters == null) { - pathParameters = new TreeMap<>(); + pathParameters = new TreeMap>(); } Deque list = pathParameters.get(name); if (list == null) { - pathParameters.put(name, list = new ArrayDeque<>(2)); + pathParameters.put(name, list = new ArrayDeque(2)); } list.add(param); return this; @@ -1025,7 +1015,7 @@ */ public HttpServerExchange setResponseCookie(final Cookie cookie) { if (responseCookies == null) { - responseCookies = new TreeMap<>(); //hashmap is slow to allocate in JDK7 + responseCookies = new TreeMap(); //hashmap is slow to allocate in JDK7 } responseCookies.put(cookie.getName(), cookie); return this; @@ -1036,7 +1026,7 @@ */ public Map getResponseCookies() { if (responseCookies == null) { - responseCookies = new TreeMap<>(); + responseCookies = new TreeMap(); } return responseCookies; } @@ -1076,7 +1066,7 @@ final ConduitStreamSourceChannel sourceChannel = connection.getSourceChannel(); if (wrappers != null) { this.requestWrappers = null; - final WrapperConduitFactory factory = new WrapperConduitFactory<>(wrappers, requestWrapperCount, sourceChannel.getConduit(), this); + final WrapperConduitFactory factory = new WrapperConduitFactory(wrappers, requestWrapperCount, sourceChannel.getConduit(), this); sourceChannel.setConduit(factory.create()); } return requestChannel = new ReadDispatchChannel(sourceChannel); @@ -1256,7 +1246,7 @@ public HttpServerExchange addResponseWrapper(final ConduitWrapper wrapper) { ConduitWrapper[] wrappers = responseWrappers; if (responseChannel != null) { - throw UndertowMessages.MESSAGES.responseChannelAlreadyProvided(); + throw UndertowMessages.MESSAGES.requestChannelAlreadyProvided(); } if(wrappers == null) { this.responseWrappers = wrappers = new ConduitWrapper[2]; @@ -1388,10 +1378,6 @@ public HttpServerExchange endExchange() { final int state = this.state; if (allAreSet(state, FLAG_REQUEST_TERMINATED | FLAG_RESPONSE_TERMINATED)) { - if(blockingHttpExchange != null) { - //we still have to close the blocking exchange in this case, - IoUtils.safeClose(blockingHttpExchange); - } return this; } if(defaultResponseListeners != null) { @@ -1412,10 +1398,6 @@ } } - if (anyAreClear(state, FLAG_REQUEST_TERMINATED)) { - connection.terminateRequestChannel(this); - } - if (blockingHttpExchange != null) { try { //TODO: can we end up in this situation in a IO thread? @@ -1428,6 +1410,7 @@ //417 means that we are rejecting the request //so the client should not actually send any data + //TODO: how if (anyAreClear(state, FLAG_REQUEST_TERMINATED)) { //not really sure what the best thing to do here is @@ -1526,7 +1509,6 @@ } } catch (IOException e) { UndertowLogger.REQUEST_IO_LOGGER.ioException(e); - IoUtils.safeClose(connection); } } @@ -1582,7 +1564,6 @@ throw UndertowMessages.MESSAGES.requestChannelAlreadyProvided(); } this.maxEntitySize = maxEntitySize; - connection.maxEntitySizeUpdated(this); return this; } @@ -1673,11 +1654,8 @@ @Override public void close() throws IOException { - try { - getInputStream().close(); - } finally { - getOutputStream().close(); - } + IoUtils.safeClose(getInputStream()); + IoUtils.safeClose(getOutputStream()); } } @@ -1755,22 +1733,6 @@ } }); } - - @Override - public void awaitWritable() throws IOException { - if(Thread.currentThread() == getIoThread()) { - throw UndertowMessages.MESSAGES.awaitCalledFromIoThread(); - } - super.awaitWritable(); - } - - @Override - public void awaitWritable(long time, TimeUnit timeUnit) throws IOException { - if(Thread.currentThread() == getIoThread()) { - throw UndertowMessages.MESSAGES.awaitCalledFromIoThread(); - } - super.awaitWritable(time, timeUnit); - } } /** @@ -1834,13 +1796,8 @@ } public void requestDone() { - if(delegate instanceof ConduitStreamSourceChannel) { - ((ConduitStreamSourceChannel)delegate).setReadListener(null); - ((ConduitStreamSourceChannel)delegate).setCloseListener(null); - } else { - delegate.getReadSetter().set(null); - delegate.getCloseSetter().set(null); - } + delegate.setReadListener(null); + delegate.setCloseListener(null); } @Override @@ -1854,9 +1811,6 @@ @Override public void awaitReadable() throws IOException { - if(Thread.currentThread() == getIoThread()) { - throw UndertowMessages.MESSAGES.awaitCalledFromIoThread(); - } Pooled[] buffered = getAttachment(BUFFERED_REQUEST_DATA); if (buffered == null) { super.awaitReadable(); @@ -1911,9 +1865,6 @@ @Override public void awaitReadable(long time, TimeUnit timeUnit) throws IOException { - if(Thread.currentThread() == getIoThread()) { - throw UndertowMessages.MESSAGES.awaitCalledFromIoThread(); - } Pooled[] buffered = getAttachment(BUFFERED_REQUEST_DATA); if (buffered == null) { super.awaitReadable(time, timeUnit); Index: 3rdParty_sources/undertow/io/undertow/server/HttpUpgradeListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/HttpUpgradeListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/HttpUpgradeListener.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/HttpUpgradeListener.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; import org.xnio.StreamConnection; Index: 3rdParty_sources/undertow/io/undertow/server/JvmRouteHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/JvmRouteHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/JvmRouteHandler.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/JvmRouteHandler.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,37 +1,10 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - import io.undertow.server.handlers.Cookie; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.ConduitFactory; import org.xnio.conduits.StreamSinkConduit; /** - * - * Handler that appends the JVM route to the session id. - * * @author Stuart Douglas */ public class JvmRouteHandler implements HttpHandler { @@ -67,65 +40,14 @@ @Override public StreamSinkConduit wrap(ConduitFactory factory, HttpServerExchange exchange) { - Cookie sessionId = exchange.getResponseCookies().get(sessionCookieName); - if (sessionId != null) { - StringBuilder sb = new StringBuilder(sessionId.getValue()); - sb.append('.'); - sb.append(jvmRoute); - sessionId.setValue(sb.toString()); - } + Cookie sessionId = exchange.getResponseCookies().get(sessionCookieName); + if (sessionId != null) { + StringBuilder sb = new StringBuilder(sessionId.getValue()); + sb.append('.'); + sb.append(jvmRoute); + sessionId.setValue(sb.toString()); + } return factory.create(); } } - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "jvm-route"; - } - - @Override - public Map> parameters() { - Map> params = new HashMap<>(); - params.put("value", String.class); - params.put("session-cookie-name", String.class); - - return params; - } - - @Override - public Set requiredParameters() { - return Collections.singleton("value"); - } - - @Override - public String defaultParameter() { - return "value"; - } - - @Override - public HandlerWrapper build(Map config) { - String sessionCookieName = (String) config.get("session-cookie-name"); - - return new Wrapper((String)config.get("value"), sessionCookieName == null ? "JSESSIONID" : sessionCookieName); - } - - } - - private static class Wrapper implements HandlerWrapper { - - private final String value; - private final String sessionCookieName; - - private Wrapper(String value, String sessionCookieName) { - this.value = value; - this.sessionCookieName = sessionCookieName; - } - - @Override - public HttpHandler wrap(HttpHandler handler) { - return new JvmRouteHandler(handler, sessionCookieName, value); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/ListenerRegistry.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/ListenerRegistry.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/ListenerRegistry.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/ListenerRegistry.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; import java.net.InetSocketAddress; @@ -39,7 +21,7 @@ */ public class ListenerRegistry { - private final ConcurrentMap listeners = new CopyOnWriteMap<>(); + private final ConcurrentMap listeners = new CopyOnWriteMap(); public Listener getListener(final String name) { return listeners.get(name); @@ -65,12 +47,12 @@ /** * Map that can be used to store additional listener metadata */ - private final Map contextInformation = new CopyOnWriteMap<>(); + private final Map contextInformation = new CopyOnWriteMap(); /** * Information about any HTTP upgrade handlers that are registered on this handler. */ - private final Set httpUpgradeMetadata = new CopyOnWriteArraySet<>(); + private final Set httpUpgradeMetadata = new CopyOnWriteArraySet(); public Listener(final String protocol, final String name, final String serverName, final InetSocketAddress bindAddress) { this.protocol = protocol; @@ -140,7 +122,7 @@ private final String protocol; private final String subProtocol; - private final Map contextInformation = new CopyOnWriteMap<>(); + private final Map contextInformation = new CopyOnWriteMap(); public HttpUpgradeMetadata(final String protocol, final String subProtocol) { Index: 3rdParty_sources/undertow/io/undertow/server/OpenListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/OpenListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/OpenListener.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/OpenListener.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; import org.xnio.ChannelListener; Index: 3rdParty_sources/undertow/io/undertow/server/RenegotiationRequiredException.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/RenegotiationRequiredException.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/RenegotiationRequiredException.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/RenegotiationRequiredException.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; /** Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/RoutingHandler.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/server/SSLSessionInfo.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/SSLSessionInfo.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/SSLSessionInfo.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/SSLSessionInfo.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; import org.xnio.SslClientAuthMode; Index: 3rdParty_sources/undertow/io/undertow/server/ServerConnection.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/ServerConnection.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/ServerConnection.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/ServerConnection.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,25 +1,6 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server; import io.undertow.util.AbstractAttachable; - import org.xnio.Option; import org.xnio.OptionMap; import org.xnio.Pool; @@ -75,18 +56,7 @@ public abstract HttpServerExchange sendOutOfBandResponse(HttpServerExchange exchange); /** - * Invoked when the exchange is complete, and there is still data in the request channel. Some implementations - * (such as SPDY and HTTP2) have more efficient ways to drain the request than simply reading all data - * (e.g. RST_STREAM). * - * After this method is invoked the stream will be drained normally. - * - * @param exchange The current exchange. - */ - public abstract void terminateRequestChannel(HttpServerExchange exchange); - - /** - * * @return true if the connection is open */ public abstract boolean isOpen(); @@ -177,10 +147,6 @@ */ protected abstract StreamSinkConduit getSinkConduit(HttpServerExchange exchange, final StreamSinkConduit conduit); - /** - * - * @return true if this connection supports HTTP upgrade - */ protected abstract boolean isUpgradeSupported(); /** @@ -190,13 +156,6 @@ protected abstract void setUpgradeListener(HttpUpgradeListener upgradeListener); - /** - * Callback that is invoked if the max entity size is updated. - * - * @param exchange The current exchange - */ - protected abstract void maxEntitySizeUpdated(HttpServerExchange exchange); - public interface CloseListener { void closed(final ServerConnection connection); Index: 3rdParty_sources/undertow/io/undertow/server/TruncatedResponseException.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/Attic/TruncatedResponseException.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/TruncatedResponseException.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/TruncatedResponseException.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,19 +1,23 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. + * Copyright 2012, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. * - * http://www.apache.org/licenses/LICENSE-2.0 + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package io.undertow.server; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/AccessControlListHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/AccessControlListHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/AccessControlListHandler.java 8 Sep 2014 09:46:47 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/AccessControlListHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.UndertowMessages; @@ -41,7 +23,7 @@ private volatile HttpHandler next; private volatile boolean defaultAllow = false; private final ExchangeAttribute attribute; - private final List acl = new CopyOnWriteArrayList<>(); + private final List acl = new CopyOnWriteArrayList(); public AccessControlListHandler(final HttpHandler next, ExchangeAttribute attribute) { this.next = next; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/AllowedMethodsHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/AllowedMethodsHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/AllowedMethodsHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/AllowedMethodsHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,33 +1,11 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import java.util.Arrays; -import java.util.Collections; import java.util.HashSet; -import java.util.Map; import java.util.Set; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.HttpString; import io.undertow.util.StatusCodes; @@ -43,12 +21,12 @@ private final HttpHandler next; public AllowedMethodsHandler(final HttpHandler next, final Set allowedMethods) { - this.allowedMethods = new HashSet<>(allowedMethods); + this.allowedMethods = new HashSet(allowedMethods); this.next = next; } public AllowedMethodsHandler(final HttpHandler next, final HttpString... allowedMethods) { - this.allowedMethods = new HashSet<>(Arrays.asList(allowedMethods)); + this.allowedMethods = new HashSet(Arrays.asList(allowedMethods)); this.next = next; } @@ -62,51 +40,4 @@ } } - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "allowed-methods"; - } - - @Override - public Map> parameters() { - return Collections.>singletonMap("methods", String[].class); - } - - @Override - public Set requiredParameters() { - return Collections.singleton("methods"); - } - - @Override - public String defaultParameter() { - return "methods"; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper((String[]) config.get("methods")); - } - - } - - private static class Wrapper implements HandlerWrapper { - - private final String[] methods; - - private Wrapper(String[] methods) { - this.methods = methods; - } - - @Override - public HttpHandler wrap(HttpHandler handler) { - HttpString[] strings = new HttpString[methods.length]; - for(int i = 0; i < methods.length; ++i) { - strings[i] = new HttpString(methods[i]); - } - - return new AllowedMethodsHandler(handler, strings); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/AttachmentHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/AttachmentHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/AttachmentHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/AttachmentHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/BlockingHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/BlockingHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/BlockingHandler.java 8 Sep 2014 09:46:47 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/BlockingHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,23 +9,17 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; /** * A {@link HttpHandler} that initiates a blocking request. If the thread is currently running @@ -65,41 +59,4 @@ this.handler = rootHandler; return this; } - - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "blocking"; - } - - @Override - public Map> parameters() { - return Collections.emptyMap(); - } - - @Override - public Set requiredParameters() { - return Collections.emptySet(); - } - - @Override - public String defaultParameter() { - return null; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper(); - } - - } - - private static class Wrapper implements HandlerWrapper { - @Override - public HttpHandler wrap(HttpHandler handler) { - return new BlockingHandler(handler); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/CanonicalPathHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/CanonicalPathHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/CanonicalPathHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/CanonicalPathHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,24 +9,18 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - import io.undertow.Handlers; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.CanonicalPathUtils; /** @@ -58,40 +52,4 @@ this.next = next; return this; } - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "canonical-path"; - } - - @Override - public Map> parameters() { - return Collections.emptyMap(); - } - - @Override - public Set requiredParameters() { - return Collections.emptySet(); - } - - @Override - public String defaultParameter() { - return null; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper(); - } - - } - - private static class Wrapper implements HandlerWrapper { - @Override - public HttpHandler wrap(HttpHandler handler) { - return new CanonicalPathHandler(handler); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/ChannelUpgradeHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/ChannelUpgradeHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/ChannelUpgradeHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/ChannelUpgradeHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; @@ -40,7 +40,7 @@ * @author Stuart Douglas */ public final class ChannelUpgradeHandler implements HttpHandler { - private final CopyOnWriteMap> handlers = new CopyOnWriteMap<>(); + private final CopyOnWriteMap> handlers = new CopyOnWriteMap>(); private volatile HttpHandler nonUpgradeHandler = ResponseCodeHandler.HANDLE_404; /** @@ -59,7 +59,7 @@ } List list = handlers.get(productString); if (list == null) { - handlers.put(productString, list = new CopyOnWriteArrayList<>()); + handlers.put(productString, list = new CopyOnWriteArrayList()); } list.add(new Holder(openListener, handshake)); } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/Cookie.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/Cookie.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/Cookie.java 8 Sep 2014 09:46:47 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/Cookie.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/CookieImpl.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/CookieImpl.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/CookieImpl.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/CookieImpl.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/DateHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/DateHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/DateHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/DateHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import java.util.Date; @@ -30,10 +12,6 @@ * * The current date string is cached, and is updated every second in a racey * manner (i.e. it is possible for two thread to update it at once). - *

- * This handler is deprecated, the same functionality is achieved by using the - * server option {@link io.undertow.UndertowOptions#ALWAYS_SET_DATE ALWAYS_SET_DATE}. - * It is enabled by default. * * @author Stuart Douglas */ @@ -51,7 +29,6 @@ @Override public void handleRequest(final HttpServerExchange exchange) throws Exception { - // better method is used in DateUtils#addDateHeaderIfRequired long time = System.nanoTime(); if(time < nextUpdateTime) { exchange.getResponseHeaders().put(Headers.DATE, cachedDateString); Index: 3rdParty_sources/undertow/io/undertow/server/handlers/DisableCacheHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/DisableCacheHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/DisableCacheHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/DisableCacheHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,13 +1,7 @@ package io.undertow.server.handlers; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.Headers; /** @@ -32,40 +26,4 @@ exchange.getResponseHeaders().add(Headers.EXPIRES, "0"); next.handleRequest(exchange); } - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "disable-cache"; - } - - @Override - public Map> parameters() { - return Collections.emptyMap(); - } - - @Override - public Set requiredParameters() { - return Collections.emptySet(); - } - - @Override - public String defaultParameter() { - return null; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper(); - } - - } - - private static class Wrapper implements HandlerWrapper { - @Override - public HttpHandler wrap(HttpHandler handler) { - return new DisableCacheHandler(handler); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/DisallowedMethodsHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/DisallowedMethodsHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/DisallowedMethodsHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/DisallowedMethodsHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,33 +1,11 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import java.util.Arrays; -import java.util.Collections; import java.util.HashSet; -import java.util.Map; import java.util.Set; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.HttpString; import io.undertow.util.StatusCodes; @@ -42,13 +20,13 @@ private final HttpHandler next; public DisallowedMethodsHandler(final HttpHandler next, final Set disallowedMethods) { - this.disallowedMethods = new HashSet<>(disallowedMethods); + this.disallowedMethods = new HashSet(disallowedMethods); this.next = next; } public DisallowedMethodsHandler(final HttpHandler next, final HttpString... disallowedMethods) { - this.disallowedMethods = new HashSet<>(Arrays.asList(disallowedMethods)); + this.disallowedMethods = new HashSet(Arrays.asList(disallowedMethods)); this.next = next; } @@ -62,52 +40,4 @@ } } - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "disallowed-methods"; - } - - @Override - public Map> parameters() { - return Collections.>singletonMap("methods", String[].class); - } - - @Override - public Set requiredParameters() { - return Collections.singleton("methods"); - } - - @Override - public String defaultParameter() { - return "methods"; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper((String[]) config.get("methods")); - } - - } - - private static class Wrapper implements HandlerWrapper { - - private final String[] methods; - - private Wrapper(String[] methods) { - this.methods = methods; - } - - @Override - public HttpHandler wrap(HttpHandler handler) { - HttpString[] strings = new HttpString[methods.length]; - for(int i = 0; i < methods.length; ++i) { - strings[i] = new HttpString(methods[i]); - } - - return new DisallowedMethodsHandler(handler, strings); - } - } } Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/ExceptionHandler.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/server/handlers/GracefulShutdownHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/GracefulShutdownHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/GracefulShutdownHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/GracefulShutdownHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.UndertowMessages; @@ -43,7 +25,7 @@ private volatile boolean shutdown = false; private final GracefulShutdownListener listener = new GracefulShutdownListener(); - private final List shutdownListeners = new ArrayList<>(); + private final List shutdownListeners = new ArrayList(); private final Object lock = new Object(); Index: 3rdParty_sources/undertow/io/undertow/server/handlers/HttpContinueAcceptingHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/HttpContinueAcceptingHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/HttpContinueAcceptingHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/HttpContinueAcceptingHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/HttpContinueReadHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/HttpContinueReadHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/HttpContinueReadHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/HttpContinueReadHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/HttpTraceHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/HttpTraceHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/HttpTraceHandler.java 8 Sep 2014 09:46:47 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/HttpTraceHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,31 +1,7 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.HeaderValues; import io.undertow.util.Headers; import io.undertow.util.Methods; @@ -69,42 +45,4 @@ handler.handleRequest(exchange); } } - - - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "trace"; - } - - @Override - public Map> parameters() { - return Collections.emptyMap(); - } - - @Override - public Set requiredParameters() { - return Collections.emptySet(); - } - - @Override - public String defaultParameter() { - return null; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper(); - } - - } - - private static class Wrapper implements HandlerWrapper { - @Override - public HttpHandler wrap(HttpHandler handler) { - return new HttpTraceHandler(handler); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/HttpUpgradeHandshake.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/HttpUpgradeHandshake.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/HttpUpgradeHandshake.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/HttpUpgradeHandshake.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/IPAddressAccessControlHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/IPAddressAccessControlHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/IPAddressAccessControlHandler.java 8 Sep 2014 09:46:47 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/IPAddressAccessControlHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import java.net.Inet4Address; @@ -72,22 +54,15 @@ private volatile HttpHandler next; private volatile boolean defaultAllow = false; - private final int denyResponseCode; - private final List ipv6acl = new CopyOnWriteArrayList<>(); - private final List ipv4acl = new CopyOnWriteArrayList<>(); + private final List ipv6acl = new CopyOnWriteArrayList(); + private final List ipv4acl = new CopyOnWriteArrayList(); public IPAddressAccessControlHandler(final HttpHandler next) { - this(next, StatusCodes.FORBIDDEN); - } - - public IPAddressAccessControlHandler(final HttpHandler next, final int denyResponseCode) { this.next = next; - this.denyResponseCode = denyResponseCode; } public IPAddressAccessControlHandler() { this.next = ResponseCodeHandler.HANDLE_404; - this.denyResponseCode = StatusCodes.FORBIDDEN; } @Override @@ -96,7 +71,7 @@ if (isAllowed(peer.getAddress())) { next.handleRequest(exchange); } else { - exchange.setResponseCode(denyResponseCode); + exchange.setResponseCode(StatusCodes.FORBIDDEN); exchange.endExchange(); } } @@ -118,10 +93,6 @@ return defaultAllow; } - public int getDenyResponseCode() { - return denyResponseCode; - } - public boolean isDefaultAllow() { return defaultAllow; } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/JDBCLogHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/JDBCLogHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/JDBCLogHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/JDBCLogHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.UndertowLogger; @@ -90,7 +72,7 @@ refererField = "referer"; userAgentField = "userAgent"; this.logWriteExecutor = logWriteExecutor; - this.pendingMessages = new ConcurrentLinkedDeque<>(); + this.pendingMessages = new ConcurrentLinkedDeque(); } @Override @@ -156,7 +138,7 @@ return; } - List messages = new ArrayList<>(); + List messages = new ArrayList(); JDBCLogAttribute msg = null; //only grab at most 1000 messages at a time Index: 3rdParty_sources/undertow/io/undertow/server/handlers/MetricsHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/MetricsHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/MetricsHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/MetricsHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.server.ExchangeCompletionListener; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/NameVirtualHostHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/NameVirtualHostHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/NameVirtualHostHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/NameVirtualHostHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; @@ -35,7 +35,7 @@ public class NameVirtualHostHandler implements HttpHandler { private volatile HttpHandler defaultHandler = ResponseCodeHandler.HANDLE_404; - private final Map hosts = new CopyOnWriteMap<>(); + private final Map hosts = new CopyOnWriteMap(); @Override Index: 3rdParty_sources/undertow/io/undertow/server/handlers/OriginHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/OriginHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/OriginHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/OriginHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; @@ -32,14 +32,14 @@ import io.undertow.util.Headers; /** - * A handler for the HTTP Origin (RFC 6454) header. + * A handler for the HTTP Origin header. * * @author Stuart Douglas */ public class OriginHandler implements HttpHandler { private volatile HttpHandler originFailedHandler = ResponseCodeHandler.HANDLE_403; - private volatile Set allowedOrigins = new HashSet<>(); + private volatile Set allowedOrigins = new HashSet(); private volatile boolean requireAllOrigins = true; private volatile boolean requireOriginHeader = true; private volatile HttpHandler next = ResponseCodeHandler.HANDLE_404; @@ -86,21 +86,21 @@ } public synchronized OriginHandler addAllowedOrigin(final String origin) { - final Set allowedOrigins = new HashSet<>(this.allowedOrigins); + final Set allowedOrigins = new HashSet(this.allowedOrigins); allowedOrigins.add(origin); this.allowedOrigins = Collections.unmodifiableSet(allowedOrigins); return this; } public synchronized OriginHandler addAllowedOrigins(final Collection origins) { - final Set allowedOrigins = new HashSet<>(this.allowedOrigins); + final Set allowedOrigins = new HashSet(this.allowedOrigins); allowedOrigins.addAll(origins); this.allowedOrigins = Collections.unmodifiableSet(allowedOrigins); return this; } public synchronized OriginHandler addAllowedOrigins(final String... origins) { - final Set allowedOrigins = new HashSet<>(this.allowedOrigins); + final Set allowedOrigins = new HashSet(this.allowedOrigins); allowedOrigins.addAll(Arrays.asList(origins)); this.allowedOrigins = Collections.unmodifiableSet(allowedOrigins); return this; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/PathHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/PathHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/PathHandler.java 8 Sep 2014 09:46:47 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/PathHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; @@ -35,7 +35,7 @@ */ public class PathHandler implements HttpHandler { - private final PathMatcher pathMatcher = new PathMatcher<>(); + private final PathMatcher pathMatcher = new PathMatcher(); public PathHandler(final HttpHandler defaultHandler) { pathMatcher.addPrefixPath("/", defaultHandler); @@ -47,7 +47,7 @@ @Override public void handleRequest(HttpServerExchange exchange) throws Exception { final PathMatcher.PathMatch match = pathMatcher.match(exchange.getRelativePath()); - if (match.getValue() == null) { + if(match.getValue() == null) { ResponseCodeHandler.HANDLE_404.handleRequest(exchange); return; } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/PathTemplateHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/PathTemplateHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/PathTemplateHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/PathTemplateHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,27 +1,8 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; import io.undertow.util.AttachmentKey; -import io.undertow.util.PathTemplateMatch; import io.undertow.util.PathTemplateMatcher; import java.util.Map; @@ -36,13 +17,9 @@ private final boolean rewriteQueryParameters; - /** - * @see io.undertow.util.PathTemplateMatch#ATTACHMENT_KEY - */ - @Deprecated public static final AttachmentKey PATH_TEMPLATE_MATCH = AttachmentKey.create(PathTemplateMatch.class); - private final PathTemplateMatcher pathTemplateMatcher = new PathTemplateMatcher<>(); + private final PathTemplateMatcher pathTemplateMatcher = new PathTemplateMatcher(); public PathTemplateHandler(boolean rewriteQueryParameters) { this.rewriteQueryParameters = rewriteQueryParameters; @@ -56,11 +33,11 @@ public void handleRequest(HttpServerExchange exchange) throws Exception { PathTemplateMatcher.PathMatchResult match = pathTemplateMatcher.match(exchange.getRelativePath()); if (match == null) { - ResponseCodeHandler.HANDLE_404.handleRequest(exchange); + exchange.setResponseCode(404); + exchange.endExchange(); return; } exchange.putAttachment(PATH_TEMPLATE_MATCH, new PathTemplateMatch(match.getMatchedTemplate(), match.getParameters())); - exchange.putAttachment(io.undertow.util.PathTemplateMatch.ATTACHMENT_KEY, new io.undertow.util.PathTemplateMatch(match.getMatchedTemplate(), match.getParameters())); if (rewriteQueryParameters) { for (Map.Entry entry : match.getParameters().entrySet()) { exchange.addQueryParam(entry.getKey(), entry.getValue()); @@ -79,10 +56,6 @@ return this; } - /** - * @see io.undertow.util.PathTemplateMatch - */ - @Deprecated public static final class PathTemplateMatch { private final String matchedTemplate; private final Map parameters; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/PeerNameResolvingHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/PeerNameResolvingHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/PeerNameResolvingHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/PeerNameResolvingHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,38 +1,15 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.UndertowLogger; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; -import java.util.Collections; -import java.util.Map; -import java.util.Set; /** * A handler that performs reverse DNS lookup to resolve a peer address @@ -101,45 +78,7 @@ public static enum ResolveType { FORWARD, REVERSE, - FORWARD_AND_REVERSE + FORWARD_AND_REVERSE; } - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "resolve-peer-name"; - } - - @Override - public Map> parameters() { - return Collections.emptyMap(); - } - - @Override - public Set requiredParameters() { - return Collections.emptySet(); - } - - @Override - public String defaultParameter() { - return null; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper(); - } - - } - - private static class Wrapper implements HandlerWrapper { - @Override - public HttpHandler wrap(HttpHandler handler) { - return new PeerNameResolvingHandler(handler); - } - } - - } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/PredicateContextHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/PredicateContextHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/PredicateContextHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/PredicateContextHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.predicate.Predicate; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/PredicateHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/PredicateHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/PredicateHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/PredicateHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.predicate.Predicate; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/ProxyPeerAddressHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/ProxyPeerAddressHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/ProxyPeerAddressHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/ProxyPeerAddressHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,33 +1,11 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.Headers; +import java.net.InetAddress; import java.net.InetSocketAddress; -import java.util.Collections; -import java.util.Map; -import java.util.Set; /** * Handler that sets the peer address to the value of the X-Forwarded-For header. @@ -54,68 +32,16 @@ if (index == -1) { value = forwardedFor; } else { - value = forwardedFor.substring(0, index); + value = forwardedFor.substring(0, index - 1); } + InetAddress address = InetAddress.getByName(value); //we have no way of knowing the port - exchange.setSourceAddress(InetSocketAddress.createUnresolved(value, 0)); + exchange.setSourceAddress(new InetSocketAddress(address, 0)); } String forwardedProto = exchange.getRequestHeaders().getFirst(Headers.X_FORWARDED_PROTO); if (forwardedProto != null) { exchange.setRequestScheme(forwardedProto); } - String forwardedHost = exchange.getRequestHeaders().getFirst(Headers.X_FORWARDED_HOST); - String forwardedPort = exchange.getRequestHeaders().getFirst(Headers.X_FORWARDED_PORT); - if (forwardedHost != null) { - int index = forwardedHost.indexOf(','); - final String value; - if (index == -1) { - value = forwardedHost; - } else { - value = forwardedHost.substring(0, index); - } - int port = 0; - if(forwardedPort != null) { - port = Integer.parseInt(forwardedPort); - } - exchange.setDestinationAddress(InetSocketAddress.createUnresolved(value, port)); - } next.handleRequest(exchange); } - - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "proxy-peer-address"; - } - - @Override - public Map> parameters() { - return Collections.emptyMap(); - } - - @Override - public Set requiredParameters() { - return Collections.emptySet(); - } - - @Override - public String defaultParameter() { - return null; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper(); - } - - } - - private static class Wrapper implements HandlerWrapper { - @Override - public HttpHandler wrap(HttpHandler handler) { - return new ProxyPeerAddressHandler(handler); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/RedirectHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/RedirectHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/RedirectHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/RedirectHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,35 +1,10 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - import io.undertow.attribute.ExchangeAttribute; import io.undertow.attribute.ExchangeAttributeParser; import io.undertow.attribute.ExchangeAttributes; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.Headers; /** @@ -54,63 +29,11 @@ attribute = parser.parse(location); } - public RedirectHandler(ExchangeAttribute attribute) { - this.attribute = attribute; - } - @Override public void handleRequest(final HttpServerExchange exchange) throws Exception { exchange.setResponseCode(302); exchange.getResponseHeaders().put(Headers.LOCATION, attribute.readAttribute(exchange)); exchange.endExchange(); } - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "redirect"; - } - - @Override - public Map> parameters() { - Map> params = new HashMap<>(); - params.put("value", ExchangeAttribute.class); - - return params; - } - - @Override - public Set requiredParameters() { - return Collections.singleton("value"); - } - - @Override - public String defaultParameter() { - return "value"; - } - - @Override - public HandlerWrapper build(Map config) { - - return new Wrapper((ExchangeAttribute)config.get("value")); - } - - } - - private static class Wrapper implements HandlerWrapper { - - private final ExchangeAttribute value; - - private Wrapper(ExchangeAttribute value) { - this.value = value; - } - - @Override - public HttpHandler wrap(HttpHandler handler) { - return new RedirectHandler(value); - } - } - } Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/RequestDumpingHandler.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/RequestDumplingHandler.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/server/handlers/RequestLimit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/RequestLimit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/RequestLimit.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/RequestLimit.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.server.Connectors; @@ -95,7 +77,7 @@ } state = (maximumConcurrentRequests & 0xFFFFFFFFL) << 32; - this.queue = new LinkedBlockingQueue<>(queueSize <= 0 ? Integer.MAX_VALUE : queueSize); + this.queue = new LinkedBlockingQueue(queueSize <= 0 ? Integer.MAX_VALUE : queueSize); } public void handleRequest(final HttpServerExchange exchange, final HttpHandler next) throws Exception { Index: 3rdParty_sources/undertow/io/undertow/server/handlers/RequestLimitingHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/RequestLimitingHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/RequestLimitingHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/RequestLimitingHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,23 +9,17 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; /** * A handler which limits the maximum number of concurrent requests. Requests beyond the limit will @@ -72,8 +66,8 @@ * Construct a new instance. This version takes a {@link RequestLimit} directly which may be shared with other * handlers. * - * @param requestLimit the request limit information. - * @param nextHandler the next handler + * @param requestLimit the request limit information. + * @param nextHandler the next handler */ public RequestLimitingHandler(RequestLimit requestLimit, HttpHandler nextHandler) { if (nextHandler == null) { @@ -90,48 +84,4 @@ public RequestLimit getRequestLimit() { return requestLimit; } - - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "request-limit"; - } - - @Override - public Map> parameters() { - return Collections.>singletonMap("requests", int.class); - } - - @Override - public Set requiredParameters() { - return Collections.singleton("requests"); - } - - @Override - public String defaultParameter() { - return "requests"; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper((Integer) config.get("requests")); - } - - } - - private static class Wrapper implements HandlerWrapper { - - private final int requests; - - private Wrapper(int requests) { - this.requests = requests; - } - - @Override - public HttpHandler wrap(HttpHandler handler) { - return new RequestLimitingHandler(requests, handler); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/ResponseCodeHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/ResponseCodeHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/ResponseCodeHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/ResponseCodeHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; @@ -51,10 +51,6 @@ */ public static final ResponseCodeHandler HANDLE_404 = new ResponseCodeHandler(404); /** - * A handler which sets a 405 code. - */ - public static final ResponseCodeHandler HANDLE_405 = new ResponseCodeHandler(405); - /** * A handler which sets a 406 code. */ public static final ResponseCodeHandler HANDLE_406 = new ResponseCodeHandler(406); Index: 3rdParty_sources/undertow/io/undertow/server/handlers/SSLHeaderHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/SSLHeaderHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/SSLHeaderHandler.java 8 Sep 2014 09:46:47 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/SSLHeaderHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,31 +1,11 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.UndertowLogger; import io.undertow.server.BasicSSLSessionInfo; import io.undertow.server.ExchangeCompletionListener; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; import io.undertow.server.SSLSessionInfo; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.Certificates; import io.undertow.util.HeaderMap; @@ -35,10 +15,6 @@ import static io.undertow.util.Headers.SSL_CLIENT_CERT; import static io.undertow.util.Headers.SSL_SESSION_ID; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - /** * Handler that sets SSL information on the connection based on the following headers: *

@@ -107,42 +83,4 @@ } next.handleRequest(exchange); } - - - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "ssl-headers"; - } - - @Override - public Map> parameters() { - return Collections.emptyMap(); - } - - @Override - public Set requiredParameters() { - return Collections.emptySet(); - } - - @Override - public String defaultParameter() { - return null; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper(); - } - - } - - private static class Wrapper implements HandlerWrapper { - @Override - public HttpHandler wrap(HttpHandler handler) { - return new SSLHeaderHandler(handler); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/SetAttributeHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/SetAttributeHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/SetAttributeHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/SetAttributeHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import io.undertow.attribute.ExchangeAttribute; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/SetHeaderHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/SetHeaderHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/SetHeaderHandler.java 8 Sep 2014 09:46:49 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/SetHeaderHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers; @@ -23,20 +23,18 @@ import io.undertow.util.HttpString; /** - * Set a fixed response header. - * * @author Stuart Douglas */ public class SetHeaderHandler implements HttpHandler { private final HttpString header; private final String value; - private final HttpHandler next; + private volatile HttpHandler next = ResponseCodeHandler.HANDLE_404; + public SetHeaderHandler(final String header, final String value) { - this.next = ResponseCodeHandler.HANDLE_404; - this.value = value; this.header = new HttpString(header); + this.value = value; } public SetHeaderHandler(final HttpHandler next, final String header, final String value) { Index: 3rdParty_sources/undertow/io/undertow/server/handlers/URLDecodingHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/Attic/URLDecodingHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/URLDecodingHandler.java 8 Sep 2014 09:46:48 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/URLDecodingHandler.java 8 Sep 2014 10:52:08 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers; import java.util.ArrayDeque; @@ -58,9 +40,9 @@ exchange.setRelativePath(URLUtils.decode(exchange.getRelativePath(), charset, decodeSlash, sb)); exchange.setResolvedPath(URLUtils.decode(exchange.getResolvedPath(), charset, decodeSlash, sb)); if (!exchange.getQueryString().isEmpty()) { - final TreeMap> newParams = new TreeMap<>(); + final TreeMap> newParams = new TreeMap>(); for (Map.Entry> param : exchange.getQueryParameters().entrySet()) { - final Deque newVales = new ArrayDeque<>(param.getValue().size()); + final Deque newVales = new ArrayDeque(param.getValue().size()); for (String val : param.getValue()) { newVales.add(URLUtils.decode(val, charset, true, sb)); } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/AccessLogHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/Attic/AccessLogHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/AccessLogHandler.java 8 Sep 2014 09:47:09 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/AccessLogHandler.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,36 +1,12 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.accesslog; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - import io.undertow.attribute.ExchangeAttribute; import io.undertow.attribute.ExchangeAttributes; import io.undertow.attribute.SubstituteEmptyWrapper; import io.undertow.server.ExchangeCompletionListener; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; /** * Access log handler. This handler will generate access log messages based on the provided format string, @@ -52,7 +28,8 @@ *

  • %l - Remote logical username from identd (always returns '-') *
  • %m - Request method *
  • %p - Local port - *
  • %q - Query string (excluding the '?' character) + *
  • %q - Query string (prepended with a '?' if it exists, otherwise + * an empty string *
  • %r - First line of the request *
  • %s - HTTP status code of the response *
  • %t - Date and time, in Common Log Format format @@ -135,48 +112,4 @@ '}'; } - - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "access-log"; - } - - @Override - public Map> parameters() { - return Collections.>singletonMap("format", String.class); - } - - @Override - public Set requiredParameters() { - return Collections.singleton("format"); - } - - @Override - public String defaultParameter() { - return "format"; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper((String) config.get("format")); - } - - } - - private static class Wrapper implements HandlerWrapper { - - private final String format; - - private Wrapper(String format) { - this.format = format; - } - - @Override - public HttpHandler wrap(HttpHandler handler) { - return new AccessLogHandler(handler, new JBossLoggingAccessLogReceiver(), format, Wrapper.class.getClassLoader()); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/AccessLogReceiver.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/Attic/AccessLogReceiver.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/AccessLogReceiver.java 8 Sep 2014 09:47:09 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/AccessLogReceiver.java 8 Sep 2014 10:52:22 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.accesslog; /** Index: 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/DefaultAccessLogReceiver.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/Attic/DefaultAccessLogReceiver.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/DefaultAccessLogReceiver.java 8 Sep 2014 09:47:09 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/DefaultAccessLogReceiver.java 8 Sep 2014 10:52:22 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.accesslog; import java.io.BufferedWriter; @@ -82,7 +64,7 @@ this.outputDirectory = outputDirectory; this.logBaseName = logBaseName; this.logNameSuffix = (logNameSuffix != null) ? logNameSuffix : DEFAULT_LOG_SUFFIX; - this.pendingMessages = new ConcurrentLinkedDeque<>(); + this.pendingMessages = new ConcurrentLinkedDeque(); this.defaultLogFile = new File(outputDirectory, logBaseName + this.logNameSuffix); calculateChangeOverPoint(); } @@ -119,7 +101,7 @@ if (forceLogRotation) { doRotate(); } - List messages = new ArrayList<>(); + List messages = new ArrayList(); String msg = null; //only grab at most 1000 messages at a time for (int i = 0; i < 1000; ++i) { @@ -166,7 +148,7 @@ } try { if (writer == null) { - writer = new BufferedWriter(new FileWriter(defaultLogFile, true)); + writer = new BufferedWriter(new FileWriter(defaultLogFile)); } for (String message : messages) { writer.write(message); Index: 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/JBossLoggingAccessLogReceiver.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/Attic/JBossLoggingAccessLogReceiver.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/JBossLoggingAccessLogReceiver.java 8 Sep 2014 09:47:09 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/accesslog/JBossLoggingAccessLogReceiver.java 8 Sep 2014 10:52:22 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.accesslog; import org.jboss.logging.Logger; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/builder/HandlerBuilder.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/builder/Attic/HandlerBuilder.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/builder/HandlerBuilder.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/builder/HandlerBuilder.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.builder; import io.undertow.server.HandlerWrapper; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/builder/HandlerParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/builder/Attic/HandlerParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/builder/HandlerParser.java 8 Sep 2014 09:46:59 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/builder/HandlerParser.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.builder; @@ -64,7 +64,7 @@ private static Map loadBuilders(final ClassLoader classLoader) { ServiceLoader loader = ServiceLoader.load(HandlerBuilder.class, classLoader); - final Map ret = new HashMap<>(); + final Map ret = new HashMap(); for (HandlerBuilder builder : loader) { if (ret.containsKey(builder.name())) { if (ret.get(builder.name()).getClass() != builder.getClass()) { @@ -104,7 +104,7 @@ } Token next = tokens.peek(); if (next.token.equals("[")) { - final Map values = new HashMap<>(); + final Map values = new HashMap(); tokens.poll(); next = tokens.poll(); @@ -198,7 +198,7 @@ } Class componentType = type.getComponentType(); - final List values = new ArrayList<>(); + final List values = new ArrayList(); Token token = tokens.poll(); while (token != null) { Token commaOrEnd = tokens.poll(); @@ -229,7 +229,7 @@ } private static void checkParameters(final String string, int pos, final Map values, final HandlerBuilder builder) { - final Set required = new HashSet<>(builder.requiredParameters()); + final Set required = new HashSet(builder.requiredParameters()); for (String key : values.keySet()) { required.remove(key); } @@ -316,7 +316,7 @@ int pos = 0; StringBuilder current = new StringBuilder(); - Deque ret = new ArrayDeque<>(); + Deque ret = new ArrayDeque(); while (pos < string.length()) { char c = string.charAt(pos); if (currentStringDelim != 0) { Index: 3rdParty_sources/undertow/io/undertow/server/handlers/builder/PredicatedHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/builder/Attic/PredicatedHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/builder/PredicatedHandler.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/builder/PredicatedHandler.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.builder; import io.undertow.predicate.Predicate; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/builder/PredicatedHandlersParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/builder/Attic/PredicatedHandlersParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/builder/PredicatedHandlersParser.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/builder/PredicatedHandlersParser.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,34 +1,15 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.builder; +import io.undertow.UndertowMessages; import io.undertow.predicate.Predicate; import io.undertow.predicate.PredicateParser; import io.undertow.predicate.Predicates; import io.undertow.server.HandlerWrapper; -import io.undertow.util.ChaninedHandlerWrapper; import io.undertow.util.FileUtils; import java.io.File; import java.io.InputStream; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; /** @@ -52,7 +33,7 @@ public static List parse(final String contents, final ClassLoader classLoader) { String[] lines = contents.split("\\n"); - final List wrappers = new ArrayList<>(); + final List wrappers = new ArrayList(); for (String line : lines) { if (line.trim().length() > 0) { @@ -66,12 +47,7 @@ predicate = Predicates.truePredicate(); handler = HandlerParser.parse(parts[0], classLoader); } else { - predicate = PredicateParser.parse(parts[0], classLoader); - HandlerWrapper[] handlers = new HandlerWrapper[parts.length -1]; - for(int i = 0; i < handlers.length; ++i) { - handlers[i] = HandlerParser.parse(parts[i + 1], classLoader); - } - handler = new ChaninedHandlerWrapper(Arrays.asList(handlers)); + throw UndertowMessages.MESSAGES.invalidSyntax(line); } wrappers.add(new PredicatedHandler(predicate, handler)); } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/builder/ResponseCodeHandlerBuilder.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/builder/Attic/ResponseCodeHandlerBuilder.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/builder/ResponseCodeHandlerBuilder.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/builder/ResponseCodeHandlerBuilder.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.builder; import io.undertow.server.HandlerWrapper; @@ -38,14 +20,14 @@ @Override public Map> parameters() { - Map> parameters = new HashMap<>(); + Map> parameters = new HashMap>(); parameters.put("value", Integer.class); return parameters; } @Override public Set requiredParameters() { - final Set req = new HashSet<>(); + final Set req = new HashSet(); req.add("value"); return req; } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/builder/RewriteHandlerBuilder.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/builder/Attic/RewriteHandlerBuilder.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/builder/RewriteHandlerBuilder.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/builder/RewriteHandlerBuilder.java 8 Sep 2014 10:52:13 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.builder; import io.undertow.attribute.ExchangeAttribute; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/builder/SetHandlerBuilder.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/builder/Attic/SetHandlerBuilder.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/builder/SetHandlerBuilder.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/builder/SetHandlerBuilder.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.builder; import io.undertow.attribute.ExchangeAttribute; @@ -39,7 +21,7 @@ @Override public Map> parameters() { - Map> parameters = new HashMap<>(); + Map> parameters = new HashMap>(); parameters.put("value", ExchangeAttribute.class); parameters.put("attribute", ExchangeAttribute.class); @@ -48,7 +30,7 @@ @Override public Set requiredParameters() { - final Set req = new HashSet<>(); + final Set req = new HashSet(); req.add("value"); req.add("attribute"); return req; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/cache/CacheHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/cache/Attic/CacheHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/cache/CacheHandler.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/cache/CacheHandler.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.cache; import io.undertow.Handlers; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/cache/CachedHttpRequest.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/cache/Attic/CachedHttpRequest.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/cache/CachedHttpRequest.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/cache/CachedHttpRequest.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.cache; import java.util.Date; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/cache/DirectBufferCache.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/cache/Attic/DirectBufferCache.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/cache/DirectBufferCache.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/cache/DirectBufferCache.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.cache; @@ -64,7 +64,7 @@ public DirectBufferCache(int sliceSize, int slicesPerPage, int maxMemory, final BufferAllocator bufferAllocator, int maxAge) { this.sliceSize = sliceSize; this.pool = new LimitedBufferSlicePool(bufferAllocator, sliceSize, sliceSize * slicesPerPage, maxMemory / (sliceSize * slicesPerPage)); - this.cache = new ConcurrentHashMap<>(16); + this.cache = new ConcurrentHashMap(16); this.accessQueue = ConcurrentDirectDeque.newInstance(); this.maxAge = maxAge; } @@ -140,7 +140,7 @@ * @return all the keys in this cache */ public Set getAllKeys() { - return new HashSet<>(cache.keySet()); + return new HashSet(cache.keySet()); } private void bumpAccess(CacheEntry cacheEntry) { Index: 3rdParty_sources/undertow/io/undertow/server/handlers/cache/LRUCache.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/cache/Attic/LRUCache.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/cache/LRUCache.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/cache/LRUCache.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.cache; @@ -53,7 +53,7 @@ public LRUCache(int maxEntries, final int maxAge) { this.maxAge = maxAge; - this.cache = new ConcurrentHashMap<>(16); + this.cache = new ConcurrentHashMap>(16); this.accessQueue = ConcurrentDirectDeque.newInstance(); this.maxEntries = maxEntries; } @@ -67,7 +67,7 @@ } else { expires = System.currentTimeMillis() + maxAge; } - value = new CacheEntry<>(key, newValue, expires); + value = new CacheEntry(key, newValue, expires); CacheEntry result = cache.putIfAbsent(key, value); if (result != null) { value = result; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/cache/LimitedBufferSlicePool.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/cache/Attic/LimitedBufferSlicePool.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/cache/LimitedBufferSlicePool.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/cache/LimitedBufferSlicePool.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.cache; @@ -39,7 +39,7 @@ public final class LimitedBufferSlicePool { private static final AtomicIntegerFieldUpdater regionUpdater = AtomicIntegerFieldUpdater.newUpdater(LimitedBufferSlicePool.class, "regionsUsed"); - private final Queue sliceQueue = new ConcurrentLinkedQueue<>(); + private final Queue sliceQueue = new ConcurrentLinkedQueue(); private final BufferAllocator allocator; private final int bufferSize; private final int buffersPerRegion; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/cache/ResponseCache.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/cache/Attic/ResponseCache.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/cache/ResponseCache.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/cache/ResponseCache.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.cache; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/cache/ResponseCachingSender.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/cache/Attic/ResponseCachingSender.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/cache/ResponseCachingSender.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/cache/ResponseCachingSender.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.cache; import java.io.UnsupportedEncodingException; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/cache/ResponseCachingStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/cache/Attic/ResponseCachingStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/cache/ResponseCachingStreamSinkConduit.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/cache/ResponseCachingStreamSinkConduit.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.cache; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/AllowedContentEncodings.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/encoding/Attic/AllowedContentEncodings.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/AllowedContentEncodings.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/AllowedContentEncodings.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.encoding; import java.util.List; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodedResource.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/encoding/Attic/ContentEncodedResource.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodedResource.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodedResource.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.encoding; import io.undertow.server.handlers.resource.Resource; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodedResourceManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/encoding/Attic/ContentEncodedResourceManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodedResourceManager.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodedResourceManager.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.encoding; import io.undertow.UndertowLogger; @@ -58,7 +40,7 @@ private final int maxResourceSize; private final Predicate encodingAllowed; - private final ConcurrentMap fileLocks = new ConcurrentHashMap<>(); + private final ConcurrentMap fileLocks = new ConcurrentHashMap(); public ContentEncodedResourceManager(File encodedResourcesRoot, CachingResourceManager encodedResourceManager, ContentEncodingRepository contentEncodingRepository, int minResourceSize, int maxResourceSize, Predicate encodingAllowed) { this.encodedResourcesRoot = encodedResourcesRoot; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodingProvider.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/encoding/Attic/ContentEncodingProvider.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodingProvider.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodingProvider.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.encoding; import io.undertow.server.ConduitWrapper; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodingRepository.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/encoding/Attic/ContentEncodingRepository.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodingRepository.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/ContentEncodingRepository.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.encoding; import io.undertow.predicate.Predicate; @@ -39,7 +21,7 @@ public static final String IDENTITY = "identity"; - private final Map encodingMap = new CopyOnWriteMap<>(); + private final Map encodingMap = new CopyOnWriteMap(); /** * Gets all allow @@ -51,10 +33,10 @@ if (res == null || res.isEmpty()) { return null; } - final List resultingMappings = new ArrayList<>(); + final List resultingMappings = new ArrayList(); final List> found = QValueParser.parse(res); for (List result : found) { - List available = new ArrayList<>(); + List available = new ArrayList(); boolean includesIdentity = false; boolean isQValue0 = false; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/DeflateEncodingProvider.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/encoding/Attic/DeflateEncodingProvider.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/DeflateEncodingProvider.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/DeflateEncodingProvider.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.encoding; import io.undertow.conduits.DeflatingStreamSinkConduit; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/EncodingHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/encoding/Attic/EncodingHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/EncodingHandler.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/EncodingHandler.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.encoding; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/EncodingMapping.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/encoding/Attic/EncodingMapping.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/EncodingMapping.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/EncodingMapping.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.encoding; import io.undertow.predicate.Predicate; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/GzipEncodingProvider.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/encoding/Attic/GzipEncodingProvider.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/GzipEncodingProvider.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/encoding/GzipEncodingProvider.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.encoding; import io.undertow.conduits.GzipStreamSinkConduit; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/error/FileErrorPageHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/error/Attic/FileErrorPageHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/error/FileErrorPageHandler.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/error/FileErrorPageHandler.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.error; @@ -24,26 +24,22 @@ import java.nio.channels.FileChannel; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; -import java.util.Map; import java.util.Set; -import org.jboss.logging.Logger; -import org.xnio.FileAccess; -import org.xnio.IoUtils; -import org.xnio.channels.Channels; -import org.xnio.channels.StreamSinkChannel; import io.undertow.Handlers; import io.undertow.UndertowLogger; import io.undertow.server.DefaultResponseListener; import io.undertow.server.ExchangeCompletionListener; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; import io.undertow.server.handlers.ResponseCodeHandler; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.util.Headers; +import org.jboss.logging.Logger; +import org.xnio.FileAccess; +import org.xnio.IoUtils; +import org.xnio.channels.Channels; +import org.xnio.channels.StreamSinkChannel; /** * Handler that serves up a file from disk to serve as an error page. @@ -67,7 +63,7 @@ public FileErrorPageHandler(final File file, final Integer... responseCodes) { this.file = file; - this.responseCodes = new HashSet<>(Arrays.asList(responseCodes)); + this.responseCodes = new HashSet(Arrays.asList(responseCodes)); } @Override @@ -153,13 +149,13 @@ if (responseCodes == null) { this.responseCodes = Collections.emptySet(); } else { - this.responseCodes = new HashSet<>(responseCodes); + this.responseCodes = new HashSet(responseCodes); } return this; } public FileErrorPageHandler setResponseCodes(final Integer... responseCodes) { - this.responseCodes = new HashSet<>(Arrays.asList(responseCodes)); + this.responseCodes = new HashSet(Arrays.asList(responseCodes)); return this; } @@ -171,53 +167,4 @@ this.file = file; return this; } - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "error-file"; - } - - @Override - public Map> parameters() { - Map> params = new HashMap<>(); - params.put("file", String.class); - params.put("response-codes", Integer[].class); - return params; - } - - @Override - public Set requiredParameters() { - return new HashSet<>(Arrays.asList(new String[]{"file", "response-codes"})); - } - - @Override - public String defaultParameter() { - return null; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper((String)config.get("file"), (Integer[]) config.get("response-codes")); - } - - } - - private static class Wrapper implements HandlerWrapper { - - private final String file; - private final Integer[] responseCodes; - - private Wrapper(String file, Integer[] responseCodes) { - this.file = file; - this.responseCodes = responseCodes; - } - - - @Override - public HttpHandler wrap(HttpHandler handler) { - return new FileErrorPageHandler(new File(file), responseCodes); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/error/SimpleErrorPageHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/error/Attic/SimpleErrorPageHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/error/SimpleErrorPageHandler.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/error/SimpleErrorPageHandler.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.error; @@ -91,12 +91,12 @@ } public SimpleErrorPageHandler setResponseCodes(final Set responseCodes) { - this.responseCodes = new HashSet<>(responseCodes); + this.responseCodes = new HashSet(responseCodes); return this; } public SimpleErrorPageHandler setResponseCodes(final Integer... responseCodes) { - this.responseCodes = new HashSet<>(Arrays.asList(responseCodes)); + this.responseCodes = new HashSet(Arrays.asList(responseCodes)); return this; } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/form/EagerFormParsingHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/form/Attic/EagerFormParsingHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/form/EagerFormParsingHandler.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/form/EagerFormParsingHandler.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.form; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormData.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/form/Attic/FormData.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormData.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormData.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.form; @@ -35,7 +35,7 @@ */ public final class FormData implements Iterable { - private final Map> values = new LinkedHashMap<>(); + private final Map> values = new LinkedHashMap>(); private final int maxValues; private int valueCount = 0; @@ -70,7 +70,7 @@ public void add(String name, String value, final HeaderMap headers) { Deque values = this.values.get(name); if (values == null) { - this.values.put(name, values = new ArrayDeque<>(1)); + this.values.put(name, values = new ArrayDeque(1)); } values.add(new FormValueImpl(value, headers)); if (++valueCount > maxValues) { @@ -81,7 +81,7 @@ public void add(String name, File value, String fileName, final HeaderMap headers) { Deque values = this.values.get(name); if (values == null) { - this.values.put(name, values = new ArrayDeque<>(1)); + this.values.put(name, values = new ArrayDeque(1)); } values.add(new FormValueImpl(value, fileName, headers)); if (values.size() > maxValues) { @@ -93,7 +93,7 @@ } public void put(String name, String value, final HeaderMap headers) { - Deque values = new ArrayDeque<>(1); + Deque values = new ArrayDeque(1); Deque old = this.values.put(name, values); if (old != null) { valueCount -= old.size(); Index: 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormDataParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/form/Attic/FormDataParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormDataParser.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormDataParser.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.form; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormEncodedDataDefinition.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/form/Attic/FormEncodedDataDefinition.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormEncodedDataDefinition.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormEncodedDataDefinition.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.form; @@ -25,10 +25,10 @@ import io.undertow.UndertowLogger; import io.undertow.UndertowMessages; import io.undertow.UndertowOptions; +import io.undertow.server.Connectors; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; import io.undertow.util.Headers; -import io.undertow.util.SameThreadExecutor; import org.xnio.ChannelListener; import org.xnio.IoUtils; import org.xnio.Pooled; @@ -45,15 +45,14 @@ public static final String APPLICATION_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; private String defaultEncoding = "ISO-8859-1"; - private boolean forceCreation = false; //if the parser should be created even if the correct headers are missing public FormEncodedDataDefinition() { } @Override public FormDataParser create(final HttpServerExchange exchange) { String mimeType = exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE); - if (forceCreation || (mimeType != null && mimeType.startsWith(APPLICATION_X_WWW_FORM_URLENCODED))) { + if (mimeType != null && mimeType.startsWith(APPLICATION_X_WWW_FORM_URLENCODED)) { String charset = defaultEncoding; String contentType = exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE); @@ -72,15 +71,6 @@ return defaultEncoding; } - public boolean isForceCreation() { - return forceCreation; - } - - public FormEncodedDataDefinition setForceCreation(boolean forceCreation) { - this.forceCreation = forceCreation; - return this; - } - public FormEncodedDataDefinition setDefaultEncoding(final String defaultEncoding) { this.defaultEncoding = defaultEncoding; return this; @@ -113,7 +103,7 @@ try { doParse(channel); if (state == 4) { - exchange.dispatch(SameThreadExecutor.INSTANCE, handler); + Connectors.executeRootHandler(handler, exchange); } } catch (IOException e) { IoUtils.safeClose(channel); @@ -129,7 +119,6 @@ try { final ByteBuffer buffer = pooled.getResource(); do { - buffer.clear(); c = channel.read(buffer); if (c > 0) { buffer.flip(); @@ -141,10 +130,6 @@ name = builder.toString(); builder.setLength(0); state = 2; - } else if (n == '&') { - data.add(builder.toString(), ""); - builder.setLength(0); - state = 0; } else if (n == '%' || n == '+') { state = 1; builder.append((char) n); @@ -158,10 +143,6 @@ name = URLDecoder.decode(builder.toString(), charset); builder.setLength(0); state = 2; - } else if (n == '&') { - data.add(URLDecoder.decode(builder.toString(), charset), ""); - builder.setLength(0); - state = 0; } else { builder.append((char) n); } @@ -199,12 +180,6 @@ data.add(name, builder.toString()); } else if (state == 3) { data.add(name, URLDecoder.decode(builder.toString(), charset)); - } else if(builder.length() > 0) { - if(state == 1) { - data.add(URLDecoder.decode(builder.toString(), charset), ""); - } else { - data.add(builder.toString(), ""); - } } state = 4; exchange.putAttachment(FORM_DATA, data); @@ -231,7 +206,7 @@ channel.getReadSetter().set(this); channel.resumeReads(); } else { - exchange.dispatch(SameThreadExecutor.INSTANCE, handler); + Connectors.executeRootHandler(handler, exchange); } } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormParserFactory.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/form/Attic/FormParserFactory.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormParserFactory.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/form/FormParserFactory.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.form; import java.util.ArrayList; @@ -83,7 +65,7 @@ public static class Builder { - private List parsers = new ArrayList<>(); + private List parsers = new ArrayList(); public Builder addParser(final ParserDefinition definition) { parsers.add(definition); Index: 3rdParty_sources/undertow/io/undertow/server/handlers/form/MultiPartParserDefinition.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/form/Attic/MultiPartParserDefinition.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/form/MultiPartParserDefinition.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/form/MultiPartParserDefinition.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,41 +9,43 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.form; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; +import java.nio.channels.FileChannel; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Executor; + import io.undertow.UndertowLogger; import io.undertow.UndertowMessages; import io.undertow.UndertowOptions; +import io.undertow.server.Connectors; import io.undertow.server.ExchangeCompletionListener; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; import io.undertow.util.HeaderMap; import io.undertow.util.Headers; import io.undertow.util.MalformedMessageException; import io.undertow.util.MultipartParser; -import io.undertow.util.SameThreadExecutor; import org.xnio.FileAccess; import org.xnio.IoUtils; +import org.xnio.Pooled; +import org.xnio.channels.StreamSourceChannel; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.nio.channels.FileChannel; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Executor; - /** + * * @author Stuart Douglas */ public class MultiPartParserDefinition implements FormParserFactory.ParserDefinition { @@ -71,11 +73,11 @@ String mimeType = exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE); if (mimeType != null && mimeType.startsWith(MULTIPART_FORM_DATA)) { String boundary = Headers.extractTokenFromHeader(mimeType, "boundary"); - if (boundary == null) { + if(boundary == null) { UndertowLogger.REQUEST_LOGGER.debugf("Could not find boundary in multipart request with ContentType: %s, multipart data will not be available", mimeType); return null; } - final MultiPartUploadHandler parser = new MultiPartUploadHandler(exchange, boundary, maxIndividualFileSize, defaultEncoding); + final MultiPartUploadHandler parser = new MultiPartUploadHandler(exchange, boundary, maxIndividualFileSize, defaultEncoding); exchange.addExchangeCompleteListener(new ExchangeCompletionListener() { @Override public void exchangeEvent(final HttpServerExchange exchange, final NextListener nextListener) { @@ -129,7 +131,7 @@ private final HttpServerExchange exchange; private final FormData data; private final String boundary; - private final List createdFiles = new ArrayList<>(); + private final List createdFiles = new ArrayList(); private final long maxIndividualFileSize; private String defaultEncoding; @@ -176,27 +178,29 @@ } final MultipartParser.ParseState parser = MultipartParser.beginParse(exchange.getConnection().getBufferPool(), this, boundary.getBytes(), exchange.getRequestCharset()); - InputStream inputStream = exchange.getInputStream(); - if (inputStream == null) { + StreamSourceChannel requestChannel = exchange.getRequestChannel(); + if (requestChannel == null) { throw new IOException(UndertowMessages.MESSAGES.requestChannelAlreadyProvided()); } - byte[] buf = new byte[1024]; + final Pooled resource = exchange.getConnection().getBufferPool().allocate(); + final ByteBuffer buf = resource.getResource(); try { - while (true) { - int c = inputStream.read(buf); + while (!parser.isComplete()) { + buf.clear(); + requestChannel.awaitReadable(); + int c = requestChannel.read(buf); + buf.flip(); if (c == -1) { - if (parser.isComplete()) { - break; - } else { - throw UndertowMessages.MESSAGES.connectionTerminatedReadingMultiPartData(); - } + throw UndertowMessages.MESSAGES.connectionTerminatedReadingMultiPartData(); } else if (c != 0) { - parser.parse(ByteBuffer.wrap(buf, 0, c)); + parser.parse(buf); } } exchange.putAttachment(FORM_DATA, data); } catch (MalformedMessageException e) { throw new IOException(e); + } finally { + resource.free(); } return exchange.getAttachment(FORM_DATA); } @@ -205,7 +209,7 @@ public void run() { try { parseBlocking(); - exchange.dispatch(SameThreadExecutor.INSTANCE, handler); + Connectors.executeRootHandler(handler, exchange); } catch (Throwable e) { UndertowLogger.REQUEST_LOGGER.debug("Exception parsing data", e); exchange.setResponseCode(500); @@ -238,7 +242,7 @@ @Override public void data(final ByteBuffer buffer) throws IOException { this.currentFileSize += buffer.remaining(); - if (this.maxIndividualFileSize > 0 && this.currentFileSize > this.maxIndividualFileSize) { + if(this.maxIndividualFileSize > 0 && this.currentFileSize > this.maxIndividualFileSize) { throw UndertowMessages.MESSAGES.maxFileSizeExceeded(this.maxIndividualFileSize); } if (file == null) { @@ -290,7 +294,7 @@ @Override public void close() throws IOException { //we have to dispatch this, as it may result in file IO - final List files = new ArrayList<>(getCreatedFiles()); + final List files = new ArrayList(getCreatedFiles()); exchange.getConnection().getWorker().execute(new Runnable() { @Override public void run() { Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ConnectionPoolErrorHandler.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ConnectionPoolManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/ConnectionPoolManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ConnectionPoolManager.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ConnectionPoolManager.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,34 +1,38 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.proxy; +import io.undertow.server.HttpServerExchange; + /** * Manager that controls the behaviour of a {@link ProxyConnectionPool} * * @author Stuart Douglas */ -public interface ConnectionPoolManager extends ProxyConnectionPoolConfig, ConnectionPoolErrorHandler { +public interface ConnectionPoolManager { /** + * Returns true if the connection pool can create a new connection * + * @param connections The number of connections associated with the current IO thread. + * @param proxyConnectionPool The connection pool + * @return true if a connection can be created + */ + boolean canCreateConnection(int connections, ProxyConnectionPool proxyConnectionPool); + + /** + * This is invoked when the target thread pool transitions to problem status. It will be called once for each queued request + * that has not yet been allocated a connection. The manager can redistribute these requests to other hosts, or can end the + * exchange with an error status. + * + * @param proxyTarget The proxy target + * @param exchange The exchange + * @param callback The callback + * @param timeoutMills The remaining timeout in milliseconds, or -1 if no timeout has been specified + */ + void queuedConnectionFailed(ProxyClient.ProxyTarget proxyTarget, HttpServerExchange exchange, ProxyCallback callback, long timeoutMills); + + /** + * * @return The amount of time that we should wait before re-testing a problem server */ int getProblemServerRetry(); - } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ExclusivityChecker.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/ExclusivityChecker.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ExclusivityChecker.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ExclusivityChecker.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.proxy; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/HostTable.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/HostTable.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/HostTable.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/HostTable.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.proxy; import io.undertow.UndertowMessages; @@ -37,8 +19,8 @@ */ public class HostTable { - private final Map> hosts = new CopyOnWriteMap<>(); - private final Map>> targets = new CopyOnWriteMap<>(); + private final Map> hosts = new CopyOnWriteMap>(); + private final Map>> targets = new CopyOnWriteMap>>(); public synchronized HostTable addHost(H host) { if(hosts.containsKey(host)) { @@ -64,12 +46,12 @@ hostData.add(new Target(virtualHost, contextPath)); PathMatcher> paths = targets.get(virtualHost); if(paths == null) { - paths = new PathMatcher<>(); + paths = new PathMatcher>(); targets.put(virtualHost, paths); } Set hostSet = paths.getPrefixPath(contextPath); if(hostSet == null) { - hostSet = new CopyOnWriteArraySet<>(); + hostSet = new CopyOnWriteArraySet(); paths.addPrefixPath(contextPath, hostSet); } hostSet.add(host); Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/LoadBalancingProxyClient.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/LoadBalancingProxyClient.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/LoadBalancingProxyClient.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/LoadBalancingProxyClient.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.proxy; import io.undertow.UndertowLogger; @@ -26,18 +8,17 @@ import io.undertow.server.handlers.Cookie; import io.undertow.util.AttachmentKey; import io.undertow.util.CopyOnWriteMap; -import org.xnio.OptionMap; -import org.xnio.ssl.XnioSsl; -import java.net.InetSocketAddress; import java.net.URI; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import static io.undertow.server.handlers.proxy.ProxyConnectionPool.AvailabilityType.*; +import static io.undertow.server.handlers.proxy.ProxyConnectionPool.AvailabilityType.AVAILABLE; +import static io.undertow.server.handlers.proxy.ProxyConnectionPool.AvailabilityType.FULL; +import static io.undertow.server.handlers.proxy.ProxyConnectionPool.AvailabilityType.PROBLEM; import static org.xnio.IoUtils.safeClose; /** @@ -62,7 +43,7 @@ */ private volatile int problemServerRetry = 10; - private final Set sessionCookieNames = new CopyOnWriteArraySet<>(); + private final Set sessionCookieNames = new CopyOnWriteArraySet(); /** * The number of connections to create per thread @@ -77,13 +58,30 @@ private final AtomicInteger currentHost = new AtomicInteger(0); private final UndertowClient client; - private final Map routes = new CopyOnWriteMap<>(); + private final Map routes = new CopyOnWriteMap(); private final ExclusivityChecker exclusivityChecker; private static final ProxyTarget PROXY_TARGET = new ProxyTarget() { }; + private final ConnectionPoolManager manager = new ConnectionPoolManager() { + @Override + public boolean canCreateConnection(int connections, ProxyConnectionPool proxyConnectionPool) { + return connections < connectionsPerThread; + } + + @Override + public void queuedConnectionFailed(ProxyTarget proxyTarget, HttpServerExchange exchange, ProxyCallback callback, long timeoutMills) { + getConnection(proxyTarget, exchange, callback, timeoutMills, TimeUnit.MILLISECONDS); + } + + @Override + public int getProblemServerRetry() { + return problemServerRetry; + } + }; + public LoadBalancingProxyClient() { this(UndertowClient.getInstance()); } @@ -131,21 +129,12 @@ } public synchronized LoadBalancingProxyClient addHost(final URI host) { - return addHost(host, null, null); + return addHost(host, null); } - public synchronized LoadBalancingProxyClient addHost(final URI host, XnioSsl ssl) { - return addHost(host, null, ssl); - } - public synchronized LoadBalancingProxyClient addHost(final URI host, String jvmRoute) { - return addHost(host, jvmRoute, null); - } - - - public synchronized LoadBalancingProxyClient addHost(final URI host, String jvmRoute, XnioSsl ssl) { - - Host h = new Host(jvmRoute, null, host, ssl, OptionMap.EMPTY); + ProxyConnectionPool pool = new ProxyConnectionPool(manager, host, client); + Host h = new Host(pool, jvmRoute, host); Host[] existing = hosts; Host[] newHosts = new Host[existing.length + 1]; System.arraycopy(existing, 0, newHosts, 0, existing.length); @@ -157,25 +146,6 @@ return this; } - - public synchronized LoadBalancingProxyClient addHost(final URI host, String jvmRoute, XnioSsl ssl, OptionMap options) { - return addHost(null, host, jvmRoute, ssl, options); - } - - - public synchronized LoadBalancingProxyClient addHost(final InetSocketAddress bindAddress, final URI host, String jvmRoute, XnioSsl ssl, OptionMap options) { - Host h = new Host(jvmRoute, bindAddress, host, ssl, options); - Host[] existing = hosts; - Host[] newHosts = new Host[existing.length + 1]; - System.arraycopy(existing, 0, newHosts, 0, existing.length); - newHosts[existing.length] = h; - this.hosts = newHosts; - if (jvmRoute != null) { - this.routes.put(jvmRoute, h); - } - return this; - } - public synchronized LoadBalancingProxyClient removeHost(final URI uri) { int found = -1; Host[] existing = hosts; @@ -217,14 +187,20 @@ final Host host = selectHost(exchange); if (host == null) { - callback.couldNotResolveBackend(exchange); + callback.failed(exchange); } else { if (holder != null || (exclusivityChecker != null && exclusivityChecker.isExclusivityRequired(exchange))) { // If we have a holder, even if the connection was closed we now exclusivity was already requested so our client // may be assuming it still exists. host.connectionPool.connect(target, exchange, new ProxyCallback() { @Override + public void failed(HttpServerExchange exchange) { + UndertowLogger.PROXY_REQUEST_LOGGER.proxyFailedToConnectToBackend(exchange.getRequestURI(), host.uri); + callback.failed(exchange); + } + + @Override public void completed(HttpServerExchange exchange, ProxyConnection result) { if (holder != null) { holder.connection = result; @@ -246,22 +222,6 @@ } callback.completed(exchange, result); } - - @Override - public void queuedRequestFailed(HttpServerExchange exchange) { - callback.queuedRequestFailed(exchange); - } - - @Override - public void failed(HttpServerExchange exchange) { - UndertowLogger.PROXY_REQUEST_LOGGER.proxyFailedToConnectToBackend(exchange.getRequestURI(), host.uri); - callback.failed(exchange); - } - - @Override - public void couldNotResolveBackend(HttpServerExchange exchange) { - callback.couldNotResolveBackend(exchange); - } }, timeout, timeUnit, true); } else { host.connectionPool.connect(target, exchange, callback, timeout, timeUnit, false); @@ -326,53 +286,16 @@ return null; } - protected final class Host extends ConnectionPoolErrorHandler.SimpleConnectionPoolErrorHandler implements ConnectionPoolManager { + protected static final class Host { final ProxyConnectionPool connectionPool; final String jvmRoute; final URI uri; - final XnioSsl ssl; - private Host(String jvmRoute, InetSocketAddress bindAddress, URI uri, XnioSsl ssl, OptionMap options) { - this.connectionPool = new ProxyConnectionPool(this, bindAddress, uri, ssl, client, options); + private Host(ProxyConnectionPool connectionPool, String jvmRoute, URI uri) { + this.connectionPool = connectionPool; this.jvmRoute = jvmRoute; this.uri = uri; - this.ssl = ssl; } - - // @Override - public void queuedConnectionFailed(ProxyTarget proxyTarget, HttpServerExchange exchange, ProxyCallback callback, long timeoutMills) { - getConnection(proxyTarget, exchange, callback, timeoutMills, TimeUnit.MILLISECONDS); - } - - @Override - public int getProblemServerRetry() { - return problemServerRetry; - } - - @Override - public int getMaxConnections() { - return connectionsPerThread; - } - - @Override - public int getMaxCachedConnections() { - return connectionsPerThread; - } - - @Override - public int getSMaxConnections() { - return connectionsPerThread; - } - - @Override - public long getTtl() { - return -1; - } - - @Override - public int getMaxQueueSize() { - return 0; - } } private static class ExclusiveConnectionHolder { Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyCallback.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/ProxyCallback.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyCallback.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyCallback.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.proxy; import io.undertow.server.HttpServerExchange; @@ -29,27 +11,6 @@ void completed(final HttpServerExchange exchange, T result); - /** - * Callback if establishing the connection to a backend server fails. - * - * @param exchange the http server exchange - */ - void failed(final HttpServerExchange exchange); + void failed(HttpServerExchange exchange); - /** - * Callback if no backend server could be found. - * - * @param exchange the http server exchange - */ - void couldNotResolveBackend(final HttpServerExchange exchange); - - /** - * This is invoked when the target connection pool transitions to problem status. It will be called once for each queued request - * that has not yet been allocated a connection. The manager can redistribute these requests to other hosts, or can end the - * exchange with an error status. - * - * @param exchange The exchange - */ - void queuedRequestFailed(HttpServerExchange exchange); - } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyClient.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/ProxyClient.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyClient.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyClient.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.proxy; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyConnection.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/ProxyConnection.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyConnection.java 8 Sep 2014 09:47:02 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyConnection.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.proxy; import io.undertow.client.ClientConnection; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyConnectionPool.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/ProxyConnectionPool.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyConnectionPool.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyConnectionPool.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,32 +1,5 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.proxy; -import java.io.Closeable; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.URI; -import java.util.ArrayDeque; -import java.util.Deque; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.TimeUnit; - import io.undertow.UndertowLogger; import io.undertow.UndertowMessages; import io.undertow.client.ClientCallback; @@ -40,8 +13,15 @@ import org.xnio.OptionMap; import org.xnio.XnioExecutor; import org.xnio.XnioIoThread; -import org.xnio.ssl.XnioSsl; +import java.io.Closeable; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.TimeUnit; + /** * A pool of connections to a target host. * @@ -51,90 +31,56 @@ * * @author Stuart Douglas */ -public class ProxyConnectionPool implements Closeable { +class ProxyConnectionPool implements Closeable { private final URI uri; - private final InetSocketAddress bindAddress; - - private final XnioSsl ssl; - private final UndertowClient client; private final ConnectionPoolManager connectionPoolManager; - private final OptionMap options; + /** + * flag that is set when a problem is detected with this host. It will be taken out of consideration + * until the flag is cleared. + *

    + * The exception to this is if all flags are marked as problems, in which case it will be tried anyway + */ + private volatile boolean problem; /** * Set to true when the connection pool is closed. */ private volatile boolean closed; - private final int maxConnections; - private final int maxCachedConnections; - private final int sMaxConnections; - private final int maxRequestQueueSize; - private final long ttl; + private final ConcurrentMap hostThreadData = new CopyOnWriteMap(); - private final ConcurrentMap hostThreadData = new CopyOnWriteMap<>(); - - public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, URI uri, UndertowClient client, OptionMap options) { - this(connectionPoolManager, uri, null, client, options); - } - - public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager,InetSocketAddress bindAddress, URI uri, UndertowClient client, OptionMap options) { - this(connectionPoolManager, bindAddress, uri, null, client, options); - } - - public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, URI uri, XnioSsl ssl, UndertowClient client, OptionMap options) { - this(connectionPoolManager, null, uri, ssl, client, options); - } - - public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, InetSocketAddress bindAddress,URI uri, XnioSsl ssl, UndertowClient client, OptionMap options) { + public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, URI uri, UndertowClient client) { this.connectionPoolManager = connectionPoolManager; - this.maxConnections = Math.max(connectionPoolManager.getMaxConnections(), 1); - this.maxCachedConnections = Math.max(connectionPoolManager.getMaxCachedConnections(), 0); - this.sMaxConnections = Math.max(connectionPoolManager.getSMaxConnections(), 0); - this.maxRequestQueueSize = Math.max(connectionPoolManager.getMaxQueueSize(), 0); - this.ttl = connectionPoolManager.getTtl(); - this.bindAddress = bindAddress; this.uri = uri; - this.ssl = ssl; this.client = client; - this.options = options; } public URI getUri() { return uri; } - public InetSocketAddress getBindAddress() { - return bindAddress; - } - public void close() { this.closed = true; - for (HostThreadData data : hostThreadData.values()) { - final ConnectionHolder holder = data.availableConnections.poll(); - if (holder != null) { - IoUtils.safeClose(holder.clientConnection); - } - } } /** * Called when the IO thread has completed a successful request * - * @param connectionHolder The client connection holder + * @param connection The client connection */ - private void returnConnection(final ConnectionHolder connectionHolder) { + private void returnConnection(final ClientConnection connection) { HostThreadData hostData = getData(); if (closed) { //the host has been closed - IoUtils.safeClose(connectionHolder.clientConnection); - ConnectionHolder con = hostData.availableConnections.poll(); + IoUtils.safeClose(connection); + ClientConnection con = hostData.availableConnections.poll(); while (con != null) { - IoUtils.safeClose(con.clientConnection); + IoUtils.safeClose(con); con = hostData.availableConnections.poll(); } redistributeQueued(hostData); @@ -144,7 +90,6 @@ //only do something if the connection is open. If it is closed then //the close setter will handle creating a new connection and decrementing //the connection count - final ClientConnection connection = connectionHolder.clientConnection; if (connection.isOpen() && !connection.isUpgraded()) { CallbackHolder callback = hostData.awaitingConnections.poll(); while (callback != null && callback.isCancelled()) { @@ -155,38 +100,24 @@ callback.getTimeoutKey().remove(); } // Anything waiting for a connection is not expecting exclusivity. - connectionReady(connectionHolder, callback.getCallback(), callback.getExchange(), false); + connectionReady(connection, callback.getCallback(), callback.getExchange(), false); } else { - final int cachedConnectionCount = hostData.availableConnections.size(); - if (cachedConnectionCount >= maxCachedConnections) { - // Close the longest idle connection instead of the current one - final ConnectionHolder holder = hostData.availableConnections.poll(); - if (holder != null) { - IoUtils.safeClose(holder.clientConnection); - } - } - hostData.availableConnections.add(connectionHolder); - // If the soft max and ttl are configured - if (sMaxConnections >= 0 && ttl > 0) { - final long currentTime = System.currentTimeMillis(); - connectionHolder.timeout = currentTime + ttl; - timeoutConnections(currentTime, hostData); - } + hostData.availableConnections.add(connection); } } else if (connection.isOpen() && connection.isUpgraded()) { //we treat upgraded connections as closed //as we do not want the connection pool filled with upgraded connections //if the connection is actually closed the close setter will handle it connection.getCloseSetter().set(null); - handleClosedConnection(hostData, connectionHolder); + handleClosedConnection(hostData, connection); } } - private void handleClosedConnection(HostThreadData hostData, final ConnectionHolder connection) { + private void handleClosedConnection(HostThreadData hostData, final ClientConnection connection) { int connections = --hostData.connections; hostData.availableConnections.remove(connection); - if (connections < maxConnections) { + if (connectionPoolManager.canCreateConnection(connections, this)) { CallbackHolder task = hostData.awaitingConnections.poll(); while (task != null && task.isCancelled()) { task = hostData.awaitingConnections.poll(); @@ -198,37 +129,35 @@ } private void openConnection(final HttpServerExchange exchange, final ProxyCallback callback, final HostThreadData data, final boolean exclusive) { - if (!exclusive) { + if (exclusive == false) { data.connections++; } client.connect(new ClientCallback() { @Override public void completed(final ClientConnection result) { - final ConnectionHolder connectionHolder = new ConnectionHolder(result); - if (!exclusive) { + problem = false; + if (exclusive == false) { result.getCloseSetter().set(new ChannelListener() { @Override public void handleEvent(ClientConnection channel) { - handleClosedConnection(data, connectionHolder); + handleClosedConnection(data, channel); } }); } - connectionReady(connectionHolder, callback, exchange, exclusive); + connectionReady(result, callback, exchange, exclusive); } @Override public void failed(IOException e) { - if (!exclusive) { + if (exclusive == false) { data.connections--; } - UndertowLogger.REQUEST_LOGGER.debug("Failed to connect", e); - if (!connectionPoolManager.handleError()) { - redistributeQueued(getData()); - scheduleFailedHostRetry(exchange); - } + problem = true; + redistributeQueued(getData()); + scheduleFailedHostRetry(exchange); callback.failed(exchange); } - }, bindAddress, getUri(), exchange.getIoThread(), ssl, exchange.getConnection().getBufferPool(), options); + }, getUri(), exchange.getIoThread(), exchange.getConnection().getBufferPool(), OptionMap.EMPTY); } private void redistributeQueued(HostThreadData hostData) { @@ -242,44 +171,42 @@ if (callback.getExpireTime() > 0 && callback.getExpireTime() < time) { callback.getCallback().failed(callback.getExchange()); } else { - callback.getCallback().queuedRequestFailed(callback.getExchange()); + connectionPoolManager.queuedConnectionFailed(callback.getProxyTarget(), callback.getExchange(), callback.getCallback(), callback.getExpireTime() > 0 ? time - callback.getExpireTime() : -1); + callback.getCallback().failed(callback.getExchange()); } } callback = hostData.awaitingConnections.poll(); } } - private void connectionReady(final ConnectionHolder result, final ProxyCallback callback, final HttpServerExchange exchange, final boolean exclusive) { + private void connectionReady(final ClientConnection result, final ProxyCallback callback, final HttpServerExchange exchange, final boolean exclusive) { exchange.addExchangeCompleteListener(new ExchangeCompletionListener() { @Override public void exchangeEvent(HttpServerExchange exchange, NextListener nextListener) { - if (!exclusive) { + if (exclusive == false) { returnConnection(result); } nextListener.proceed(); } }); - callback.completed(exchange, new ProxyConnection(result.clientConnection, uri.getPath() == null ? "/" : uri.getPath())); + callback.completed(exchange, new ProxyConnection(result, uri.getPath() == null ? "/" : uri.getPath())); } public AvailabilityType available() { if (closed) { return AvailabilityType.CLOSED; } - if (!connectionPoolManager.isAvailable()) { + if (problem) { return AvailabilityType.PROBLEM; } HostThreadData data = getData(); - if (data.connections < maxConnections) { + if (connectionPoolManager.canCreateConnection(data.connections, this)) { return AvailabilityType.AVAILABLE; } if (!data.availableConnections.isEmpty()) { return AvailabilityType.AVAILABLE; } - if (data.awaitingConnections.size() >= maxConnections) { - return AvailabilityType.FULL_QUEUE; - } return AvailabilityType.FULL; } @@ -289,93 +216,30 @@ * @param exchange The server exchange */ private void scheduleFailedHostRetry(final HttpServerExchange exchange) { - final int retry = connectionPoolManager.getProblemServerRetry(); - // only schedule a retry task if the node is not available - if (retry > 0 && !connectionPoolManager.isAvailable()) { - exchange.getIoThread().executeAfter(new Runnable() { - @Override - public void run() { - if (closed) { - return; - } - - UndertowLogger.PROXY_REQUEST_LOGGER.debugf("Attempting to reconnect to failed host %s", getUri()); - client.connect(new ClientCallback() { - @Override - public void completed(ClientConnection result) { - UndertowLogger.PROXY_REQUEST_LOGGER.debugf("Connected to previously failed host %s, returning to service", getUri()); - if (connectionPoolManager.clearError()) { - // In case the node is available now, return the connection - final ConnectionHolder connectionHolder = new ConnectionHolder(result); - final HostThreadData data = getData(); - result.getCloseSetter().set(new ChannelListener() { - @Override - public void handleEvent(ClientConnection channel) { - handleClosedConnection(data, connectionHolder); - } - }); - data.connections++; - returnConnection(connectionHolder); - } else { - // Otherwise reschedule the retry task - scheduleFailedHostRetry(exchange); - } - } - - @Override - public void failed(IOException e) { - UndertowLogger.PROXY_REQUEST_LOGGER.debugf("Failed to reconnect to failed host %s", getUri()); - connectionPoolManager.handleError(); - scheduleFailedHostRetry(exchange); - } - }, bindAddress, getUri(), exchange.getIoThread(), ssl, exchange.getConnection().getBufferPool(), options); + exchange.getIoThread().executeAfter(new Runnable() { + @Override + public void run() { + if (closed) { + return; } - }, retry, TimeUnit.SECONDS); - } - } - /** - * Timeout idle connections which are above the soft max cached connections limit. - * - * @param currentTime the current time - * @param data the local host thread data - */ - private void timeoutConnections(final long currentTime, final HostThreadData data) { - int idleConnections = data.availableConnections.size(); - for (;;) { - ConnectionHolder holder; - if (idleConnections > 0 && idleConnections >= sMaxConnections && (holder = data.availableConnections.peek()) != null) { - if (!holder.clientConnection.isOpen()) { - // Already closed connections decrease the available connections - idleConnections--; - } else if (currentTime >= holder.timeout) { - // If the timeout is reached already, just close - holder = data.availableConnections.poll(); - IoUtils.safeClose(holder.clientConnection); - idleConnections--; - } else { - // If the next run is after the connection timeout don't reschedule the task - if (data.timeoutKey == null || data.nextTimeout > holder.timeout) { - if (data.timeoutKey != null) { - data.timeoutKey.remove(); - data.timeoutKey = null; - } - // Schedule a timeout task - final long remaining = holder.timeout - currentTime + 1; - data.nextTimeout = holder.timeout; - data.timeoutKey = holder.clientConnection.getIoThread().executeAfter(data.timeoutTask, remaining, TimeUnit.MILLISECONDS); + UndertowLogger.PROXY_REQUEST_LOGGER.debugf("Attempting to reconnect to failed host %s", getUri()); + client.connect(new ClientCallback() { + @Override + public void completed(ClientConnection result) { + UndertowLogger.PROXY_REQUEST_LOGGER.debugf("Connected to previously failed host %s, returning to service", getUri()); + problem = false; + returnConnection(result); } - return; - } - } else { - // If we are below the soft limit, just cancel the task - if (data.timeoutKey != null) { - data.timeoutKey.remove(); - data.timeoutKey = null; - } - return; + + @Override + public void failed(IOException e) { + UndertowLogger.PROXY_REQUEST_LOGGER.debugf("Failed to reconnect to failed host %s", getUri()); + scheduleFailedHostRetry(exchange); + } + }, getUri(), exchange.getIoThread(), exchange.getConnection().getBufferPool(), OptionMap.EMPTY); } - } + }, connectionPoolManager.getProblemServerRetry(), TimeUnit.SECONDS); } /** @@ -406,23 +270,18 @@ */ public void connect(ProxyClient.ProxyTarget proxyTarget, HttpServerExchange exchange, ProxyCallback callback, final long timeout, final TimeUnit timeUnit, boolean exclusive) { HostThreadData data = getData(); - ConnectionHolder connectionHolder = data.availableConnections.poll(); - while (connectionHolder != null && !connectionHolder.clientConnection.isOpen()) { - connectionHolder = data.availableConnections.poll(); + ClientConnection conn = data.availableConnections.poll(); + while (conn != null && !conn.isOpen()) { + conn = data.availableConnections.poll(); } - if (connectionHolder != null) { + if (conn != null) { if (exclusive) { data.connections--; } - connectionReady(connectionHolder, callback, exchange, exclusive); - } else if (exclusive || data.connections < maxConnections) { + connectionReady(conn, callback, exchange, exclusive); + } else if (exclusive || connectionPoolManager.canCreateConnection(data.connections, this)) { openConnection(exchange, callback, data, exclusive); } else { - // Reject the request directly if we reached the max request queue size - if (data.awaitingConnections.size() >= maxRequestQueueSize) { - callback.queuedRequestFailed(exchange); - return; - } CallbackHolder holder; if (timeout > 0) { long time = System.currentTimeMillis(); @@ -435,36 +294,15 @@ } } - private final class HostThreadData { + private static final class HostThreadData { int connections = 0; - XnioIoThread.Key timeoutKey; - long nextTimeout; + final Deque availableConnections = new ArrayDeque(); + final Deque awaitingConnections = new ArrayDeque(); - final Deque availableConnections = new ArrayDeque<>(); - final Deque awaitingConnections = new ArrayDeque<>(); - final Runnable timeoutTask = new Runnable() { - @Override - public void run() { - final long currentTime = System.currentTimeMillis(); - timeoutConnections(currentTime, HostThreadData.this); - } - }; - } - private static final class ConnectionHolder { - private long timeout; - private final ClientConnection clientConnection; - - private ConnectionHolder(ClientConnection clientConnection) { - this.clientConnection = clientConnection; - } - - } - - private static final class CallbackHolder implements Runnable { final ProxyClient.ProxyTarget proxyTarget; final ProxyCallback callback; @@ -515,7 +353,7 @@ } } - public enum AvailabilityType { + enum AvailabilityType { /** * The host is read to accept requests */ @@ -530,10 +368,6 @@ */ FULL, /** - * All connections are in use and the queue is full. Requests will be rejected. - */ - FULL_QUEUE, - /** * The host is probably down, only try as a last resort */ PROBLEM, @@ -542,5 +376,4 @@ */ CLOSED; } - } Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyConnectionPoolConfig.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/ProxyHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyHandler.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/ProxyHandler.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,34 +9,15 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.proxy; -import javax.net.ssl.SSLPeerUnverifiedException; -import javax.security.cert.CertificateEncodingException; -import javax.security.cert.X509Certificate; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URLEncoder; -import java.nio.channels.Channel; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Deque; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; - import io.undertow.UndertowLogger; import io.undertow.attribute.ExchangeAttribute; import io.undertow.attribute.ExchangeAttributes; @@ -50,13 +31,11 @@ import io.undertow.io.IoCallback; import io.undertow.io.Sender; import io.undertow.server.ExchangeCompletionListener; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; import io.undertow.server.HttpUpgradeListener; import io.undertow.server.RenegotiationRequiredException; import io.undertow.server.SSLSessionInfo; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.server.protocol.http.HttpAttachments; import io.undertow.server.protocol.http.HttpContinue; import io.undertow.util.Attachable; @@ -77,6 +56,19 @@ import org.xnio.XnioExecutor; import org.xnio.channels.StreamSinkChannel; +import javax.net.ssl.SSLPeerUnverifiedException; +import javax.security.cert.CertificateEncodingException; +import javax.security.cert.X509Certificate; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.net.URLEncoder; +import java.nio.channels.Channel; +import java.util.Deque; +import java.util.Map; +import java.util.concurrent.TimeUnit; + /** * An HTTP handler which proxies content to a remote server. *

    @@ -99,39 +91,26 @@ private static final AttachmentKey EXCHANGE = AttachmentKey.create(HttpServerExchange.class); private static final AttachmentKey TIMEOUT_KEY = AttachmentKey.create(XnioExecutor.Key.class); + private final ProxyClientHandler proxyClientHandler = new ProxyClientHandler(); + /** * Map of additional headers to add to the request. */ - private final Map requestHeaders = new CopyOnWriteMap<>(); + private final Map requestHeaders = new CopyOnWriteMap(); private final HttpHandler next; - private final boolean rewriteHostHeader; - private final boolean reuseXForwarded; - public ProxyHandler(ProxyClient proxyClient, int maxRequestTime, HttpHandler next) { - this(proxyClient, maxRequestTime, next, false, false); - } - - /** - * - * @param proxyClient the client to use to make the proxy call - * @param maxRequestTime the maximum amount of time to allow the request to be processed - * @param next the next handler in line - * @param rewriteHostHeader should the HOST header be rewritten to use the target host of the call. - * @param reuseXForwarded should any existing X-Forwarded-For header be used or should it be overwritten. - */ - public ProxyHandler(ProxyClient proxyClient, int maxRequestTime, HttpHandler next, boolean rewriteHostHeader, boolean reuseXForwarded) { this.proxyClient = proxyClient; this.maxRequestTime = maxRequestTime; this.next = next; - this.rewriteHostHeader = rewriteHostHeader; - this.reuseXForwarded = reuseXForwarded; } public ProxyHandler(ProxyClient proxyClient, HttpHandler next) { - this(proxyClient, -1, next); + this.proxyClient = proxyClient; + this.next = next; + this.maxRequestTime = -1; } public void handleRequest(final HttpServerExchange exchange) throws Exception { @@ -141,13 +120,22 @@ next.handleRequest(exchange); return; } - final long timeout = maxRequestTime > 0 ? System.currentTimeMillis() + maxRequestTime : 0; - final ProxyClientHandler clientHandler = new ProxyClientHandler(exchange, target, timeout, 1); - if (timeout > 0) { + if (maxRequestTime > 0) { final XnioExecutor.Key key = exchange.getIoThread().executeAfter(new Runnable() { @Override public void run() { - clientHandler.cancel(exchange); + + UndertowLogger.REQUEST_LOGGER.timingOutRequest(exchange.getRequestURI()); + + ProxyConnection connectionAttachment = exchange.getAttachment(CONNECTION); + if (connectionAttachment != null) { + //we rely on the close listener to end the exchange + ClientConnection clientConnection = connectionAttachment.getConnection(); + IoUtils.safeClose(clientConnection); + } else { + exchange.setResponseCode(503); + exchange.endExchange(); + } } }, maxRequestTime, TimeUnit.MILLISECONDS); exchange.putAttachment(TIMEOUT_KEY, key); @@ -159,7 +147,13 @@ } }); } - exchange.dispatch(exchange.isInIoThread() ? SameThreadExecutor.INSTANCE : exchange.getIoThread(), clientHandler); + exchange.dispatch(SameThreadExecutor.INSTANCE, new Runnable() { + @Override + public void run() { + log.debugf("Proxying request %s, opening connection", exchange.getRequestURL()); + proxyClient.getConnection(target, exchange, proxyClientHandler, -1, TimeUnit.MILLISECONDS); + } + }); } /** @@ -179,8 +173,8 @@ * Adds a request header to the outgoing request. If the header resolves to null or an empty string * it will not be added, however any existing header with the same name will be removed. * - * @param header The header name - * @param value The header value attribute. + * @param header The header name + * @param value The header value attribute. * @return this */ public ProxyHandler addRequestHeader(final HttpString header, final String value) { @@ -230,99 +224,35 @@ return proxyClient; } - private final class ProxyClientHandler implements ProxyCallback, Runnable { + private final class ProxyClientHandler implements ProxyCallback { - private int tries; - - private final long timeout; - private final int maxAttempts; - private final HttpServerExchange exchange; - private ProxyClient.ProxyTarget target; - - ProxyClientHandler(HttpServerExchange exchange, ProxyClient.ProxyTarget target, long timeout, int maxAttempts) { - this.exchange = exchange; - this.timeout = timeout; - this.maxAttempts = maxAttempts; - this.target = target; - } - @Override - public void run() { - proxyClient.getConnection(target, exchange, this, -1, TimeUnit.MILLISECONDS); + public void completed(HttpServerExchange exchange, ProxyConnection result) { + exchange.putAttachment(CONNECTION, result); + exchange.dispatch(SameThreadExecutor.INSTANCE, new ProxyAction(result, exchange, requestHeaders)); } @Override - public void completed(final HttpServerExchange exchange, final ProxyConnection connection) { - exchange.putAttachment(CONNECTION, connection); - exchange.dispatch(SameThreadExecutor.INSTANCE, new ProxyAction(connection, exchange, requestHeaders, rewriteHostHeader, reuseXForwarded)); - } - - @Override - public void failed(final HttpServerExchange exchange) { - final long time = System.currentTimeMillis(); - if (timeout > 0 && timeout > time) { - cancel(exchange); - } else if (tries++ < maxAttempts) { - target = proxyClient.findTarget(exchange); - if (target != null) { - final long remaining = timeout > 0 ? timeout - time : -1; - proxyClient.getConnection(target, exchange, this, remaining, TimeUnit.MILLISECONDS); - } else { - couldNotResolveBackend(exchange); // The context was registered when we started, so return 503 - } - } else { - couldNotResolveBackend(exchange); - } - } - - @Override - public void queuedRequestFailed(HttpServerExchange exchange) { - failed(exchange); - } - - @Override - public void couldNotResolveBackend(HttpServerExchange exchange) { - if (exchange.isResponseStarted()) { - IoUtils.safeClose(exchange.getConnection()); - } else { + public void failed(HttpServerExchange exchange) { + UndertowLogger.PROXY_REQUEST_LOGGER.proxyRequestFailedToResolveBackend(exchange.getRequestURI()); + if (!exchange.isResponseStarted()) { exchange.setResponseCode(503); exchange.endExchange(); - } - } - - void cancel(final HttpServerExchange exchange) { - final ProxyConnection connectionAttachment = exchange.getAttachment(CONNECTION); - if (connectionAttachment != null) { - ClientConnection clientConnection = connectionAttachment.getConnection(); - UndertowLogger.REQUEST_LOGGER.timingOutRequest(clientConnection.getPeerAddress() + "" + exchange.getRequestURI()); - IoUtils.safeClose(clientConnection); } else { - UndertowLogger.REQUEST_LOGGER.timingOutRequest(exchange.getRequestURI()); - } - if (exchange.isResponseStarted()) { IoUtils.safeClose(exchange.getConnection()); - } else { - exchange.setResponseCode(503); - exchange.endExchange(); } } - } private static class ProxyAction implements Runnable { private final ProxyConnection clientConnection; private final HttpServerExchange exchange; private final Map requestHeaders; - private final boolean rewriteHostHeader; - private final boolean reuseXForwarded; - public ProxyAction(final ProxyConnection clientConnection, final HttpServerExchange exchange, Map requestHeaders, - boolean rewriteHostHeader, boolean reuseXForwarded) { + public ProxyAction(final ProxyConnection clientConnection, final HttpServerExchange exchange, Map requestHeaders) { this.clientConnection = clientConnection; this.exchange = exchange; this.requestHeaders = requestHeaders; - this.rewriteHostHeader = rewriteHostHeader; - this.reuseXForwarded = reuseXForwarded; } @Override @@ -376,7 +306,7 @@ final HeaderMap outboundRequestHeaders = request.getRequestHeaders(); copyHeaders(outboundRequestHeaders, inboundRequestHeaders); - if (!exchange.isPersistent()) { + if(!exchange.isPersistent()) { //just because the client side is non-persistent //we don't want to close the connection to the backend outboundRequestHeaders.put(Headers.CONNECTION, "keep-alive"); @@ -390,43 +320,18 @@ outboundRequestHeaders.put(entry.getKey(), headerValue.replace('\n', ' ')); } } + SocketAddress address = exchange.getConnection().getPeerAddress(); + if (address instanceof InetSocketAddress) { + outboundRequestHeaders.put(Headers.X_FORWARDED_FOR, ((InetSocketAddress) address).getHostString()); + } else { + outboundRequestHeaders.put(Headers.X_FORWARDED_FOR, "localhost"); + } + outboundRequestHeaders.put(Headers.X_FORWARDED_PROTO, exchange.getRequestScheme()); - final SocketAddress address = exchange.getConnection().getPeerAddress(); - final String remoteHost = (address != null && address instanceof InetSocketAddress) ? ((InetSocketAddress) address).getHostString() : "localhost"; - request.putAttachment(ProxiedRequestAttachments.REMOTE_HOST, remoteHost); - - if (reuseXForwarded && request.getRequestHeaders().contains(Headers.X_FORWARDED_FOR)) { - // We have an existing header so we shall simply append the host to the existing list - final String current = request.getRequestHeaders().getFirst(Headers.X_FORWARDED_FOR); - if (current == null || current.isEmpty()) { - // It was empty so just add it - request.getRequestHeaders().put(Headers.X_FORWARDED_FOR, remoteHost); - } - else { - // Add the new entry and reset the existing header - request.getRequestHeaders().put(Headers.X_FORWARDED_FOR, current + "," + remoteHost); - } + if (exchange.getRequestScheme().equals("https")) { + request.putAttachment(ProxiedRequestAttachments.IS_SSL, true); } - else { - // No existing header or not allowed to reuse the header so set it here - request.getRequestHeaders().put(Headers.X_FORWARDED_FOR, remoteHost); - } - // Set the protocol header and attachment - final String proto = exchange.getRequestScheme().equals("https") ? "https" : "http"; - request.getRequestHeaders().put(Headers.X_FORWARDED_PROTO, proto); - request.putAttachment(ProxiedRequestAttachments.IS_SSL, proto.equals("https")); - - // Set the server name - final String hostName = exchange.getHostName(); - request.getRequestHeaders().put(Headers.X_FORWARDED_HOST, hostName); - request.putAttachment(ProxiedRequestAttachments.SERVER_NAME, hostName); - - // Set the port - int port = exchange.getConnection().getLocalAddress(InetSocketAddress.class).getPort(); - request.getRequestHeaders().put(Headers.X_FORWARDED_PORT, port); - request.putAttachment(ProxiedRequestAttachments.SERVER_PORT, port); - SSLSessionInfo sslSessionInfo = exchange.getConnection().getSslSessionInfo(); if (sslSessionInfo != null) { X509Certificate[] peerCertificates; @@ -446,20 +351,14 @@ request.putAttachment(ProxiedRequestAttachments.SSL_SESSION_ID, sslSessionInfo.getSessionId()); } - if(rewriteHostHeader) { - InetSocketAddress targetAddress = clientConnection.getConnection().getPeerAddress(InetSocketAddress.class); - request.getRequestHeaders().put(Headers.HOST, targetAddress.getHostString() + ":" + targetAddress.getPort()); - request.getRequestHeaders().put(Headers.X_FORWARDED_HOST, exchange.getRequestHeaders().getFirst(Headers.HOST)); - } clientConnection.getConnection().sendRequest(request, new ClientCallback() { @Override - public void completed(final ClientExchange result) { + public void completed(ClientExchange result) { result.putAttachment(EXCHANGE, exchange); - boolean requiresContinueResponse = HttpContinue.requiresContinueResponse(exchange); - if (requiresContinueResponse) { + if (HttpContinue.requiresContinueResponse(exchange)) { result.setContinueHandler(new ContinueNotification() { @Override public void handleContinue(final ClientExchange clientExchange) { @@ -476,30 +375,11 @@ }); } }); - } result.setResponseListener(new ResponseCallback(exchange)); - final IoExceptionHandler handler = new IoExceptionHandler(exchange, clientConnection.getConnection()); - if(requiresContinueResponse) { - try { - if(!result.getRequestChannel().flush()) { - result.getRequestChannel().getWriteSetter().set(ChannelListeners.flushingChannelListener(new ChannelListener() { - @Override - public void handleEvent(StreamSinkChannel channel) { - ChannelListeners.initiateTransfer(Long.MAX_VALUE, exchange.getRequestChannel(), result.getRequestChannel(), ChannelListeners.closingChannelListener(), new HTTPTrailerChannelListener(exchange, result), handler, handler, exchange.getConnection().getBufferPool()); - - } - }, handler)); - result.getRequestChannel().resumeWrites(); - return; - } - } catch (IOException e) { - handler.handleException(result.getRequestChannel(), e); - } - } + IoExceptionHandler handler = new IoExceptionHandler(exchange, clientConnection.getConnection()); ChannelListeners.initiateTransfer(Long.MAX_VALUE, exchange.getRequestChannel(), result.getRequestChannel(), ChannelListeners.closingChannelListener(), new HTTPTrailerChannelListener(exchange, result), handler, handler, exchange.getConnection().getBufferPool()); - } @Override @@ -620,7 +500,6 @@ @Override public void handleException(Channel channel, IOException exception) { - IoUtils.safeClose(channel); if (exchange.isResponseStarted()) { IoUtils.safeClose(clientConnection); UndertowLogger.REQUEST_IO_LOGGER.debug("Exception reading from target server", exception); @@ -695,62 +574,4 @@ sb.append(encoded); return sb.toString(); } - - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "reverse-proxy"; - } - - @Override - public Map> parameters() { - return Collections.>singletonMap("hosts", String[].class); - } - - @Override - public Set requiredParameters() { - return Collections.singleton("hosts"); - } - - @Override - public String defaultParameter() { - return "hosts"; - } - - @Override - public HandlerWrapper build(Map config) { - String[] hosts = (String[]) config.get("hosts"); - List uris = new ArrayList<>(); - for(String host : hosts) { - try { - uris.add(new URI(host)); - } catch (URISyntaxException e) { - throw new RuntimeException(e); - } - } - return new Wrapper(uris); - } - - } - - private static class Wrapper implements HandlerWrapper { - - private final List uris; - - private Wrapper(List uris) { - this.uris = uris; - } - - @Override - public HttpHandler wrap(HttpHandler handler) { - - LoadBalancingProxyClient loadBalancingProxyClient = new LoadBalancingProxyClient(); - for(URI url : uris) { - loadBalancingProxyClient.addHost(url); - } - return new ProxyHandler(loadBalancingProxyClient, handler); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/SimpleProxyClientProvider.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/proxy/Attic/SimpleProxyClientProvider.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/SimpleProxyClientProvider.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/proxy/SimpleProxyClientProvider.java 8 Sep 2014 10:52:15 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.proxy; import io.undertow.client.ClientCallback; Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/Balancer.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/Context.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/MCMPAdvertiseTask.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/MCMPConfig.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/MCMPConstants.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/MCMPErrorCode.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/MCMPHandler.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/MCMPInfoUtil.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/MCMPWebManager.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/ModCluster.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/ModClusterContainer.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/ModClusterProxyClient.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/ModClusterProxyTarget.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/Node.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/NodeConfig.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/NodeHealthChecker.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/NodeLbStatus.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/NodePingUtil.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/NodeStats.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/SessionId.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/handlers/proxy/mod_cluster/VirtualHost.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/CachedResource.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/CachedResource.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/CachedResource.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/CachedResource.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.resource; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/CachingResourceManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/CachingResourceManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/CachingResourceManager.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/CachingResourceManager.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.resource; @@ -57,7 +57,7 @@ this.maxFileSize = maxFileSize; this.underlyingResourceManager = underlyingResourceManager; this.dataCache = dataCache; - this.cache = new LRUCache<>(metadataCacheSize, maxAge); + this.cache = new LRUCache(metadataCacheSize, maxAge); this.maxAge = maxAge; if(underlyingResourceManager.isResourceChangeListenerSupported()) { try { Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ClassPathResourceManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/ClassPathResourceManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ClassPathResourceManager.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ClassPathResourceManager.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.resource; import io.undertow.UndertowMessages; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/DirectoryUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/DirectoryUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/DirectoryUtils.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/DirectoryUtils.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.resource; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/FileResource.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/FileResource.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/FileResource.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/FileResource.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.resource; @@ -93,7 +93,7 @@ @Override public List list() { - final List resources = new ArrayList<>(); + final List resources = new ArrayList(); for (String child : file.list()) { resources.add(new FileResource(new File(this.file, child), manager, path)); } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/FileResourceManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/FileResourceManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/FileResourceManager.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/FileResourceManager.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,24 +9,20 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.handlers.resource; import java.io.File; import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.List; -import java.util.TreeSet; import io.undertow.UndertowLogger; import io.undertow.UndertowMessages; @@ -41,7 +37,7 @@ */ public class FileResourceManager implements ResourceManager { - private final List listeners = new ArrayList<>(); + private final List listeners = new ArrayList(); private FileSystemWatcher fileSystemWatcher; @@ -52,35 +48,7 @@ */ private final long transferMinSize; - /** - * Check to validate caseSensitive issues for specific case-insensitive FS. - * @see io.undertow.server.handlers.resource.FileResourceManager#isFileSameCase(java.io.File) - */ - private final boolean caseSensitive; - - /** - * Check to allow follow symbolic links - */ - private final boolean followLinks; - - /** - * Used if followLinks == true. Set of paths valid to follow symbolic links - */ - private final TreeSet safePaths = new TreeSet(); - public FileResourceManager(final File base, long transferMinSize) { - this(base, transferMinSize, true, false, null); - } - - public FileResourceManager(final File base, long transferMinSize, boolean caseSensitive) { - this(base, transferMinSize, caseSensitive, false, null); - } - - public FileResourceManager(final File base, long transferMinSize, boolean followLinks, final String... safePaths) { - this(base, transferMinSize, true, followLinks, safePaths); - } - - public FileResourceManager(final File base, long transferMinSize, boolean caseSensitive, boolean followLinks, final String... safePaths) { if (base == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("base"); } @@ -90,19 +58,7 @@ } this.base = basePath; this.transferMinSize = transferMinSize; - this.caseSensitive = caseSensitive; - this.followLinks = followLinks; - if (this.followLinks) { - if (safePaths == null) { - throw UndertowMessages.MESSAGES.argumentCannotBeNull("safePaths"); - } - for (final String safePath : safePaths) { - if (safePath == null) { - throw UndertowMessages.MESSAGES.argumentCannotBeNull("safePaths"); - } - } - this.safePaths.addAll(Arrays.asList(safePaths)); - } + } public File getBase() { @@ -132,13 +88,11 @@ try { File file = new File(base, path); if (file.exists()) { - boolean isSymlinkPath = isSymlinkPath(base, file); - if (isSymlinkPath) { - if (this.followLinks && isSymlinkSafe(file)) { - return getFileResource(file, path); - } - } else { - return getFileResource(file, path); + //security check for case insensitive file systems + //we make sure the case of the filename matches the case of the request + //TODO: we should be able to avoid this if we can tell a FS is case sensitive + if (file.getCanonicalFile().getName().equals(file.getName())) { + return new FileResource(file, this, path); } } return null; @@ -162,7 +116,7 @@ @Override public void handleChanges(Collection changes) { synchronized (FileResourceManager.this) { - final List events = new ArrayList<>(); + final List events = new ArrayList(); for (FileChangeEvent change : changes) { if (change.getFile().getAbsolutePath().startsWith(base)) { String path = change.getFile().getAbsolutePath().substring(base.length()); @@ -194,91 +148,4 @@ fileSystemWatcher.close(); } } - - /** - * Returns true is some element of path inside base path is a symlink. - */ - private boolean isSymlinkPath(final String base, final File file) throws IOException { - Path path = file.toPath(); - int nameCount = path.getNameCount(); - File root = new File(base); - Path rootPath = root.toPath(); - int rootCount = rootPath.getNameCount(); - if (nameCount > rootCount) { - File f = root; - for (int i= rootCount; i 0) { - if (safePath.charAt(0) == '/') { - /* - * Absolute path - */ - return safePath.length() > 0 && - canonicalPath.length() >= safePath.length() && - canonicalPath.startsWith(safePath); - } else { - /* - * In relative path we build the path appending to base - */ - String absSafePath = base + '/' + safePath; - File absSafePathFile = new File(absSafePath); - String canonicalSafePath = absSafePathFile.getCanonicalPath(); - return canonicalSafePath.length() > 0 && - canonicalPath.length() >= canonicalSafePath.length() && - canonicalPath.startsWith(canonicalSafePath); - - } - } - } - return false; - } - - /** - * Apply security check for case insensitive file systems. - */ - private FileResource getFileResource(final File file, final String path) throws IOException { - if (this.caseSensitive) { - if (isFileSameCase(file)) { - return new FileResource(file, this, path); - } else { - return null; - } - } else { - return new FileResource(file, this, path); - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/Resource.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/Resource.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/Resource.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/Resource.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.resource; import java.io.File; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceChangeEvent.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/ResourceChangeEvent.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceChangeEvent.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceChangeEvent.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.resource; /** Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceChangeListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/ResourceChangeListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceChangeListener.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceChangeListener.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.resource; import java.util.Collection; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/ResourceHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceHandler.java 8 Sep 2014 09:47:04 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceHandler.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,42 +1,17 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.resource; -import java.io.File; import java.io.IOException; import java.util.Arrays; -import java.util.Collections; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import io.undertow.UndertowLogger; import io.undertow.io.IoCallback; import io.undertow.predicate.Predicate; import io.undertow.predicate.Predicates; -import io.undertow.server.HandlerWrapper; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; -import io.undertow.server.handlers.builder.HandlerBuilder; import io.undertow.server.handlers.cache.ResponseCache; import io.undertow.server.handlers.encoding.ContentEncodedResource; import io.undertow.server.handlers.encoding.ContentEncodedResourceManager; @@ -54,7 +29,7 @@ */ public class ResourceHandler implements HttpHandler { - private final List welcomeFiles = new CopyOnWriteArrayList<>(new String[]{"index.html", "index.htm", "default.html", "default.htm"}); + private final List welcomeFiles = new CopyOnWriteArrayList(new String[]{"index.html", "index.htm", "default.html", "default.htm"}); /** * If directory listing is enabled. */ @@ -211,13 +186,10 @@ //todo: handle range requests //we are going to proceed. Set the appropriate headers final String contentType = resource.getContentType(mimeMappings); - - if(!exchange.getResponseHeaders().contains(Headers.CONTENT_TYPE)) { - if (contentType != null) { - exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, contentType); - } else { - exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/octet-stream"); - } + if (contentType != null) { + exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, contentType); + } else { + exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/octet-stream"); } if (lastModified != null) { exchange.getResponseHeaders().put(Headers.LAST_MODIFIED, resource.getLastModifiedString()); @@ -350,57 +322,4 @@ this.contentEncodedResourceManager = contentEncodedResourceManager; return this; } - - - - public static class Builder implements HandlerBuilder { - - @Override - public String name() { - return "resource"; - } - - @Override - public Map> parameters() { - Map> params = new HashMap<>(); - params.put("location", String.class); - params.put("allow-listing", boolean.class); - return params; - } - - @Override - public Set requiredParameters() { - return Collections.singleton("location"); - } - - @Override - public String defaultParameter() { - return "location"; - } - - @Override - public HandlerWrapper build(Map config) { - return new Wrapper((String)config.get("location"), (Boolean) config.get("allow-listing")); - } - - } - - private static class Wrapper implements HandlerWrapper { - - private final String location; - private final boolean allowDirectoryListing; - - private Wrapper(String location, boolean allowDirectoryListing) { - this.location = location; - this.allowDirectoryListing = allowDirectoryListing; - } - - @Override - public HttpHandler wrap(HttpHandler handler) { - ResourceManager rm = new FileResourceManager(new File(location), 1024); - ResourceHandler resourceHandler = new ResourceHandler(rm); - resourceHandler.setDirectoryListingEnabled(allowDirectoryListing); - return resourceHandler; - } - } } Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/ResourceManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceManager.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/ResourceManager.java 8 Sep 2014 10:52:18 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.resource; import io.undertow.UndertowMessages; Index: 3rdParty_sources/undertow/io/undertow/server/handlers/resource/URLResource.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/handlers/resource/Attic/URLResource.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/handlers/resource/URLResource.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/handlers/resource/URLResource.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.handlers.resource; import java.io.File; @@ -100,7 +82,7 @@ @Override public List list() { - List result = new LinkedList<>(); + List result = new LinkedList(); File file = getFile(); try { if (file != null) { Index: 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AbstractAjpParseState.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/ajp/Attic/AbstractAjpParseState.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AbstractAjpParseState.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AbstractAjpParseState.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.ajp; /** Index: 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AbstractAjpParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/ajp/Attic/AbstractAjpParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AbstractAjpParser.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AbstractAjpParser.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.ajp; import io.undertow.util.HttpString; Index: 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpOpenListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/ajp/Attic/AjpOpenListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpOpenListener.java 8 Sep 2014 09:46:46 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpOpenListener.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,37 +1,13 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.ajp; import io.undertow.UndertowLogger; import io.undertow.UndertowMessages; -import io.undertow.UndertowOptions; -import io.undertow.conduits.ReadTimeoutStreamSourceConduit; -import io.undertow.conduits.WriteTimeoutStreamSinkConduit; import io.undertow.server.HttpHandler; import io.undertow.server.OpenListener; -import org.xnio.IoUtils; import org.xnio.OptionMap; -import org.xnio.Options; import org.xnio.Pool; import org.xnio.StreamConnection; -import java.io.IOException; import java.nio.ByteBuffer; import static io.undertow.UndertowOptions.DECODE_URL; @@ -65,38 +41,11 @@ parser = new AjpRequestParser(undertowOptions.get(URL_CHARSET, UTF_8), undertowOptions.get(DECODE_URL, true)); } - @Override public void handleEvent(final StreamConnection channel) { if (UndertowLogger.REQUEST_LOGGER.isTraceEnabled()) { UndertowLogger.REQUEST_LOGGER.tracef("Opened connection with %s", channel.getPeerAddress()); } - //set read and write timeouts - try { - Integer readTimeout = channel.getOption(Options.READ_TIMEOUT); - Integer idleTimeout = undertowOptions.get(UndertowOptions.IDLE_TIMEOUT); - if ((readTimeout == null || readTimeout <= 0) && idleTimeout != null) { - readTimeout = idleTimeout; - } else if (readTimeout != null && idleTimeout != null && idleTimeout > 0) { - readTimeout = Math.min(readTimeout, idleTimeout); - } - if (readTimeout != null && readTimeout > 0) { - channel.getSourceChannel().setConduit(new ReadTimeoutStreamSourceConduit(channel.getSourceChannel().getConduit(), channel, this)); - } - Integer writeTimeout = channel.getOption(Options.WRITE_TIMEOUT); - if ((writeTimeout == null || writeTimeout <= 0) && idleTimeout != null) { - writeTimeout = idleTimeout; - } else if (writeTimeout != null && idleTimeout != null && idleTimeout > 0) { - writeTimeout = Math.min(writeTimeout, idleTimeout); - } - if (writeTimeout != null && writeTimeout > 0) { - channel.getSinkChannel().setConduit(new WriteTimeoutStreamSinkConduit(channel.getSinkChannel().getConduit(), channel, this)); - } - } catch (IOException e) { - IoUtils.safeClose(channel); - UndertowLogger.REQUEST_IO_LOGGER.ioException(e); - } - AjpServerConnection connection = new AjpServerConnection(channel, bufferPool, rootHandler, undertowOptions, bufferSize); AjpReadListener readListener = new AjpReadListener(connection, scheme, parser); connection.setAjpReadListener(readListener); @@ -105,22 +54,18 @@ readListener.handleEvent(channel.getSourceChannel()); } - @Override public HttpHandler getRootHandler() { return rootHandler; } - @Override public void setRootHandler(final HttpHandler rootHandler) { this.rootHandler = rootHandler; } - @Override public OptionMap getUndertowOptions() { return undertowOptions; } - @Override public void setUndertowOptions(final OptionMap undertowOptions) { if (undertowOptions == null) { throw UndertowMessages.MESSAGES.argumentCannotBeNull("undertowOptions"); Index: 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpReadListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/ajp/Attic/AjpReadListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpReadListener.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpReadListener.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.ajp; import io.undertow.UndertowLogger; @@ -31,6 +13,7 @@ import io.undertow.util.HttpString; import io.undertow.util.Methods; import org.xnio.ChannelListener; +import org.xnio.IoUtils; import org.xnio.Pooled; import org.xnio.StreamConnection; import org.xnio.channels.StreamSinkChannel; @@ -71,8 +54,8 @@ this.scheme = scheme; this.parser = parser; this.maxRequestSize = connection.getUndertowOptions().get(UndertowOptions.MAX_HEADER_SIZE, UndertowOptions.DEFAULT_MAX_HEADER_SIZE); - this.maxEntitySize = connection.getUndertowOptions().get(UndertowOptions.MAX_ENTITY_SIZE, UndertowOptions.DEFAULT_MAX_ENTITY_SIZE); - this.writeReadyHandler = new WriteReadyHandler.ChannelListenerHandler<>(connection.getChannel().getSinkChannel()); + this.maxEntitySize = connection.getUndertowOptions().get(UndertowOptions.MAX_ENTITY_SIZE, 0); + this.writeReadyHandler = new WriteReadyHandler.ChannelListenerHandler(connection.getChannel().getSinkChannel()); this.recordRequestStartTime = connection.getUndertowOptions().get(UndertowOptions.RECORD_REQUEST_START_TIME, false); } @@ -85,7 +68,7 @@ public void handleEvent(final StreamSourceChannel channel) { if(connection.getOriginalSinkConduit().isWriteShutdown() || connection.getOriginalSourceConduit().isReadShutdown()) { - safeClose(connection); + IoUtils.safeClose(connection); channel.suspendReads(); return; } @@ -122,11 +105,11 @@ channel.shutdownReads(); final StreamSinkChannel responseChannel = connection.getChannel().getSinkChannel(); responseChannel.shutdownWrites(); - safeClose(connection); + IoUtils.safeClose(connection); } catch (IOException e) { UndertowLogger.REQUEST_IO_LOGGER.ioException(e); // fuck it, it's all ruined - safeClose(connection); + IoUtils.safeClose(connection); return; } return; @@ -140,14 +123,14 @@ } int begin = buffer.remaining(); parser.parse(buffer, state, httpServerExchange); - read += begin - buffer.remaining(); + read += (begin - buffer.remaining()); if (buffer.hasRemaining()) { free = false; connection.setExtraBytes(pooled); } if (read > maxRequestSize) { UndertowLogger.REQUEST_LOGGER.requestHeaderWasTooLarge(connection.getPeerAddress(), maxRequestSize); - safeClose(connection); + IoUtils.safeClose(connection); return; } } while (!state.isComplete()); @@ -164,7 +147,7 @@ channel.resumeReads(); } else { UndertowLogger.REQUEST_LOGGER.ignoringAjpRequestWithPrefixCode(state.prefix); - safeClose(connection); + IoUtils.safeClose(connection); } return; } @@ -206,12 +189,12 @@ } catch (Throwable t) { //TODO: we should attempt to return a 500 status code in this situation UndertowLogger.REQUEST_LOGGER.exceptionProcessingRequest(t); - safeClose(channel); - safeClose(connection); + IoUtils.safeClose(channel); + IoUtils.safeClose(connection); } } catch (Exception e) { UndertowLogger.REQUEST_LOGGER.exceptionProcessingRequest(e); - safeClose(connection.getChannel()); + IoUtils.safeClose(connection.getChannel()); } finally { if (free) pooled.free(); } @@ -239,7 +222,7 @@ } } catch (IOException e) { UndertowLogger.REQUEST_IO_LOGGER.ioException(e); - safeClose(connection); + IoUtils.safeClose(connection); } } while (buffer.hasRemaining()); channel.suspendWrites(); @@ -253,7 +236,7 @@ AjpReadListener.this.handleEvent(underlyingChannel.getSourceChannel()); } catch (IOException e) { UndertowLogger.REQUEST_IO_LOGGER.ioException(e); - safeClose(connection); + IoUtils.safeClose(connection); } } @@ -264,7 +247,7 @@ channel.getReadSetter().set(this); channel.wakeupReads(); } else if(!exchange.isPersistent()) { - safeClose(exchange.getConnection()); + IoUtils.safeClose(exchange.getConnection()); } } Index: 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpRequestParseState.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/ajp/Attic/AjpRequestParseState.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpRequestParseState.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpRequestParseState.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,33 +1,15 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.ajp; +import io.undertow.server.BasicSSLSessionInfo; +import io.undertow.util.HttpString; + import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.security.cert.CertificateException; import java.util.HashMap; import java.util.Map; -import io.undertow.server.BasicSSLSessionInfo; -import io.undertow.util.HttpString; - /** * @author Stuart Douglas */ @@ -65,7 +47,7 @@ String currentAttribute; //TODO: can there be more than one attribute? - Map attributes = new HashMap<>(); + Map attributes = new HashMap(); String remoteAddress; int serverPort = 80; @@ -92,16 +74,15 @@ } InetSocketAddress createPeerAddress() { - if (remoteAddress == null) { + if(remoteAddress == null) { return null; } String portString = attributes.get(AJP_REMOTE_PORT); int port = 0; - if (portString != null) { + if(portString != null) { try { port = Integer.parseInt(portString); - } catch (IllegalArgumentException e) { - } + } catch (IllegalArgumentException e) {} } try { InetAddress address = InetAddress.getByName(remoteAddress); @@ -112,9 +93,14 @@ } InetSocketAddress createDestinationAddress() { - if (serverAddress == null) { + if(serverAddress == null) { return null; } - return InetSocketAddress.createUnresolved(serverAddress, serverPort); + try { + InetAddress address = InetAddress.getByName(serverAddress); + return new InetSocketAddress(address, serverPort); + } catch (UnknownHostException e) { + return null; + } } } Index: 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpRequestParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/ajp/Attic/AjpRequestParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpRequestParser.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpRequestParser.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,23 +1,16 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.ajp; +import io.undertow.security.impl.ExternalAuthenticationMechanism; +import io.undertow.server.HttpServerExchange; +import io.undertow.util.Headers; +import io.undertow.util.HttpString; +import io.undertow.util.URLUtils; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.ByteBuffer; + import static io.undertow.util.Methods.ACL; import static io.undertow.util.Methods.BASELINE_CONTROL; import static io.undertow.util.Methods.CHECKIN; @@ -46,17 +39,6 @@ import static io.undertow.util.Methods.UPDATE; import static io.undertow.util.Methods.VERSION_CONTROL; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.nio.ByteBuffer; - -import io.undertow.security.impl.ExternalAuthenticationMechanism; -import io.undertow.server.HttpServerExchange; -import io.undertow.util.Headers; -import io.undertow.util.HttpString; -import io.undertow.util.URLUtils; - /** * @author Stuart Douglas */ @@ -216,7 +198,7 @@ int method = buf.get(); if (method > 0 && method < 28) { exchange.setRequestMethod(HTTP_METHODS[method]); - } else if((method & 0xFF) != 0xFF) { + } else { throw new IllegalArgumentException("Unknown method type " + method); } } @@ -235,7 +217,7 @@ StringHolder result = parseString(buf, state, false); if (result.readComplete) { int colon = result.value.indexOf(';'); - if (colon == -1) { + if(colon == -1) { String res = decode(result.value, result.containsUrlCharacters); exchange.setRequestURI(result.value); exchange.setRequestPath(res); @@ -295,7 +277,7 @@ return; } else { final byte isSsl = buf.get(); - if (isSsl != 0) { + if(isSsl != 0) { exchange.setRequestScheme("https"); } else { exchange.setRequestScheme("http"); @@ -385,12 +367,10 @@ if (state.currentAttribute.equals(QUERY_STRING)) { exchange.setQueryString(result == null ? "" : result); URLUtils.parseQueryString(result, exchange, encoding, doDecode); - } else if (state.currentAttribute.equals(REMOTE_USER)) { + } else if(state.currentAttribute.equals(REMOTE_USER)) { exchange.putAttachment(ExternalAuthenticationMechanism.EXTERNAL_PRINCIPAL, result); - } else if (state.currentAttribute.equals(AUTH_TYPE)) { + } else if(state.currentAttribute.equals(AUTH_TYPE)) { exchange.putAttachment(ExternalAuthenticationMechanism.EXTERNAL_AUTHENTICATION_TYPE, result); - } else if (state.currentAttribute.equals(STORED_METHOD)) { - exchange.setRequestMethod(new HttpString(result)); } else { //other attributes state.attributes.put(state.currentAttribute, result); @@ -403,7 +383,7 @@ } private String decode(String url, final boolean containsUrlCharacters) throws UnsupportedEncodingException { - if (doDecode && containsUrlCharacters) { + if(doDecode && containsUrlCharacters) { return URLDecoder.decode(url, encoding); } return url; Index: 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpServerConnection.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/ajp/Attic/AjpServerConnection.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpServerConnection.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpServerConnection.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.ajp; @@ -52,7 +52,7 @@ public AjpServerConnection(StreamConnection channel, Pool bufferPool, HttpHandler rootHandler, OptionMap undertowOptions, int bufferSize) { super(channel, bufferPool, rootHandler, undertowOptions, bufferSize); - this.writeReadyHandler = new WriteReadyHandler.ChannelListenerHandler<>(channel.getSinkChannel()); + this.writeReadyHandler = new WriteReadyHandler.ChannelListenerHandler(channel.getSinkChannel()); } @Override @@ -81,11 +81,6 @@ } @Override - public void terminateRequestChannel(HttpServerExchange exchange) { - //todo: terminate - } - - @Override public void restoreChannel(ConduitState state) { super.restoreChannel(state); channel.getSinkChannel().getConduit().setWriteReadyHandler(writeReadyHandler); Index: 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpServerRequestConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/ajp/Attic/AjpServerRequestConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpServerRequestConduit.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpServerRequestConduit.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.ajp; import java.io.IOException; @@ -134,15 +116,6 @@ } @Override - public void terminateReads() throws IOException { - if(exchange.isPersistent()) { - state |= STATE_FINISHED; - return; - } - super.terminateReads(); - } - - @Override public long read(ByteBuffer[] dsts, int offset, int length) throws IOException { long total = 0; for (int i = offset; i < length; ++i) { @@ -167,13 +140,6 @@ return -1; } else if (anyAreSet(state, STATE_SEND_REQUIRED)) { state = this.state = (state & STATE_MASK) | STATE_READING; - if(ajpResponseConduit.isWriteShutdown()) { - this.state = STATE_FINISHED; - if (finishListener != null) { - finishListener.handleEvent(this); - } - return -1; - } if (!ajpResponseConduit.doGetRequestBodyChunk(READ_BODY_CHUNK.duplicate(), this)) { return 0; } @@ -234,9 +200,9 @@ chunkRemaining = this.state & STATE_MASK; } - int limit = dst.remaining(); + int limit = dst.limit(); try { - if (dst.remaining() > chunkRemaining) { + if (limit > chunkRemaining) { dst.limit((int) (dst.position() + chunkRemaining)); } int read = next.read(dst); Index: 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpServerResponseConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/ajp/Attic/AjpServerResponseConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpServerResponseConduit.java 8 Sep 2014 09:46:45 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/ajp/AjpServerResponseConduit.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.ajp; @@ -64,7 +64,7 @@ private static final Map HEADER_MAP; static { - final Map headers = new HashMap<>(); + final Map headers = new HashMap(); headers.put(Headers.CONTENT_TYPE, 0xA001); headers.put(Headers.CONTENT_LANGUAGE, 0xA002); headers.put(Headers.CONTENT_LENGTH, 0xA003); @@ -83,7 +83,6 @@ private static final int FLAG_WRITE_RESUMED = 1 << 2; private static final int FLAG_WRITE_READ_BODY_CHUNK_FROM_LISTENER = 1 << 3; private static final int FLAG_WRITE_SHUTDOWN = 1 << 4; - private static final int FLAG_READS_DONE = 1 << 5; private static final ByteBuffer CLOSE_FRAME_PERSISTENT; private static final ByteBuffer CLOSE_FRAME_NON_PERSISTENT; Index: 3rdParty_sources/undertow/io/undertow/server/protocol/framed/AbstractFramedChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/framed/Attic/AbstractFramedChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/framed/AbstractFramedChannel.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/framed/AbstractFramedChannel.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,32 +9,18 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.framed; -import static org.xnio.IoUtils.safeClose; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.nio.ByteBuffer; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Deque; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; -import java.util.Set; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.LinkedBlockingDeque; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; +import io.undertow.UndertowMessages; +import io.undertow.conduits.IdleTimeoutConduit; +import io.undertow.util.ReferenceCountedPooled; +import io.undertow.websockets.core.WebSocketLogger; import org.xnio.Buffers; import org.xnio.ChannelListener; import org.xnio.ChannelListener.Setter; @@ -46,17 +32,25 @@ import org.xnio.StreamConnection; import org.xnio.XnioIoThread; import org.xnio.XnioWorker; -import org.xnio.channels.CloseableChannel; import org.xnio.channels.ConnectedChannel; import org.xnio.channels.StreamSinkChannel; import org.xnio.channels.StreamSourceChannel; -import io.undertow.UndertowLogger; -import io.undertow.UndertowMessages; -import io.undertow.conduits.IdleTimeoutConduit; -import io.undertow.util.ReferenceCountedPooled; -import io.undertow.websockets.core.WebSocketLogger; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.nio.ByteBuffer; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; +import static org.xnio.IoUtils.safeClose; + /** * A {@link org.xnio.channels.ConnectedChannel} which can be used to send and receive Frames. *

    @@ -81,20 +75,20 @@ /** * List of frames that are ready to send */ - private final List pendingFrames = new LinkedList<>(); + private final List pendingFrames = new LinkedList(); /** * Frames that are not yet read to send. */ - private final Deque heldFrames = new ArrayDeque<>(); + private final Deque heldFrames = new ArrayDeque(); /** * new frames to be sent. These will be added to either the pending or held frames list * depending on the {@link #framePriority} implementation in use. */ - private final Deque newFrames = new LinkedBlockingDeque<>(); + private final Deque newFrames = new ArrayDeque(); - private volatile long frameDataRemaining; - private volatile R receiver; + private volatile R receiver = null; + private final List receivers = new CopyOnWriteArrayList(); private boolean receivesSuspended = true; @@ -108,11 +102,7 @@ private static final AtomicIntegerFieldUpdater writesBrokenUpdater = AtomicIntegerFieldUpdater.newUpdater(AbstractFramedChannel.class, "writesBroken"); private ReferenceCountedPooled readData = null; - private final List> closeTasks = new CopyOnWriteArrayList<>(); - private boolean flushingSenders = false; - private final Set> receivers = new HashSet<>(); - /** * Create a new {@link io.undertow.server.protocol.framed.AbstractFramedChannel} * 8 @@ -122,34 +112,25 @@ * @param bufferPool The {@link org.xnio.Pool} which will be used to acquire {@link java.nio.ByteBuffer}'s from. * @param framePriority */ - protected AbstractFramedChannel(final StreamConnection connectedStreamChannel, Pool bufferPool, FramePriority framePriority, final Pooled readData) { + protected AbstractFramedChannel(final StreamConnection connectedStreamChannel, Pool bufferPool, FramePriority framePriority) { this.framePriority = framePriority; - if (readData != null) { - this.readData = new ReferenceCountedPooled<>(readData, 1); - } - IdleTimeoutConduit idle = createIdleTimeoutChannel(connectedStreamChannel); + IdleTimeoutConduit idle = new IdleTimeoutConduit(connectedStreamChannel.getSinkChannel().getConduit(), connectedStreamChannel.getSourceChannel().getConduit()); connectedStreamChannel.getSourceChannel().setConduit(idle); connectedStreamChannel.getSinkChannel().setConduit(idle); this.idleTimeoutConduit = idle; this.channel = connectedStreamChannel; this.bufferPool = bufferPool; - closeSetter = new ChannelListener.SimpleSetter<>(); - receiveSetter = new ChannelListener.SimpleSetter<>(); + closeSetter = new ChannelListener.SimpleSetter(); + receiveSetter = new ChannelListener.SimpleSetter(); channel.getSourceChannel().getReadSetter().set(null); channel.getSourceChannel().suspendReads(); channel.getSourceChannel().getReadSetter().set(new FrameReadListener()); connectedStreamChannel.getSinkChannel().getWriteSetter().set(new FrameWriteListener()); - FrameCloseListener closeListener = new FrameCloseListener(); - connectedStreamChannel.getSinkChannel().getCloseSetter().set(closeListener); - connectedStreamChannel.getSourceChannel().getCloseSetter().set(closeListener); + connectedStreamChannel.getSinkChannel().getCloseSetter().set(new FrameCloseListener()); } - protected IdleTimeoutConduit createIdleTimeoutChannel(StreamConnection connectedStreamChannel) { - return new IdleTimeoutConduit(connectedStreamChannel.getSinkChannel().getConduit(), connectedStreamChannel.getSourceChannel().getConduit()); - } - /** * Get the buffer pool for this connection. * @@ -236,7 +217,10 @@ * of calling this method then it can prevent frame channels for being fully consumed. */ public synchronized R receive() throws IOException { - if (isLastFrameReceived() && receiver == null) { + if (receiver != null) { + return null; + } + if (isLastFrameReceived()) { //we have received the last frame, we just shut down and return //it would probably make more sense to have the last channel responsible for this //however it is much simpler just to have it here @@ -248,17 +232,16 @@ boolean hasData; if (pooled == null) { Pooled buf = bufferPool.allocate(); - this.readData = pooled = new ReferenceCountedPooled<>(buf, 1); + this.readData = pooled = new ReferenceCountedPooled(buf, 1); hasData = false; } else { hasData = pooled.getResource().hasRemaining(); } boolean forceFree = false; - int read = 0; try { if (!hasData) { pooled.getResource().clear(); - read = channel.getSourceChannel().read(pooled.getResource()); + int read = channel.getSourceChannel().read(pooled.getResource()); if (read == 0) { //no data, we just free the buffer forceFree = true; @@ -274,47 +257,14 @@ safeClose(channel.getSourceChannel()); throw e; } - forceFree = true; - lastDataRead(); - return null; + throw UndertowMessages.MESSAGES.channelIsClosed(); } pooled.getResource().flip(); } - if (frameDataRemaining > 0) { - if (frameDataRemaining >= pooled.getResource().remaining()) { - frameDataRemaining -= pooled.getResource().remaining(); - if(receiver != null) { - receiver.dataReady(null, pooled); - } else { - //we are dropping a frame - pooled.free(); - } - readData = null; - if(frameDataRemaining == 0) { - receiver = null; - } - return null; - } else { - ByteBuffer buf = pooled.getResource().duplicate(); - buf.limit((int) (buf.position() + frameDataRemaining)); - pooled.getResource().position((int) (pooled.getResource().position() + frameDataRemaining)); - frameDataRemaining = 0; - Pooled frameData = pooled.createView(buf); - //note that we don't return here, there may be another frame - if(receiver != null) { - receiver.dataReady(null, frameData); - } else{ - //we are dropping the frame - frameData.free(); - } - receiver = null; - } - } FrameHeaderData data = parseFrame(pooled.getResource()); if (data != null) { Pooled frameData; - if (data.getFrameLength() >= pooled.getResource().remaining()) { - frameDataRemaining = data.getFrameLength() - pooled.getResource().remaining(); + if (data.getFrameLength() > pooled.getResource().remaining()) { frameData = pooled.createView(pooled.getResource().duplicate()); pooled.getResource().position(pooled.getResource().limit()); } else { @@ -325,38 +275,31 @@ } AbstractFramedStreamSourceChannel existing = data.getExistingChannel(); if (existing != null) { + existing.dataReady(data, frameData); if (data.getFrameLength() > frameData.getResource().remaining()) { receiver = (R) existing; } - existing.dataReady(data, frameData); return null; } else { - boolean moreData = data.getFrameLength() > frameData.getResource().remaining(); R newChannel = createChannel(data, frameData); - if (newChannel != null) { - receivers.add(newChannel); - if (moreData) { - receiver = newChannel; - } - } else { - frameData.free(); + if (data.getFrameLength() > frameData.getResource().remaining()) { + receiver = newChannel; } - + receivers.add(newChannel); return newChannel; } } return null; } catch (IOException e) { //something has code wrong with parsing, close the read side //we don't close the write side, as the underlying implementation will most likely want to send an error - UndertowLogger.REQUEST_LOGGER.ioException(e); markReadsBroken(e); forceFree = true; throw e; } finally { //if the receive caused the channel to break the close listener may be have been called //which will make readData null - if (readData != null) { + if(readData != null) { if (!pooled.getResource().hasRemaining() || forceFree) { pooled.free(); this.readData = null; @@ -366,20 +309,13 @@ } /** - * Method than is invoked when read() returns -1. - */ - protected void lastDataRead() { - - } - - /** * Method that creates the actual stream source channel implementation that is in use. * * @param frameHeaderData The header data, as returned by {@link #parseFrame(java.nio.ByteBuffer)} * @param frameData Any additional data for the frame that has already been read. This may not be the complete frame contents * @return A new stream source channel */ - protected abstract R createChannel(FrameHeaderData frameHeaderData, Pooled frameData) throws IOException; + protected abstract R createChannel(FrameHeaderData frameHeaderData, Pooled frameData); /** * Attempts to parse an incoming frame header from the data in the buffer. @@ -390,13 +326,6 @@ */ protected abstract FrameHeaderData parseFrame(ByteBuffer data) throws IOException; - protected synchronized void recalculateHeldFrames() throws IOException { - if (!heldFrames.isEmpty()) { - framePriority.frameAdded(null, pendingFrames, heldFrames); - flushSenders(); - } - } - /** * Flushes all ready stream sink conduits to the channel. *

    @@ -406,114 +335,87 @@ * * @throws IOException */ - protected synchronized void flushSenders() { - if(flushingSenders) { - throw UndertowMessages.MESSAGES.recursiveCallToFlushingSenders(); - } - flushingSenders = true; - try { - int toSend = 0; - while (!newFrames.isEmpty()) { - S frame = newFrames.poll(); - if (framePriority.insertFrame(frame, pendingFrames)) { - if (!heldFrames.isEmpty()) { - framePriority.frameAdded(frame, pendingFrames, heldFrames); - } - } else { - heldFrames.add(frame); + protected synchronized void flushSenders() throws IOException { + int toSend = 0; + while (!newFrames.isEmpty()) { + S frame = newFrames.poll(); + if (framePriority.insertFrame(frame, pendingFrames)) { + if (!heldFrames.isEmpty()) { + framePriority.frameAdded(frame, pendingFrames, heldFrames); } + } else { + heldFrames.add(frame); } + } - boolean finalFrame = false; - ListIterator it = pendingFrames.listIterator(); - while (it.hasNext()) { - S sender = it.next(); - if (sender.isReadyForFlush()) { - ++toSend; - } else { - break; - } - if (sender.isLastFrame()) { - finalFrame = true; - } + boolean finalFrame = false; + ListIterator it = pendingFrames.listIterator(); + while (it.hasNext()) { + S sender = it.next(); + if (sender.isReadyForFlush()) { + ++toSend; + } else { + break; } - if (toSend == 0) { - //if there is nothing to send we just attempt a flush on the underlying channel - try { - if(channel.getSinkChannel().flush()) { - channel.getSinkChannel().suspendWrites(); - } - } catch (IOException e) { - safeClose(channel); - markWritesBroken(e); - } - return; + if (sender.isLastFrame()) { + finalFrame = true; } - ByteBuffer[] data = new ByteBuffer[toSend * 3]; - int j = 0; - it = pendingFrames.listIterator(); - try { - while (j < toSend) { - S next = it.next(); - //todo: rather than adding empty buffers just store the offsets - SendFrameHeader frameHeader = next.getFrameHeader(); - Pooled frameHeaderByteBuffer = frameHeader.getByteBuffer(); - data[j * 3] = frameHeaderByteBuffer != null - ? frameHeaderByteBuffer.getResource() - : Buffers.EMPTY_BYTE_BUFFER; - data[(j * 3) + 1] = next.getBuffer(); - data[(j * 3) + 2] = next.getFrameFooter(); - ++j; - } - long toWrite = Buffers.remaining(data); - long res; - do { - res = channel.getSinkChannel().write(data); - toWrite -= res; - } while (res > 0 && toWrite > 0); - int max = toSend; + } + if (toSend == 0) { + return; + } + ByteBuffer[] data = new ByteBuffer[toSend * 3]; + int j = 0; + it = pendingFrames.listIterator(); + while (j < toSend) { + S next = it.next(); + //todo: rather than adding empty buffers just store the offsets + data[j * 3] = next.getFrameHeader(); + ByteBuffer frameHeaderByteBuffer = next.getFrameHeader(); + data[j * 3] = frameHeaderByteBuffer != null + ? frameHeaderByteBuffer + : Buffers.EMPTY_BYTE_BUFFER; + data[(j * 3) + 1] = next.getBuffer(); + data[(j * 3) + 2] = next.getFrameFooter(); + ++j; + } + long toWrite = Buffers.remaining(data); - while (max > 0) { - S sinkChannel = pendingFrames.get(0); - Pooled frameHeaderByteBuffer = sinkChannel.getFrameHeader().getByteBuffer(); - if (frameHeaderByteBuffer != null && frameHeaderByteBuffer.getResource().hasRemaining() - || sinkChannel.getBuffer().hasRemaining() - || sinkChannel.getFrameFooter().hasRemaining()) { - break; - } - sinkChannel.flushComplete(); - pendingFrames.remove(sinkChannel); - max--; - } - if (!pendingFrames.isEmpty() || !channel.getSinkChannel().flush()) { - channel.getSinkChannel().resumeWrites(); - } else { - channel.getSinkChannel().suspendWrites(); - } - if (pendingFrames.isEmpty() && finalFrame) { - //all data has been sent. Close gracefully - channel.getSinkChannel().shutdownWrites(); - if (!channel.getSinkChannel().flush()) { - channel.getSinkChannel().setWriteListener(ChannelListeners.flushingChannelListener(null, null)); - channel.getSinkChannel().resumeWrites(); - } - } - + long res; + do { + try { + res = channel.getSinkChannel().write(data); + toWrite -= res; } catch (IOException e) { - safeClose(channel); + IoUtils.safeClose(channel); markWritesBroken(e); + throw e; } - } finally { - flushingSenders = false; - if(!newFrames.isEmpty()) { - getIoThread().execute(new Runnable() { - @Override - public void run() { - flushSenders(); - } - }); + } while (res > 0 && toWrite > 0); + int max = toSend; + + while (max > 0) { + S sinkChannel = pendingFrames.get(0); + if (sinkChannel.getFrameHeader() != null && sinkChannel.getFrameHeader().hasRemaining() + || sinkChannel.getBuffer().hasRemaining() + || sinkChannel.getFrameFooter().hasRemaining()) { + break; } + sinkChannel.flushComplete(); + pendingFrames.remove(sinkChannel); + max--; } + if (!pendingFrames.isEmpty()) { + pendingFrames.get(0).activated(); + } + if (pendingFrames.isEmpty() && finalFrame) { + //all data has been sent. Close gracefully + channel.getSinkChannel().shutdownWrites(); + if (!channel.getSinkChannel().flush()) { + channel.getSinkChannel().setWriteListener(ChannelListeners.flushingChannelListener(null, null)); + channel.getSinkChannel().resumeWrites(); + } + } } void awaitWritable() throws IOException { @@ -535,21 +437,11 @@ protected synchronized void queueFrame(final S channel) throws IOException { assert !newFrames.contains(channel); if (isWritesBroken() || !this.channel.getSinkChannel().isOpen()) { - IoUtils.safeClose(channel); throw UndertowMessages.MESSAGES.channelIsClosed(); } newFrames.add(channel); - if (!flushingSenders) { - if(channel.getIoThread() == Thread.currentThread()) { - flushSenders(); - } else { - channel.getIoThread().execute(new Runnable() { - @Override - public void run() { - flushSenders(); - } - }); - } + if (newFrames.peek() == channel) { + flushSenders(); } } @@ -598,10 +490,12 @@ */ public synchronized void resumeReceives() { receivesSuspended = false; - if (readData != null) { - channel.getSourceChannel().wakeupReads(); - } else { - channel.getSourceChannel().resumeReads(); + if (receiver == null) { + if (readData != null) { + channel.getSourceChannel().wakeupReads(); + } else { + channel.getSourceChannel().resumeReads(); + } } } @@ -611,14 +505,12 @@ /** * Forcibly closes the {@link io.undertow.server.protocol.framed.AbstractFramedChannel}. + * a clean shutdown */ @Override public void close() throws IOException { - safeClose(channel); - if(readData != null) { - readData.free(); - readData = null; - } + IoUtils.safeClose(channel); + wakeupWrites(); } @Override @@ -639,19 +531,14 @@ handleBrokenSourceChannel(cause); safeClose(channel.getSourceChannel()); - - closeSubChannels(); + R receiver = this.receiver; + if (receiver != null && receiver.isReadResumed()) { + ChannelListeners.invokeChannelListener(receiver.getIoThread(), receiver, ((ChannelListener.SimpleSetter) receiver.getReadSetter()).get()); + } } } - /** - * Method that is called when the channel is being forcibly closed, and all sub stream sink/source - * channels should also be forcibly closed. - */ - protected abstract void closeSubChannels(); - - /** * Called when a sub channel fails to fulfil its contract, and leaves the channel in an inconsistent state. *

    @@ -711,18 +598,20 @@ void notifyFrameReadComplete(AbstractFramedStreamSourceChannel channel) { synchronized (AbstractFramedChannel.this) { if (isLastFrameReceived()) { - safeClose(AbstractFramedChannel.this.channel.getSourceChannel()); + IoUtils.safeClose(AbstractFramedChannel.this.channel.getSourceChannel()); } - } - } - - void notifyClosed(AbstractFramedStreamSourceChannel channel) { - synchronized (AbstractFramedChannel.this) { receivers.remove(channel); + if (channel == receiver) { + receiver = null; + if (receivesSuspended) { + AbstractFramedChannel.this.channel.getSourceChannel().suspendReads(); + } else { + AbstractFramedChannel.this.channel.getSourceChannel().resumeReads(); + } + } } } - /** * {@link org.xnio.ChannelListener} which delegates the read notification to the appropriate listener */ @@ -731,14 +620,21 @@ @Override public void handleEvent(final StreamSourceChannel channel) { final R receiver = AbstractFramedChannel.this.receiver; - if ((isLastFrameReceived() || receivesSuspended) && receiver == null) { + if (receiver != null) { + invokeReadListener(channel, receiver); + } else if (isLastFrameReceived() || receivesSuspended) { channel.suspendReads(); return; } else { final ChannelListener listener = receiveSetter.get(); if (listener != null) { WebSocketLogger.REQUEST_LOGGER.debugf("Invoking receive listener", receiver); ChannelListeners.invokeChannelListener(AbstractFramedChannel.this, listener); + if (AbstractFramedChannel.this.receiver != null) { + //successful receive + //now invoke the read listener if necessary for performance reasons + invokeReadListener(channel, AbstractFramedChannel.this.receiver); + } } else { channel.suspendReads(); } @@ -747,61 +643,49 @@ ChannelListeners.invokeChannelListener(channel.getIoThread(), channel, this); } } + + private void invokeReadListener(StreamSourceChannel channel, R receiver) { + final ChannelListener listener = ((SimpleSetter) receiver.getReadSetter()).get(); + if (listener != null) { + WebSocketLogger.REQUEST_LOGGER.debugf("Invoking read listener %s on %s", listener, receiver); + ChannelListeners.invokeChannelListener(receiver, listener); + } else { + WebSocketLogger.REQUEST_LOGGER.debugf("Suspending reads on channel %s due to no listener", receiver); + channel.suspendReads(); + } + } } private class FrameWriteListener implements ChannelListener { @Override public void handleEvent(final StreamSinkChannel channel) { - flushSenders(); + synchronized (AbstractFramedChannel.this) { + //first we invoke the write listeners + for (S sender : pendingFrames) { + if (sender.isWriteResumed()) { + ChannelListeners.invokeChannelListener(sender, sender.getWriteListener()); + } + } + if (pendingFrames.isEmpty()) { + channel.suspendWrites(); + } + } } } /** * close listener, just goes through and activates any sub channels to make sure their listeners are invoked */ - private class FrameCloseListener implements ChannelListener { + private class FrameCloseListener implements ChannelListener { - private boolean sinkClosed; - private boolean sourceClosed; - @Override - public void handleEvent(final CloseableChannel c) { - if(c instanceof StreamSinkChannel) { - sinkClosed = true; - } else if(c instanceof StreamSourceChannel) { - sourceClosed = true; - } - if(!sourceClosed || !sinkClosed) { - return; //both sides need to be closed - } else if(readData != null) { - //we make sure there is no data left to receive, if there is then we invoke the receive listener - final ChannelListener listener = receiveSetter.get(); - if(listener != null) { - channel.getIoThread().execute(new Runnable() { - @Override - public void run() { - while (readData != null) { - int rem = readData.getResource().remaining(); - ChannelListeners.invokeChannelListener(AbstractFramedChannel.this, (ChannelListener) receiveSetter.get()); - if(readData != null && rem == readData.getResource().remaining()) { - readData.free(); - readData = null; - break;//make sure we are making progress - } - } - handleEvent(c); - } - }); - } - return; - } - - if (Thread.currentThread() != c.getIoThread()) { + public void handleEvent(final StreamSinkChannel c) { + if(Thread.currentThread() != c.getIoThread()) { ChannelListeners.invokeChannelListener(c.getIoThread(), c, this); return; } - R receiver = AbstractFramedChannel.this.receiver; try { + R receiver = AbstractFramedChannel.this.receiver; if (receiver != null && receiver.isOpen() && receiver.isReadResumed()) { ChannelListeners.invokeChannelListener(receiver, ((SimpleSetter) receiver.getReadSetter()).get()); } @@ -818,25 +702,19 @@ //if this was a clean shutdown there should not be any senders channel.markBroken(); } - for(AbstractFramedStreamSourceChannel r : new ArrayList<>(receivers)) { - IoUtils.safeClose(r); - } } } finally { - try { - for (ChannelListener task : closeTasks) { - ChannelListeners.invokeChannelListener((C) AbstractFramedChannel.this, task); + synchronized (AbstractFramedChannel.this) { + for (R r : receivers) { + IoUtils.safeClose(r); } - } finally { - synchronized (AbstractFramedChannel.this) { - closeSubChannels(); - if (readData != null) { - readData.free(); - readData = null; - } + if (readData != null) { + readData.free(); + readData = null; } - ChannelListeners.invokeChannelListener((C) AbstractFramedChannel.this, closeSetter.get()); } + ChannelListeners.invokeChannelListener((C) AbstractFramedChannel.this, closeSetter.get()); + } } } @@ -853,16 +731,8 @@ return framePriority; } - public void addCloseTask(final ChannelListener task) { - closeTasks.add(task); - } - @Override public String toString() { return getClass().getSimpleName() + "[ " + (receiver == null ? "No Receiver" : receiver.toString()) + " " + pendingFrames.toString() + " -- " + heldFrames.toString() + " -- " + newFrames.toString() + "]"; } - - protected StreamConnection getUnderlyingConnection() { - return channel; - } } Index: 3rdParty_sources/undertow/io/undertow/server/protocol/framed/AbstractFramedStreamSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/framed/Attic/AbstractFramedStreamSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/framed/AbstractFramedStreamSinkChannel.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/framed/AbstractFramedStreamSinkChannel.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,24 +1,5 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.framed; -import io.undertow.UndertowLogger; import io.undertow.UndertowMessages; import io.undertow.util.ImmediatePooled; import org.xnio.Buffers; @@ -42,6 +23,7 @@ import static org.xnio.Bits.allAreClear; import static org.xnio.Bits.allAreSet; +import static org.xnio.Bits.anyAreClear; import static org.xnio.Bits.anyAreSet; /** @@ -50,62 +32,41 @@ * Thread safety notes: *

    * The general contract is that this channel is only to be used by a single thread at a time. The only exception to this is - * during flush. A flush will only happen when {@link #readyForFlush} is set, and while this bit is set the buffer + * during flush. A flush will only happen when {@link #STATE_READY_FOR_FLUSH} is set, and while this bit is set the buffer * must not be modified. * * @author Stuart Douglas */ public abstract class AbstractFramedStreamSinkChannel, R extends AbstractFramedStreamSourceChannel, S extends AbstractFramedStreamSinkChannel> implements StreamSinkChannel { - private static final Pooled EMPTY_BYTE_BUFFER = new ImmediatePooled<>(ByteBuffer.allocateDirect(0)); + private static final Pooled EMPTY_BYTE_BUFFER = new ImmediatePooled(ByteBuffer.allocateDirect(0)); - private Pooled buffer; + private final Pooled buffer; private final C channel; - private final ChannelListener.SimpleSetter writeSetter = new ChannelListener.SimpleSetter<>(); - private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter<>(); + private final ChannelListener.SimpleSetter writeSetter = new ChannelListener.SimpleSetter(); + private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter(); private final Object lock = new Object(); - /** - * the state variable, this must only be access by the thread that 'owns' the channel - */ private volatile int state = 0; - /** - * If this channel is ready for flush, updated by multiple threads. In general it will be set by the thread - * that 'owns' the channel, and cleared by the IO thread - */ - private volatile boolean readyForFlush; + private Pooled header; + private Pooled trailer; - /** - * If all the data has been written out and the channel has been fully flushed - */ - private volatile boolean fullyFlushed; + private static final int STATE_BROKEN = 1; + private static final int STATE_READY_FOR_FLUSH = 1 << 1; + private static final int STATE_CLOSED = 1 << 2; + private static final int STATE_ACTIVE = 1 << 3; + private static final int STATE_WRITES_RESUMED = 1 << 4; + private static final int STATE_WRITES_SHUTDOWN = 1 << 5; + private static final int STATE_IN_LISTENER_LOOP = 1 << 6; /** - * If the last frame has been queued. - * - * Note that this may not actually be the final frame in some circumstances, e.g. if the final frame - * is two large to fit in the flow control window. In this case the flag may be cleared after flush is complete. + * writes are shutdown, data has been written, but flush has not been called */ - private volatile boolean finalFrameQueued; + private static final int STATE_FULLY_FLUSHED = 1 << 7; + private static final int STATE_FINAL_FRAME_QUEUED = 1 << 8; - /** - * If this channel is broken, updated by multiple threads - */ - private volatile boolean broken; - private volatile int waiterCount = 0; - - private SendFrameHeader header; - private Pooled trailer; - - private static final int STATE_CLOSED = 1; - private static final int STATE_WRITES_RESUMED = 1 << 1; - private static final int STATE_WRITES_SHUTDOWN = 1 << 2; - private static final int STATE_IN_LISTENER_LOOP = 1 << 3; - private static final int STATE_FIRST_DATA_WRITTEN = 1 << 4; - - protected AbstractFramedStreamSinkChannel(C channel) { this.channel = channel; this.buffer = channel.getBufferPool().allocate(); @@ -122,31 +83,27 @@ @Override public void suspendWrites() { state &= ~STATE_WRITES_RESUMED; + if (anyAreSet(state, STATE_ACTIVE)) { + channel.suspendWrites(); + } } /** * Returns the header for the current frame. * - * This consists of the frame data, and also an integer specifying how much data is remaining in the buffer. - * If this is non-zero then this method must adjust the buffers limit accordingly. - * - * It is expected that this will be used when limits on the size of a data frame prevent the whole buffer from - * being sent at once. - * - * * @return The header for the current frame, or null */ - final SendFrameHeader getFrameHeader() throws IOException { + final ByteBuffer getFrameHeader() { if (header == null) { header = createFrameHeader(); if (header == null) { - header = new SendFrameHeader(0, null); + header = EMPTY_BYTE_BUFFER; } } - return header; + return header.getResource(); } - protected SendFrameHeader createFrameHeader() throws IOException{ + protected Pooled createFrameHeader() { return null; } @@ -170,135 +127,110 @@ } @Override + public void resumeWrites() { + resumeWrites(false); + } + + @Override public boolean isWriteResumed() { return anyAreSet(state, STATE_WRITES_RESUMED); } @Override public void wakeupWrites() { - resumeWritesInternal(true); + resumeWrites(true); } - @Override - public void resumeWrites() { - resumeWritesInternal(false); - } - - protected void resumeWritesInternal(boolean wakeup) { - boolean alreadyResumed = anyAreSet(state, STATE_WRITES_RESUMED); - if(!wakeup && alreadyResumed) { - return; - } + void resumeWrites(final boolean wakeup) { state |= STATE_WRITES_RESUMED; - if(readyForFlush && !wakeup) { - //we already have data queued to be flushed - return; - } + if (anyAreSet(state, STATE_ACTIVE)) { + if (wakeup) { + channel.wakeupWrites(); + } else { + channel.resumeWrites(); + } + } else { - if (!anyAreSet(state, STATE_IN_LISTENER_LOOP)) { - state |= STATE_IN_LISTENER_LOOP; - getIoThread().execute(new Runnable() { + if (!anyAreSet(state, STATE_IN_LISTENER_LOOP)) { + getIoThread().execute(new Runnable() { - int loopCount = 0; - - @Override - public void run() { - try { - ChannelListener listener = getWriteListener(); - if (listener == null || !isWriteResumed()) { - return; + @Override + public void run() { + state |= STATE_IN_LISTENER_LOOP; + try { + do { + ChannelListener listener = getWriteListener(); + if (listener == null || !isWriteResumed()) { + return; + } + ChannelListeners.invokeChannelListener((S) AbstractFramedStreamSinkChannel.this, listener); + //if writes are shutdown or we become active then we stop looping + //we stop when writes are shutdown because we can't flush until we are active + //although we may be flushed as part of a batch + } + while (allAreClear(state, STATE_ACTIVE | STATE_CLOSED | STATE_BROKEN | STATE_READY_FOR_FLUSH) && (anyAreSet(state, STATE_FULLY_FLUSHED) || buffer.getResource().hasRemaining())); + } finally { + state &= ~STATE_IN_LISTENER_LOOP; } - if(loopCount++ == 100) { - //should never happen - UndertowLogger.ROOT_LOGGER.listenerNotProgressing(); - IoUtils.safeClose(AbstractFramedStreamSinkChannel.this); - return; - } - ChannelListeners.invokeChannelListener((S) AbstractFramedStreamSinkChannel.this, listener); - //if writes are shutdown or we become active then we stop looping - //we stop when writes are shutdown because we can't flush until we are active - //although we may be flushed as part of a batch - - if (allAreSet(state, STATE_WRITES_RESUMED) && allAreClear(state, STATE_CLOSED) && !broken && !readyForFlush && !fullyFlushed) { - getIoThread().execute(this); - } - } finally { - state &= ~STATE_IN_LISTENER_LOOP; } - } - }); + }); + } } - } @Override public void shutdownWrites() throws IOException { - if(anyAreSet(state, STATE_WRITES_SHUTDOWN) || broken ) { - return; - } state |= STATE_WRITES_SHUTDOWN; queueFinalFrame(); } private void queueFinalFrame() throws IOException { - if (!readyForFlush && !fullyFlushed && allAreClear(state, STATE_CLOSED) && !broken && !finalFrameQueued) { - readyForFlush = true; + if (allAreClear(state, STATE_READY_FOR_FLUSH | STATE_FINAL_FRAME_QUEUED)) { buffer.getResource().flip(); - state |= STATE_FIRST_DATA_WRITTEN; - finalFrameQueued = true; + state |= STATE_READY_FOR_FLUSH | STATE_FINAL_FRAME_QUEUED; channel.queueFrame((S) this); } } protected boolean isFinalFrameQueued() { - return finalFrameQueued; + return anyAreSet(state, STATE_FINAL_FRAME_QUEUED); } @Override public void awaitWritable() throws IOException { - if(Thread.currentThread() == getIoThread()) { - throw UndertowMessages.MESSAGES.awaitCalledFromIoThread(); - } synchronized (lock) { - if (anyAreSet(state, STATE_CLOSED) || broken) { + if (anyAreSet(state, STATE_BROKEN | STATE_CLOSED)) { return; } - if (readyForFlush) { + if (anyAreSet(state, STATE_ACTIVE)) { + channel.awaitWritable(); + } else if (anyAreSet(state, STATE_READY_FOR_FLUSH)) { try { - waiterCount++; - //we need to re-check after incrementing the waiters count - - if(readyForFlush && !anyAreSet(state, STATE_CLOSED) && !broken) { - lock.wait(); - } + lock.wait(); } catch (InterruptedException e) { throw new InterruptedIOException(); - } finally { - waiterCount--; } } } } @Override public void awaitWritable(long l, TimeUnit timeUnit) throws IOException { - if(Thread.currentThread() == getIoThread()) { - throw UndertowMessages.MESSAGES.awaitCalledFromIoThread(); - } synchronized (lock) { - if (anyAreSet(state, STATE_CLOSED) || broken) { + if (anyAreSet(state, STATE_BROKEN | STATE_CLOSED)) { return; } - if (readyForFlush) { + if (anyAreSet(state, STATE_ACTIVE)) { + channel.awaitWritable(l, timeUnit); + } else if (anyAreSet(state, STATE_READY_FOR_FLUSH)) { try { - waiterCount++; - if(readyForFlush && !anyAreSet(state, STATE_CLOSED) && !broken) { - lock.wait(timeUnit.toMillis(l)); + if (anyAreSet(state, STATE_BROKEN | STATE_CLOSED)) { + return; } + + lock.wait(timeUnit.toMillis(l)); } catch (InterruptedException e) { throw new InterruptedIOException(); - } finally { - waiterCount--; } } } @@ -310,12 +242,12 @@ } @Override - public ChannelListener.Setter getWriteSetter() { + public ChannelListener.Setter getWriteSetter() { return writeSetter; } @Override - public ChannelListener.Setter getCloseSetter() { + public ChannelListener.Setter getCloseSetter() { return closeSetter; } @@ -331,37 +263,41 @@ @Override public boolean flush() throws IOException { - if(anyAreSet(state, STATE_CLOSED)) { - return true; - } - if (broken) { + if (anyAreSet(state, STATE_CLOSED | STATE_BROKEN)) { throw UndertowMessages.MESSAGES.channelIsClosed(); } - - if (readyForFlush) { - return false; - } - if (fullyFlushed) { + if (anyAreSet(state, STATE_FULLY_FLUSHED)) { state |= STATE_CLOSED; return true; } - if (anyAreSet(state, STATE_WRITES_SHUTDOWN) && !finalFrameQueued) { + if (anyAreSet(state, STATE_WRITES_SHUTDOWN) && anyAreClear(state, STATE_FINAL_FRAME_QUEUED)) { queueFinalFrame(); - return false; } - if(anyAreSet(state, STATE_WRITES_SHUTDOWN)) { + //we only flush if we are active + if (allAreSet(state, STATE_ACTIVE)) { + channel.flushSenders(); + if (allAreSet(state, STATE_FINAL_FRAME_QUEUED | STATE_FULLY_FLUSHED)) { + state |= STATE_CLOSED; + return true; + } + } + if (allAreSet(state, STATE_WRITES_SHUTDOWN)) { return false; } - return true; + return true; //todo: should this return true of false? } @Override public long write(ByteBuffer[] srcs, int offset, int length) throws IOException { int state = this.state; - if (readyForFlush) { + if (anyAreSet(state, STATE_READY_FOR_FLUSH)) { + flush(); + state = this.state; + } + if (anyAreSet(state, STATE_READY_FOR_FLUSH)) { return 0; //we can't do anything, we are waiting for a flush } - if (anyAreSet(state, STATE_CLOSED | STATE_WRITES_SHUTDOWN) || broken) { + if (anyAreSet(state, STATE_BROKEN | STATE_CLOSED | STATE_WRITES_SHUTDOWN)) { throw UndertowMessages.MESSAGES.channelIsClosed(); } long copied = Buffers.copy(this.buffer.getResource(), srcs, offset, length); @@ -379,10 +315,14 @@ @Override public int write(ByteBuffer src) throws IOException { int state = this.state; - if (readyForFlush) { + if (anyAreSet(state, STATE_READY_FOR_FLUSH)) { + flush(); + state = this.state; + } + if (anyAreSet(state, STATE_READY_FOR_FLUSH)) { return 0; //we can't do anything, we are waiting for a flush } - if (anyAreSet(state, STATE_CLOSED | STATE_WRITES_SHUTDOWN) || broken) { + if (anyAreSet(state, STATE_BROKEN | STATE_CLOSED | STATE_WRITES_SHUTDOWN)) { throw UndertowMessages.MESSAGES.channelIsClosed(); } int copied = Buffers.copy(this.buffer.getResource(), src); @@ -408,12 +348,14 @@ } private void handleBufferFull() throws IOException { - if (!readyForFlush) { - readyForFlush = true; + if (allAreClear(state, STATE_READY_FOR_FLUSH)) { getBuffer().flip(); - state |= STATE_FIRST_DATA_WRITTEN; + state |= STATE_READY_FOR_FLUSH; channel.queueFrame((S) this); } + if (anyAreSet(state, STATE_ACTIVE)) { + channel.flushSenders(); + } } /** @@ -426,7 +368,7 @@ * as it may be written out by another thread. */ public boolean isReadyForFlush() { - return readyForFlush; + return anyAreSet(state, STATE_READY_FOR_FLUSH); } /** @@ -443,42 +385,11 @@ @Override public void close() throws IOException { - if(fullyFlushed || anyAreSet(state, STATE_CLOSED)) { - return; - } state |= STATE_CLOSED; buffer.free(); - buffer = null; - if(header != null && header.getByteBuffer() != null) { - header.getByteBuffer().free(); - } - if(trailer != null) { - trailer.free(); - } - if(anyAreSet(state, STATE_FIRST_DATA_WRITTEN)) { - channelForciblyClosed(); - } - //we need to wake up/invoke the write listener - if(isWriteResumed()) { - ChannelListeners.invokeChannelListener(getIoThread(), this, (ChannelListener)getWriteListener()); - } - wakeupWrites(); - } - - /** - * Called when a channel has been forcibly closed, and data (frames) have already been written. - * - * The action this should take is protocol dependent, e.g. for SPDY a RST_STREAM should be sent, - * for websockets the channel should be closed. - * - * By default this will just close the underlying channel - * - * @throws IOException - */ - protected void channelForciblyClosed() throws IOException { - if(isFirstDataWritten()) { - getChannel().markWritesBroken(null); - } + //TODO: need to think about this more + //if the frame has had nothing written out it should not break the parent channel + channel.close(); wakeupWaiters(); } @@ -502,105 +413,91 @@ } /** - * Method that is invoked when a frame has been fully flushed. This method is only invoked by the IO thread + * Method that is invoked when a frame has been fully flushed */ final void flushComplete() throws IOException { try { - int remaining = header.getRemainingInBuffer(); - boolean finalFrame = finalFrameQueued; - boolean channelClosed = finalFrame && remaining == 0 && !header.isAnotherFrameRequired(); - if(remaining > 0) { - buffer.getResource().limit(buffer.getResource().limit() + remaining); - if(finalFrame) { - //we clear the final frame flag, as it could not actually be written out - //note that we don't attempt to requeue, as whatever stopped it from being written will likely still - //be an issue - this.finalFrameQueued = false; - } - } else if(header.isAnotherFrameRequired()) { - this.finalFrameQueued = false; - } + state &= ~(STATE_READY_FOR_FLUSH | STATE_ACTIVE); + boolean channelClosed = anyAreSet(state, STATE_FINAL_FRAME_QUEUED); if (channelClosed) { - fullyFlushed = true; + state |= STATE_FULLY_FLUSHED; buffer.free(); - buffer = null; } else { - buffer.getResource().compact(); + buffer.getResource().clear(); } - if (header.getByteBuffer() != null) { - header.getByteBuffer().free(); + if(header != null) { + header.free(); } trailer.free(); header = null; trailer = null; - readyForFlush = false; - if (isWriteResumed() && !channelClosed) { - wakeupWrites(); - } else if(isWriteResumed()) { - //we need to execute the write listener one last time - //we need to dispatch it back to the IO thread, so we don't invoke it recursivly - ChannelListeners.invokeChannelListener(getIoThread(), (S)this, getWriteListener()); - } - final ChannelListener closeListener = this.closeSetter.get(); if (channelClosed && closeListener != null) { - ChannelListeners.invokeChannelListener(getIoThread(), (S) AbstractFramedStreamSinkChannel.this, closeListener); + getIoThread().execute(new Runnable() { + @Override + public void run() { + ChannelListeners.invokeChannelListener((S) AbstractFramedStreamSinkChannel.this, closeListener); + } + }); } - handleFlushComplete(channelClosed); + if (isWriteResumed() && !channelClosed) { + wakeupWrites(); + } + handleFlushComplete(); } finally { wakeupWaiters(); } } - protected void handleFlushComplete(boolean finalFrame) { + protected void handleFlushComplete() { } - protected boolean isFirstDataWritten() { - return anyAreSet(state, STATE_FIRST_DATA_WRITTEN); - } - public void markBroken() { - this.broken = true; - try { - wakeupWrites(); - wakeupWaiters(); - if (isWriteResumed()) { - ChannelListener writeListener = this.writeSetter.get(); - if (writeListener != null) { - ChannelListeners.invokeChannelListener(getIoThread(), (S) this, writeListener); - } + this.state |= STATE_BROKEN; + wakeupWrites(); + wakeupWaiters(); + if (isWriteResumed()) { + ChannelListener writeListener = this.writeSetter.get(); + if (writeListener != null) { + ChannelListeners.invokeChannelListener(getIoThread(), (S) this, writeListener); } - ChannelListener closeListener = this.closeSetter.get(); - if (closeListener != null) { - ChannelListeners.invokeChannelListener(getIoThread(), (S) this, closeListener); - } - } finally { - if(header != null && header.getByteBuffer() != null) { - header.getByteBuffer().free(); - } - if(trailer != null) { - trailer.free(); - } - if(buffer != null) { - buffer.free(); - } } + ChannelListener closeListener = this.closeSetter.get(); + if (closeListener != null) { + ChannelListeners.invokeChannelListener(getIoThread(), (S) this, closeListener); + } } ChannelListener getWriteListener() { return writeSetter.get(); } - private void wakeupWaiters() { - if(waiterCount > 0) { - synchronized (lock) { - lock.notifyAll(); + /** + * Method than is called when the sender is the first sender in the queued channel. This can be called from any thread, + * and may be called even if the channel is already activated. + */ + void activated() { + if (allAreClear(state, STATE_ACTIVE)) { + state |= STATE_ACTIVE; + if (isWriteResumed()) { + channel.resumeWrites(); } + wakeupWaiters(); } } + private void wakeupWaiters() { + synchronized (lock) { + lock.notifyAll(); + } + } + + protected boolean isActivated() { + return anyAreSet(state, STATE_ACTIVE); + } + public C getChannel() { return channel; } Index: 3rdParty_sources/undertow/io/undertow/server/protocol/framed/AbstractFramedStreamSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/framed/Attic/AbstractFramedStreamSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/framed/AbstractFramedStreamSourceChannel.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/framed/AbstractFramedStreamSourceChannel.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,39 +1,8 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.framed; -import static org.xnio.Bits.allAreClear; -import static org.xnio.Bits.allAreSet; -import static org.xnio.Bits.anyAreSet; - -import java.io.IOException; -import java.io.InterruptedIOException; -import java.nio.ByteBuffer; -import java.nio.channels.ClosedChannelException; -import java.nio.channels.FileChannel; -import java.util.Deque; -import java.util.LinkedList; -import java.util.concurrent.TimeUnit; import org.xnio.Buffers; import org.xnio.ChannelListener; import org.xnio.ChannelListeners; -import org.xnio.IoUtils; import org.xnio.Option; import org.xnio.Pooled; import org.xnio.XnioExecutor; @@ -42,8 +11,17 @@ import org.xnio.channels.StreamSinkChannel; import org.xnio.channels.StreamSourceChannel; -import io.undertow.UndertowMessages; +import java.io.IOException; +import java.io.InterruptedIOException; +import java.nio.ByteBuffer; +import java.nio.channels.FileChannel; +import java.util.Deque; +import java.util.LinkedList; +import java.util.concurrent.TimeUnit; +import static org.xnio.Bits.allAreClear; +import static org.xnio.Bits.anyAreSet; + /** * Source channel, used to receive framed messages. * @@ -54,8 +32,13 @@ private final ChannelListener.SimpleSetter readSetter = new ChannelListener.SimpleSetter(); private final ChannelListener.SimpleSetter closeSetter = new ChannelListener.SimpleSetter(); - private final C framedChannel; - private final Deque pendingFrameData = new LinkedList<>(); + /** + * The underlying channel. Should not be used directly unless the data + * buffer is null and {@link #frameDataRemaining} is non-zero. + */ + private final StreamSourceChannel underlying; + private final AbstractFramedChannel framedChannel; + private final Deque pendingFrameData = new LinkedList(); private int state = 0; @@ -64,7 +47,6 @@ private static final int STATE_CLOSED = 1 << 3; private static final int STATE_LAST_FRAME = 1 << 4; private static final int STATE_IN_LISTENER_LOOP = 1 << 5; - private static final int STATE_STREAM_BROKEN = 1 << 6; /** @@ -81,27 +63,19 @@ private int waiters; private volatile boolean waitingForFrame; private int readFrameCount = 0; - private long maxStreamSize = -1; - private long currentStreamSize; - public AbstractFramedStreamSourceChannel(C framedChannel) { + public AbstractFramedStreamSourceChannel(AbstractFramedChannel framedChannel) { + this.underlying = framedChannel.getSourceChannel(); this.framedChannel = framedChannel; this.waitingForFrame = true; } - public AbstractFramedStreamSourceChannel(C framedChannel, Pooled data, long frameDataRemaining) { + public AbstractFramedStreamSourceChannel(AbstractFramedChannel framedChannel, Pooled data, long frameDataRemaining) { + this.underlying = framedChannel.getSourceChannel(); this.framedChannel = framedChannel; this.waitingForFrame = data == null && frameDataRemaining <= 0; this.data = data; this.frameDataRemaining = frameDataRemaining; - this.currentStreamSize = frameDataRemaining; - if (data != null) { - if (!data.getResource().hasRemaining()) { - data.free(); - this.data = null; - this.waitingForFrame = frameDataRemaining <= 0; - } - } } @Override @@ -128,6 +102,14 @@ } finally { data.getResource().limit(old); } + } else if (frameDataRemaining > 0) { + long toTransfer = count; + if (toTransfer > frameDataRemaining) { + toTransfer = frameDataRemaining; + } + long written = underlying.transferTo(position, toTransfer, target); + frameDataRemaining -= written; + return written; } return 0; } finally { @@ -142,16 +124,14 @@ } beforeRead(); if (waitingForFrame) { - throughBuffer.position(throughBuffer.limit()); return 0; } try { if (frameDataRemaining == 0 && anyAreSet(state, STATE_LAST_FRAME)) { return -1; - } else if (data != null && data.getResource().hasRemaining()) { + } else if (data != null) { int old = data.getResource().limit(); try { - throughBuffer.position(throughBuffer.limit()); if (count < data.getResource().remaining()) { data.getResource().limit((int) (data.getResource().position() + count)); } @@ -161,32 +141,21 @@ } finally { data.getResource().limit(old); } - } else { - throughBuffer.position(throughBuffer.limit()); + } else if (frameDataRemaining > 0) { + long toTransfer = count; + if (toTransfer > frameDataRemaining) { + toTransfer = frameDataRemaining; + } + long written = underlying.transferTo(toTransfer, throughBuffer, streamSinkChannel); + frameDataRemaining -= written; + return written; } return 0; } finally { exitRead(); } } - public long getMaxStreamSize() { - return maxStreamSize; - } - - public void setMaxStreamSize(long maxStreamSize) { - this.maxStreamSize = maxStreamSize; - if(maxStreamSize > 0) { - if(maxStreamSize < currentStreamSize) { - handleStreamTooLarge(); - } - } - } - - private void handleStreamTooLarge() { - IoUtils.safeClose(this); - } - @Override public void suspendReads() { state &= ~STATE_READS_RESUMED; @@ -207,7 +176,7 @@ @Override public void resumeReads() { - resumeReadsInternal(false); + resumeReads(false); } @Override @@ -217,24 +186,25 @@ @Override public void wakeupReads() { - resumeReadsInternal(true); + resumeReads(true); } - /** - * For this class there is no difference between a resume and a wakeup - */ - void resumeReadsInternal(boolean wakeup) { - boolean alreadyResumed = anyAreSet(state, STATE_READS_RESUMED); + void resumeReads(final boolean wakeup) { state |= STATE_READS_RESUMED; - if(!alreadyResumed || wakeup) { + if (data == null && frameDataRemaining > 0) { + if (wakeup) { + underlying.wakeupReads(); + } else { + underlying.resumeReads(); + } + } else { if (!anyAreSet(state, STATE_IN_LISTENER_LOOP)) { - state |= STATE_IN_LISTENER_LOOP; getIoThread().execute(new Runnable() { @Override public void run() { + state |= STATE_IN_LISTENER_LOOP; try { - boolean moreData; do { ChannelListener listener = getReadListener(); if (listener == null || !isReadResumed()) { @@ -244,8 +214,7 @@ //if writes are shutdown or we become active then we stop looping //we stop when writes are shutdown because we can't flush until we are active //although we may be flushed as part of a batch - moreData = (frameDataRemaining > 0 && data != null) || !pendingFrameData.isEmpty(); - } while (allAreSet(state, STATE_READS_RESUMED) && allAreClear(state, STATE_CLOSED) && moreData); + } while (allAreClear(state, STATE_CLOSED) && frameDataRemaining > 0); } finally { state &= ~STATE_IN_LISTENER_LOOP; } @@ -266,30 +235,25 @@ protected void lastFrame() { state |= STATE_LAST_FRAME; - waitingForFrame = false; - if(data == null && pendingFrameData.isEmpty() && frameDataRemaining == 0) { - state |= STATE_DONE | STATE_CLOSED; - getFramedChannel().notifyFrameReadComplete(this); - getFramedChannel().notifyClosed(this); - } } @Override public void awaitReadable() throws IOException { - if(Thread.currentThread() == getIoThread()) { - throw UndertowMessages.MESSAGES.awaitCalledFromIoThread(); - } - if (data == null && pendingFrameData.isEmpty()) { - synchronized (lock) { - if (data == null && pendingFrameData.isEmpty()) { - try { - waiters++; - lock.wait(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new InterruptedIOException(); - } finally { - waiters--; + if (data == null) { + if (frameDataRemaining > 0) { + underlying.awaitReadable(); + } else { + synchronized (lock) { + if (data == null) { + try { + waiters++; + lock.wait(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new InterruptedIOException(); + } finally { + waiters--; + } } } } @@ -298,69 +262,53 @@ @Override public void awaitReadable(long l, TimeUnit timeUnit) throws IOException { - if(Thread.currentThread() == getIoThread()) { - throw UndertowMessages.MESSAGES.awaitCalledFromIoThread(); - } if (data == null) { - synchronized (lock) { - if (data == null) { - try { - waiters++; - lock.wait(timeUnit.toMillis(l)); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new InterruptedIOException(); - } finally { - waiters--; + if (frameDataRemaining > 0) { + underlying.awaitReadable(l, timeUnit); + } else { + synchronized (lock) { + if (data == null) { + try { + waiters++; + lock.wait(timeUnit.toMillis(l)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new InterruptedIOException(); + } finally { + waiters--; + } } } } } } - /** - * Called when data has been read from the underlying channel. - * - * @param headerData The frame header data. This may be null if the data is part of a an existing frame - * @param frameData The frame data - */ void dataReady(FrameHeaderData headerData, Pooled frameData) { - if(anyAreSet(state, STATE_STREAM_BROKEN)) { - frameData.free(); - return; - } synchronized (lock) { - boolean newData = pendingFrameData.isEmpty(); - this.pendingFrameData.add(new FrameData(headerData, frameData)); - if (newData) { + if (this.frameDataRemaining == 0 && pendingFrameData.isEmpty()) { + this.data = frameData; + this.frameDataRemaining = headerData.getFrameLength(); if (waiters > 0) { lock.notifyAll(); } + handleHeaderData(headerData); + if (anyAreSet(state, STATE_READS_RESUMED)) { + resumeReads(false); + } + waitingForFrame = false; + } else { + this.pendingFrameData.add(new FrameData(headerData, frameData)); } - waitingForFrame = false; } - if (anyAreSet(state, STATE_READS_RESUMED)) { - resumeReadsInternal(true); - } - if(headerData != null) { - currentStreamSize += headerData.getFrameLength(); - if(maxStreamSize > 0 && currentStreamSize > maxStreamSize) { - handleStreamTooLarge(); - } - } } - protected long handleFrameData(Pooled frameData, long frameDataRemaining) { - return frameDataRemaining; - } - protected void handleHeaderData(FrameHeaderData headerData) { } @Override public XnioExecutor getReadThread() { - return framedChannel.getIoThread(); + return underlying.getIoThread(); } @Override @@ -375,12 +323,12 @@ @Override public XnioWorker getWorker() { - return framedChannel.getWorker(); + return underlying.getWorker(); } @Override public XnioIoThread getIoThread() { - return framedChannel.getIoThread(); + return underlying.getIoThread(); } @Override @@ -425,6 +373,35 @@ } finally { data.getResource().limit(old); } + } else if (frameDataRemaining > 0) { + long toTransfer = Buffers.remaining(dsts, offset, length); + if (toTransfer > frameDataRemaining) { + toTransfer = frameDataRemaining; + } + int lim; + // The total amount of buffer space discovered so far. + long t = 0L; + for (int i = 0; i < length; i++) { + final ByteBuffer buffer = dsts[i + offset]; + // Grow the discovered buffer space by the remaining size of the current buffer. + // We want to capture the limit so we calculate "remaining" ourselves. + t += (lim = buffer.limit()) - buffer.position(); + if (t > toTransfer) { + // only read up to this point, and trim the last buffer by the number of extra bytes + buffer.limit(lim - (int) (t - toTransfer)); + try { + long read = underlying.read(dsts, offset, i + 1); + frameDataRemaining -= read; + return read; + } finally { + // restore the original limit + buffer.limit(lim); + } + } + } + long read = underlying.read(dsts, offset, length); + frameDataRemaining -= read; + return read; } return 0; } finally { @@ -442,7 +419,7 @@ if (anyAreSet(state, STATE_DONE)) { return -1; } - if (!dst.hasRemaining()) { + if(!dst.hasRemaining()) { return 0; } beforeRead(); @@ -467,36 +444,33 @@ } finally { data.getResource().limit(old); } + } else if (frameDataRemaining > 0) { + int old = dst.limit(); + try { + if (dst.remaining() > frameDataRemaining) { + dst.limit((int) (dst.position() + frameDataRemaining)); + } + int written = underlying.read(dst); + frameDataRemaining -= written; + return written; + } finally { + dst.limit(old); + } } return 0; } finally { exitRead(); } } - private void beforeRead() throws ClosedChannelException { - if (anyAreSet(state, STATE_STREAM_BROKEN)) { - throw UndertowMessages.MESSAGES.channelIsClosed(); - } - if (data == null) { + private void beforeRead() { + if (frameDataRemaining == 0) { synchronized (lock) { FrameData pending = pendingFrameData.poll(); if (pending != null) { - Pooled frameData = pending.getFrameData(); - boolean hasData = true; - if(frameData.getResource().hasRemaining()) { - this.data = frameData; - } else { - frameData.free(); - hasData = false; - } - if (pending.getFrameHeaderData() != null) { - this.frameDataRemaining = pending.getFrameHeaderData().getFrameLength(); - handleHeaderData(pending.getFrameHeaderData()); - } - if(hasData) { - this.frameDataRemaining = handleFrameData(frameData, frameDataRemaining); - } + this.data = pending.getFrameData(); + this.frameDataRemaining = pending.getFrameHeaderData().getFrameLength(); + handleHeaderData(pending.getFrameHeaderData()); } } } @@ -508,23 +482,20 @@ data = null; } if (frameDataRemaining == 0) { - try { - synchronized (lock) { - readFrameCount++; - if (pendingFrameData.isEmpty()) { + synchronized (lock) { + readFrameCount++; + if (pendingFrameData.isEmpty()) { + try { if (anyAreSet(state, STATE_LAST_FRAME)) { state |= STATE_DONE; - getFramedChannel().notifyClosed(this); complete(); } else { waitingForFrame = true; } + } finally { + framedChannel.notifyFrameReadComplete(this); } } - } finally { - if (pendingFrameData.isEmpty()) { - framedChannel.notifyFrameReadComplete(this); - } } } } @@ -536,60 +507,24 @@ @Override public void close() throws IOException { - if(anyAreSet(state, STATE_CLOSED)) { - return; - } state |= STATE_CLOSED; - if (allAreClear(state, STATE_DONE | STATE_LAST_FRAME)) { - state |= STATE_STREAM_BROKEN; - getFramedChannel().notifyClosed(this); - channelForciblyClosed(); + if (allAreClear(state, STATE_DONE)) { + framedChannel.markReadsBroken(null); } - if (data != null) { + if(data != null) { data.free(); - data = null; } - while (!pendingFrameData.isEmpty()) { - pendingFrameData.poll().frameData.free(); - } - ChannelListeners.invokeChannelListener(this, (ChannelListener>) closeSetter.get()); + ChannelListeners.invokeChannelListener(this, (ChannelListener>) closeSetter.get()); } - protected void channelForciblyClosed() { - //TODO: what should be the default action? - //we can probably just ignore it, as it does not affect the underlying protocol - } - - protected C getFramedChannel() { + protected AbstractFramedChannel getFramedChannel() { return framedChannel; } protected int getReadFrameCount() { return readFrameCount; } - /** - * Called when this stream is no longer valid. Reads from the stream will result - * in an exception. - */ - protected synchronized void markStreamBroken() { - state |= STATE_STREAM_BROKEN; - if(data != null) { - data.free(); - data = null; - } - for(FrameData frame : pendingFrameData) { - frame.frameData.free(); - } - pendingFrameData.clear(); - if(isReadResumed()) { - resumeReadsInternal(true); - } - if (waiters > 0) { - lock.notifyAll(); - } - } - private class FrameData { private final FrameHeaderData frameHeaderData; Index: 3rdParty_sources/undertow/io/undertow/server/protocol/framed/FrameHeaderData.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/framed/Attic/FrameHeaderData.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/framed/FrameHeaderData.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/framed/FrameHeaderData.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.framed; /** Index: 3rdParty_sources/undertow/io/undertow/server/protocol/framed/FramePriority.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/framed/Attic/FramePriority.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/framed/FramePriority.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/framed/FramePriority.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.framed; import java.util.Deque; @@ -53,9 +35,6 @@ * If frames in the held frame queue are now eligible to be sent they can be added * to the pending frames queue. * - * Note that if the protocol has explicitly asked for the held frames to be recalculated - * then the added frame may be null. - * * @param addedFrame The newly added frame * @param pendingFrames The pending frame queue * @param holdFrames The held frame queue Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/framed/SendFrameHeader.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpAttachments.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/HttpAttachments.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpAttachments.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpAttachments.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.http; import io.undertow.util.AttachmentKey; Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpContinue.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/HttpContinue.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpContinue.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpContinue.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.http; import io.undertow.UndertowMessages; @@ -51,7 +33,7 @@ * @return true if the server needs to send a continue response */ public static boolean requiresContinueResponse(final HttpServerExchange exchange) { - if (!exchange.isHttp11() || exchange.isResponseStarted()) { + if (!exchange.isHttp11()) { return false; } if (exchange.getConnection() instanceof HttpServerConnection) { @@ -161,12 +143,13 @@ try { responseChannel.shutdownWrites(); if (!responseChannel.flush()) { + exchange.dispatch(); responseChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener( new ChannelListener() { @Override public void handleEvent(StreamSinkChannel channel) { - channel.suspendWrites(); callback.onComplete(exchange, null); + channel.suspendWrites(); } }, new ChannelExceptionHandler() { @Override Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpOpenListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/HttpOpenListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpOpenListener.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpOpenListener.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,18 +9,17 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.http; import io.undertow.UndertowLogger; import io.undertow.UndertowMessages; -import io.undertow.UndertowOptions; import io.undertow.conduits.ReadTimeoutStreamSourceConduit; import io.undertow.conduits.WriteTimeoutStreamSinkConduit; import io.undertow.server.HttpHandler; @@ -63,7 +62,6 @@ parser = HttpRequestParser.instance(undertowOptions); } - @Override public void handleEvent(final StreamConnection channel) { if (UndertowLogger.REQUEST_LOGGER.isTraceEnabled()) { UndertowLogger.REQUEST_LOGGER.tracef("Opened connection with %s", channel.getPeerAddress()); @@ -72,24 +70,13 @@ //set read and write timeouts try { Integer readTimeout = channel.getOption(Options.READ_TIMEOUT); - Integer idleTimeout = undertowOptions.get(UndertowOptions.IDLE_TIMEOUT); - if ((readTimeout == null || readTimeout <= 0) && idleTimeout != null) { - readTimeout = idleTimeout; - } else if (readTimeout != null && idleTimeout != null && idleTimeout > 0) { - readTimeout = Math.min(readTimeout, idleTimeout); - } if (readTimeout != null && readTimeout > 0) { - channel.getSourceChannel().setConduit(new ReadTimeoutStreamSourceConduit(channel.getSourceChannel().getConduit(), channel, this)); + channel.getSourceChannel().setConduit(new ReadTimeoutStreamSourceConduit(channel.getSourceChannel().getConduit(), channel)); } Integer writeTimeout = channel.getOption(Options.WRITE_TIMEOUT); - if ((writeTimeout == null || writeTimeout <= 0) && idleTimeout != null) { - writeTimeout = idleTimeout; - } else if (writeTimeout != null && idleTimeout != null && idleTimeout > 0) { - writeTimeout = Math.min(writeTimeout, idleTimeout); + if (writeTimeout != 0 && writeTimeout > 0) { + channel.getSinkChannel().setConduit(new WriteTimeoutStreamSinkConduit(channel.getSinkChannel().getConduit(), channel)); } - if (writeTimeout != null && writeTimeout > 0) { - channel.getSinkChannel().setConduit(new WriteTimeoutStreamSinkConduit(channel.getSinkChannel().getConduit(), channel, this)); - } } catch (IOException e) { IoUtils.safeClose(channel); UndertowLogger.REQUEST_IO_LOGGER.ioException(e); Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpReadListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/HttpReadListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpReadListener.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpReadListener.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.http; @@ -23,16 +23,13 @@ import io.undertow.conduits.ReadDataStreamSourceConduit; import io.undertow.server.Connectors; import io.undertow.server.HttpServerExchange; -import io.undertow.util.ClosingChannelExceptionHandler; import io.undertow.util.StringWriteChannelListener; import org.xnio.ChannelListener; -import org.xnio.ChannelListeners; import org.xnio.IoUtils; import org.xnio.Pooled; import org.xnio.StreamConnection; import org.xnio.channels.StreamSinkChannel; import org.xnio.channels.StreamSourceChannel; -import org.xnio.conduits.ConduitStreamSinkChannel; import org.xnio.conduits.ConduitStreamSourceChannel; import java.io.IOException; @@ -71,7 +68,7 @@ this.connection = connection; this.parser = parser; this.maxRequestSize = connection.getUndertowOptions().get(UndertowOptions.MAX_HEADER_SIZE, UndertowOptions.DEFAULT_MAX_HEADER_SIZE); - this.maxEntitySize = connection.getUndertowOptions().get(UndertowOptions.MAX_ENTITY_SIZE, UndertowOptions.DEFAULT_MAX_ENTITY_SIZE); + this.maxEntitySize = connection.getUndertowOptions().get(UndertowOptions.MAX_ENTITY_SIZE, 0); this.recordRequestStartTime = connection.getUndertowOptions().get(UndertowOptions.RECORD_REQUEST_START_TIME, false); } @@ -271,22 +268,7 @@ if (connection.getExtraBytes() != null) { connection.getChannel().getSourceChannel().setConduit(new ReadDataStreamSourceConduit(connection.getChannel().getSourceChannel().getConduit(), connection)); } - try { - if (!connection.getChannel().getSinkChannel().flush()) { - connection.getChannel().getSinkChannel().setWriteListener(ChannelListeners.flushingChannelListener(new ChannelListener() { - @Override - public void handleEvent(ConduitStreamSinkChannel conduitStreamSinkChannel) { - connection.getUpgradeListener().handleUpgrade(connection.getChannel(), exchange); - } - }, new ClosingChannelExceptionHandler(connection))); - connection.getChannel().getSinkChannel().resumeWrites(); - return; - } - connection.getUpgradeListener().handleUpgrade(connection.getChannel(), exchange); - } catch (IOException e) { - UndertowLogger.REQUEST_IO_LOGGER.ioException(e); - IoUtils.safeClose(connection); - } + connection.getUpgradeListener().handleUpgrade(connection.getChannel(), exchange); } } Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpRequestParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/HttpRequestParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpRequestParser.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpRequestParser.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.http; @@ -816,7 +816,7 @@ * @return */ protected static Map httpStrings() { - final Map results = new HashMap<>(); + final Map results = new HashMap(); final Class[] classs = {Headers.class, Methods.class, Protocols.class}; for (Class c : classs) { Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpResponseConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/HttpResponseConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpResponseConduit.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpResponseConduit.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.http; @@ -30,15 +30,11 @@ import io.undertow.util.HeaderValues; import io.undertow.util.HttpString; import io.undertow.util.StatusCodes; - -import org.xnio.Buffers; -import org.xnio.IoUtils; import org.xnio.Pool; import org.xnio.Pooled; import org.xnio.XnioWorker; import org.xnio.channels.StreamSourceChannel; import org.xnio.conduits.AbstractStreamSinkConduit; -import org.xnio.conduits.ConduitWritableByteChannel; import org.xnio.conduits.Conduits; import org.xnio.conduits.StreamSinkConduit; @@ -63,7 +59,6 @@ private HttpServerExchange exchange; private ByteBuffer[] writevBuffer; - private boolean done = false; private static final int STATE_BODY = 0; // Message body, normal pass-through operation private static final int STATE_START = 1; // No headers written yet @@ -114,33 +109,22 @@ * @return * @throws IOException */ - private int processWrite(int state, final Object userData, int pos, int length) throws IOException { - if(done) { - throw new ClosedChannelException(); - } + private int processWrite(int state, final ByteBuffer userData) throws IOException { assert state != STATE_BODY; if (state == STATE_BUF_FLUSH) { final ByteBuffer byteBuffer = pooledBuffer.getResource(); do { long res = 0; ByteBuffer[] data; - if (userData == null || length == 0) { + if (userData == null) { res = next.write(byteBuffer); - } else if (userData instanceof ByteBuffer){ + } else { data = writevBuffer; if(data == null) { data = writevBuffer = new ByteBuffer[2]; } data[0] = byteBuffer; - data[1] = (ByteBuffer) userData; - res = next.write(data, 0, 2); - } else { - data = writevBuffer; - if(data == null || data.length < length + 1) { - data = writevBuffer = new ByteBuffer[length + 1]; - } - data[0] = byteBuffer; - System.arraycopy(userData, pos, data, 1, length); + data[1] = userData; res = next.write(data, 0, data.length); } if (res == 0) { @@ -150,7 +134,7 @@ bufferDone(); return STATE_BODY; } else if (state != STATE_START) { - return processStatefulWrite(state, userData, pos, length); + return processStatefulWrite(state, userData); } //merge the cookies into the header map @@ -197,7 +181,7 @@ this.charIndex = 0; this.state = STATE_HDR_NAME; buffer.flip(); - return processStatefulWrite(STATE_HDR_NAME, userData, pos, length); + return processStatefulWrite(STATE_HDR_NAME, userData); } header.appendTo(buffer); buffer.put((byte) ':').put((byte) ' '); @@ -212,7 +196,7 @@ this.charIndex = 0; this.state = STATE_HDR_VAL; buffer.flip(); - return processStatefulWrite(STATE_HDR_VAL, userData, pos ,length); + return processStatefulWrite(STATE_HDR_VAL, userData); } writeString(buffer, string); buffer.put((byte) '\r').put((byte) '\n'); @@ -226,21 +210,13 @@ ByteBuffer[] data; if (userData == null) { res = next.write(buffer); - } else if (userData instanceof ByteBuffer){ + } else { data = writevBuffer; if(data == null) { data = writevBuffer = new ByteBuffer[2]; } data[0] = buffer; - data[1] = (ByteBuffer) userData; - res = next.write(data, 0, 2); - } else { - data = writevBuffer; - if(data == null || data.length < length + 1) { - data = writevBuffer = new ByteBuffer[length + 1]; - } - data[0] = buffer; - System.arraycopy(userData, pos, data, 1, length); + data[1] = userData; res = next.write(data, 0, data.length); } if (res == 0) { @@ -274,7 +250,7 @@ /** * Handles writing out the header data in the case where is is too big to fit into a buffer. This is a much slower code path. */ - private int processStatefulWrite(int state, final Object userData, int pos, int len) throws IOException { + private int processStatefulWrite(int state, final ByteBuffer userData) throws IOException { ByteBuffer buffer = pooledBuffer.getResource(); long fiCookie = this.fiCookie; int valueIdx = this.valueIdx; @@ -425,18 +401,8 @@ return STATE_BUF_FLUSH; } } while (buffer.hasRemaining()); - } else if(userData instanceof ByteBuffer) { - ByteBuffer[] b = {buffer, (ByteBuffer) userData}; - do { - long r = next.write(b, 0, b.length); - if (r == 0 && buffer.hasRemaining()) { - return STATE_BUF_FLUSH; - } - } while (buffer.hasRemaining()); } else { - ByteBuffer[] b = new ByteBuffer[1 + len]; - b[0] = buffer; - System.arraycopy(userData, pos, b, 1, len); + ByteBuffer[] b = {buffer, userData}; do { long r = next.write(b, 0, b.length); if (r == 0 && buffer.hasRemaining()) { @@ -502,18 +468,8 @@ return STATE_BUF_FLUSH; } } while (buffer.hasRemaining()); - } else if(userData instanceof ByteBuffer) { - ByteBuffer[] b = {buffer, (ByteBuffer) userData}; - do { - long r = next.write(b, 0, b.length); - if (r == 0 && buffer.hasRemaining()) { - return STATE_BUF_FLUSH; - } - } while (buffer.hasRemaining()); } else { - ByteBuffer[] b = new ByteBuffer[1 + len]; - b[0] = buffer; - System.arraycopy(userData, pos, b, 1, len); + ByteBuffer[] b = {buffer, userData}; do { long r = next.write(b, 0, b.length); if (r == 0 && buffer.hasRemaining()) { @@ -561,7 +517,7 @@ try { if (state != 0) { originalRemaining = src.remaining(); - state = processWrite(state, src, -1, -1); + state = processWrite(state, src); if (state != 0) { return 0; } @@ -592,19 +548,15 @@ int state = oldVal & MASK_STATE; try { if (state != 0) { - long rem = Buffers.remaining(srcs, offset, length); - state = processWrite(state, srcs, offset, length); - - long ret = rem - Buffers.remaining(srcs, offset, length); + //todo: use gathering write here + state = processWrite(state, null); if (state != 0) { - return ret; + return 0; } if (allAreSet(oldVal, FLAG_SHUTDOWN)) { next.terminateWrites(); throw new ClosedChannelException(); } - //we don't attempt to write again - return ret; } return length == 1 ? next.write(srcs[offset]) : next.write(srcs, offset, length); } finally { @@ -613,11 +565,50 @@ } public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { - return src.transferTo(position, count, new ConduitWritableByteChannel(this)); + if (count == 0L) { + return 0L; + } + int oldVal = state; + int state = oldVal & MASK_STATE; + try { + if (state != 0) { + state = processWrite(state, null); + if (state != 0) { + return 0; + } + if (allAreSet(oldVal, FLAG_SHUTDOWN)) { + next.terminateWrites(); + throw new ClosedChannelException(); + } + } + return next.transferFrom(src, position, count); + } finally { + this.state = oldVal & ~MASK_STATE | state; + } } public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException { - return IoUtils.transfer(source, count, throughBuffer, new ConduitWritableByteChannel(this)); + if (count == 0) { + throughBuffer.clear().limit(0); + return 0L; + } + int oldVal = state; + int state = oldVal & MASK_STATE; + try { + if (state != 0) { + state = processWrite(state, null); + if (state != 0) { + return 0; + } + if (allAreSet(oldVal, FLAG_SHUTDOWN)) { + next.terminateWrites(); + throw new ClosedChannelException(); + } + } + return next.transferFrom(source, count, throughBuffer); + } finally { + this.state = oldVal & ~MASK_STATE | state; + } } @Override @@ -635,7 +626,7 @@ int state = oldVal & MASK_STATE; try { if (state != 0) { - state = processWrite(state, null, -1, -1); + state = processWrite(state, null); if (state != 0) { return false; } @@ -681,7 +672,6 @@ } void freeBuffers() { - done = true; if(pooledBuffer != null) { bufferDone(); } Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpServerConnection.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/HttpServerConnection.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpServerConnection.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpServerConnection.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.http; @@ -33,7 +33,6 @@ import io.undertow.util.ConduitFactory; import io.undertow.util.Headers; import io.undertow.util.HttpString; -import io.undertow.util.ImmediatePooled; import org.xnio.OptionMap; import org.xnio.Pool; import org.xnio.Pooled; @@ -126,11 +125,6 @@ return newExchange; } - @Override - public void terminateRequestChannel(HttpServerExchange exchange) { - - } - /** * Pushes back the given data. This should only be used by transfer coding handlers that have read past * the end of the request when handling pipelined requests @@ -161,7 +155,22 @@ eb.free(); unget.free(); final ByteBuffer newBuffer = ByteBuffer.wrap(data); - setExtraBytes(new ImmediatePooled<>(newBuffer)); + setExtraBytes(new Pooled() { + @Override + public void discard() { + + } + + @Override + public void free() { + + } + + @Override + public ByteBuffer getResource() throws IllegalStateException { + return newBuffer; + } + }); } } } Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpTransferEncoding.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/HttpTransferEncoding.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpTransferEncoding.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/HttpTransferEncoding.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.http; Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/ParseState.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/ParseState.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/ParseState.java 8 Sep 2014 09:46:56 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/ParseState.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.protocol.http; @@ -110,7 +110,7 @@ * In general browsers will often send the same header with every request. This cache allows us to re-use the resulting * strings. */ - final HashMap headerValuesCache = new HashMap<>(); + final HashMap headerValuesCache = new HashMap(); public ParseState() { this.parseState = 0; Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/PipeliningBufferingStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/PipeliningBufferingStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/PipeliningBufferingStreamSinkConduit.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/PipeliningBufferingStreamSinkConduit.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.http; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/server/protocol/http/ServerFixedLengthStreamSinkConduit.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/protocol/http/Attic/ServerFixedLengthStreamSinkConduit.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/protocol/http/ServerFixedLengthStreamSinkConduit.java 8 Sep 2014 09:46:57 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/protocol/http/ServerFixedLengthStreamSinkConduit.java 8 Sep 2014 10:52:11 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.protocol.http; import io.undertow.conduits.AbstractFixedLengthStreamSinkConduit; Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/http2/Http2OpenListener.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/http2/Http2ReceiveListener.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/http2/Http2ServerConnection.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/http2/Http2SslSessionInfo.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/http2/Http2UpgradeHandler.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/spdy/SpdyOpenListener.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/spdy/SpdyPlainOpenListener.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/spdy/SpdyReceiveListener.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/spdy/SpdyServerConnection.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/server/protocol/spdy/SpdySslSessionInfo.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/server/session/InMemorySessionManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/InMemorySessionManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/InMemorySessionManager.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/InMemorySessionManager.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.session; @@ -23,6 +23,9 @@ import io.undertow.server.HttpServerExchange; import io.undertow.util.ConcurrentDirectDeque; +import org.xnio.XnioExecutor; +import org.xnio.XnioWorker; + import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -31,9 +34,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; -import org.xnio.XnioExecutor; -import org.xnio.XnioWorker; - /** * The default in memory session manager. This basically just stores sessions in an in memory hash map. *

    @@ -61,7 +61,7 @@ public InMemorySessionManager(String deploymentName, int maxSessions) { this.deploymentName = deploymentName; - this.sessions = new ConcurrentHashMap<>(); + this.sessions = new ConcurrentHashMap(); this.maxSize = maxSessions; ConcurrentDirectDeque evictionQueue = null; if (maxSessions > 0) { @@ -184,7 +184,7 @@ @Override public Set getAllSessions() { - return new HashSet<>(sessions.keySet()); + return new HashSet(sessions.keySet()); } @Override @@ -201,7 +201,7 @@ @Override public String toString() { - return this.deploymentName; + return this.deploymentName.toString(); } /** @@ -216,25 +216,19 @@ private String sessionId; private volatile Object evictionToken; private final SessionConfig sessionCookieConfig; - private volatile long expireTime = -1; final XnioExecutor executor; final XnioWorker worker; - XnioExecutor.Key timerCancelKey; + XnioExecutor.Key cancelKey; Runnable cancelTask = new Runnable() { @Override public void run() { worker.execute(new Runnable() { @Override public void run() { - long currentTime = System.currentTimeMillis(); - if(currentTime >= expireTime) { - invalidate(null, SessionListener.SessionDestroyedReason.TIMEOUT); - } else { - timerCancelKey = executor.executeAfter(cancelTask, expireTime - currentTime, TimeUnit.MILLISECONDS); - } + invalidate(null, SessionListener.SessionDestroyedReason.TIMEOUT); } }); } @@ -250,24 +244,14 @@ } synchronized void bumpTimeout() { - final int maxInactiveInterval = getMaxInactiveInterval(); - if (maxInactiveInterval > 0) { - long newExpireTime = System.currentTimeMillis() + (maxInactiveInterval * 1000); - if(timerCancelKey != null && (newExpireTime < expireTime)) { - // We have to re-schedule as the new maxInactiveInterval is lower than the old one - if (!timerCancelKey.remove()) { - return; - } - timerCancelKey = null; + if (cancelKey != null) { + if (!cancelKey.remove()) { + return; } - expireTime = newExpireTime; - if(timerCancelKey == null) { - //+1 second, to make sure that the time has actually expired - //we don't re-schedule every time, as it is expensive - //instead when it expires we check if the timeout has been bumped, and if so we re-schedule - timerCancelKey = executor.executeAfter(cancelTask, maxInactiveInterval + 1, TimeUnit.SECONDS); - } } + if (getMaxInactiveInterval() > 0) { + cancelKey = executor.executeAfter(cancelTask, getMaxInactiveInterval(), TimeUnit.SECONDS); + } if (evictionToken != null) { Object token = evictionToken; if (evictionTokenUpdater.compareAndSet(this, token, null)) { @@ -382,8 +366,8 @@ } synchronized void invalidate(final HttpServerExchange exchange, SessionListener.SessionDestroyedReason reason) { - if (timerCancelKey != null) { - timerCancelKey.remove(); + if (cancelKey != null) { + cancelKey.remove(); } InMemorySession sess = sessionManager.sessions.get(sessionId); if (sess == null) { @@ -418,8 +402,8 @@ } private synchronized void destroy() { - if (timerCancelKey != null) { - timerCancelKey.remove(); + if (cancelKey != null) { + cancelKey.remove(); } cancelTask = null; } @@ -439,7 +423,7 @@ this.maxInactiveInterval = maxInactiveInterval; } - final ConcurrentMap attributes = new ConcurrentHashMap<>(); + final ConcurrentMap attributes = new ConcurrentHashMap(); volatile long lastAccessed; final long creationTime; volatile int maxInactiveInterval; Index: 3rdParty_sources/undertow/io/undertow/server/session/PathParameterSessionConfig.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/PathParameterSessionConfig.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/PathParameterSessionConfig.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/PathParameterSessionConfig.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.session; import java.util.Deque; Index: 3rdParty_sources/undertow/io/undertow/server/session/SecureRandomSessionIdGenerator.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/SecureRandomSessionIdGenerator.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/SecureRandomSessionIdGenerator.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/SecureRandomSessionIdGenerator.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.session; Index: 3rdParty_sources/undertow/io/undertow/server/session/Session.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/Session.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/Session.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/Session.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.session; Index: 3rdParty_sources/undertow/io/undertow/server/session/SessionAttachmentHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/SessionAttachmentHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/SessionAttachmentHandler.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/SessionAttachmentHandler.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.session; Index: 3rdParty_sources/undertow/io/undertow/server/session/SessionConfig.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/SessionConfig.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/SessionConfig.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/SessionConfig.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.session; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/server/session/SessionCookieConfig.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/SessionCookieConfig.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/SessionCookieConfig.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/SessionCookieConfig.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.session; Index: 3rdParty_sources/undertow/io/undertow/server/session/SessionIdGenerator.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/SessionIdGenerator.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/SessionIdGenerator.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/SessionIdGenerator.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.session; Index: 3rdParty_sources/undertow/io/undertow/server/session/SessionListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/SessionListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/SessionListener.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/SessionListener.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.session; @@ -38,9 +38,9 @@ /** * Called when a session is destroyed - * @param session The new session - * @param exchange The {@link HttpServerExchange} that destroyed the session, or null if the session timed out - * @param reason The reason why the session was expired + * @param session The new session + * @param exchange The {@link HttpServerExchange} that destroyed the session, or null if the session timed out + * @param expired If the session expired */ void sessionDestroyed(final Session session, final HttpServerExchange exchange, SessionDestroyedReason reason); Index: 3rdParty_sources/undertow/io/undertow/server/session/SessionListeners.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/SessionListeners.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/SessionListeners.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/SessionListeners.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,26 +1,6 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.server.session; -import java.util.ArrayList; import java.util.List; -import java.util.ListIterator; import java.util.concurrent.CopyOnWriteArrayList; import io.undertow.server.HttpServerExchange; @@ -33,7 +13,7 @@ */ public class SessionListeners { - private final List sessionListeners = new CopyOnWriteArrayList<>(); + private final List sessionListeners = new CopyOnWriteArrayList(); public void addSessionListener(final SessionListener listener) { this.sessionListeners.add(listener); @@ -54,12 +34,10 @@ } public void sessionDestroyed(final Session session, final HttpServerExchange exchange, SessionListener.SessionDestroyedReason reason) { - // We need to create our own snapshot to safely iterate over a concurrent list in reverse - List listeners = new ArrayList<>(sessionListeners); - ListIterator iterator = listeners.listIterator(listeners.size()); - while (iterator.hasPrevious()) { - iterator.previous().sessionDestroyed(session, exchange, reason); + for (SessionListener listener : sessionListeners) { + listener.sessionDestroyed(session, exchange, reason); } + } public void attributeAdded(final Session session, final String name, final Object value) { Index: 3rdParty_sources/undertow/io/undertow/server/session/SessionManager.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/SessionManager.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/SessionManager.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/SessionManager.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.session; Index: 3rdParty_sources/undertow/io/undertow/server/session/SslSessionConfig.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/server/session/Attic/SslSessionConfig.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/server/session/SslSessionConfig.java 8 Sep 2014 09:46:42 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/server/session/SslSessionConfig.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.server.session; @@ -34,8 +34,8 @@ public class SslSessionConfig implements SessionConfig { private final SessionConfig fallbackSessionConfig; - private final Map sessions = new HashMap<>(); - private final Map reverse = new HashMap<>(); + private final Map sessions = new HashMap(); + private final Map reverse = new HashMap(); public SslSessionConfig(final SessionConfig fallbackSessionConfig, SessionManager sessionManager) { this.fallbackSessionConfig = fallbackSessionConfig; Index: 3rdParty_sources/undertow/io/undertow/util/AbstractAttachable.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/AbstractAttachable.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/AbstractAttachable.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/AbstractAttachable.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -69,15 +69,11 @@ throw UndertowMessages.MESSAGES.argumentCannotBeNull("key"); } if(attachments == null) { - attachments = createAttachmentMap(); + attachments = new IdentityHashMap, Object>(5); } return key.cast(attachments.put(key, key.cast(value))); } - protected Map, Object> createAttachmentMap() { - return new IdentityHashMap<>(5); - } - /** * {@inheritDoc} */ @@ -96,12 +92,12 @@ public void addToAttachmentList(final AttachmentKey> key, final T value) { if (key != null) { if(attachments == null) { - attachments = createAttachmentMap(); + attachments = new IdentityHashMap, Object>(5); } final Map, Object> attachments = this.attachments; final AttachmentList list = key.cast(attachments.get(key)); if (list == null) { - final AttachmentList newList = new AttachmentList<>(((ListAttachmentKey) key).getValueClass()); + final AttachmentList newList = new AttachmentList(((ListAttachmentKey) key).getValueClass()); attachments.put(key, newList); newList.add(value); } else { Index: 3rdParty_sources/undertow/io/undertow/util/Attachable.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/Attachable.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/Attachable.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/Attachable.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/AttachmentKey.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/AttachmentKey.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/AttachmentKey.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/AttachmentKey.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/AttachmentList.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/AttachmentList.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/AttachmentList.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/AttachmentList.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/CanonicalPathUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/CanonicalPathUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/CanonicalPathUtils.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/CanonicalPathUtils.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -70,7 +70,7 @@ int state = initialState; int eatCount = 0; int tokenEnd = path.length(); - final List parts = new ArrayList<>(); + final List parts = new ArrayList(); for (int i = lastDot - 1; i >= 0; --i) { final char c = path.charAt(i); switch (state) { Index: 3rdParty_sources/undertow/io/undertow/util/Certificates.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/Certificates.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/Certificates.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/Certificates.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import javax.security.cert.CertificateEncodingException; Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/util/ChaninedHandlerWrapper.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/util/ClosingChannelExceptionHandler.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/util/ConcurrentDirectDeque.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/ConcurrentDirectDeque.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/ConcurrentDirectDeque.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/ConcurrentDirectDeque.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/ConduitFactory.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/ConduitFactory.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/ConduitFactory.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/ConduitFactory.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import org.xnio.conduits.Conduit; Index: 3rdParty_sources/undertow/io/undertow/util/Cookies.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/Cookies.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/Cookies.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/Cookies.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import io.undertow.UndertowMessages; @@ -191,9 +173,9 @@ public static Map parseRequestCookies(int maxCookies, boolean allowEqualInValue, List cookies) { if (cookies == null) { - return new TreeMap<>(); + return new TreeMap(); } - final Map parsedCookies = new TreeMap<>(); + final Map parsedCookies = new TreeMap(); for (String cookie : cookies) { parseCookie(cookie, parsedCookies, maxCookies, allowEqualInValue); @@ -206,8 +188,8 @@ String name = null; int start = 0; int cookieCount = parsedCookies.size(); - final Map cookies = new HashMap<>(); - final Map additional = new HashMap<>(); + final Map cookies = new HashMap(); + final Map additional = new HashMap(); for (int i = 0; i < cookie.length(); ++i) { char c = cookie.charAt(i); switch (state) { Index: 3rdParty_sources/undertow/io/undertow/util/CopyOnWriteMap.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/CopyOnWriteMap.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/CopyOnWriteMap.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/CopyOnWriteMap.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import java.util.Collection; @@ -42,7 +24,7 @@ } public CopyOnWriteMap(Map existing) { - this.delegate = new HashMap<>(existing); + this.delegate = new HashMap(existing); } @Override @@ -126,7 +108,7 @@ @Override public synchronized void putAll(Map m) { - final Map delegate = new HashMap<>(this.delegate); + final Map delegate = new HashMap(this.delegate); for(Entry e : m.entrySet()) { delegate.put(e.getKey(), e.getValue()); } @@ -155,14 +137,14 @@ //must be called under lock private V putInternal(final K key, final V value) { - final Map delegate = new HashMap<>(this.delegate); + final Map delegate = new HashMap(this.delegate); V existing = delegate.put(key, value); this.delegate = delegate; return existing; } public V removeInternal(final Object key) { - final Map delegate = new HashMap<>(this.delegate); + final Map delegate = new HashMap(this.delegate); V existing = delegate.remove(key); this.delegate = delegate; return existing; Index: 3rdParty_sources/undertow/io/undertow/util/DateUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/DateUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/DateUtils.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/DateUtils.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,26 +9,24 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; -import io.undertow.UndertowOptions; -import io.undertow.server.HttpServerExchange; - import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; +import io.undertow.UndertowOptions; +import io.undertow.server.HttpServerExchange; + /** * Utility for parsing and generating dates * @@ -42,33 +40,24 @@ private static final String RFC1123_PATTERN = "EEE, dd MMM yyyy HH:mm:ss z"; - private static final AtomicReference cachedDateString = new AtomicReference<>(); + private static volatile String cachedDateString; + private static volatile long nextUpdateTime = -1; /** * Thread local cache of this date format. This is technically a small memory leak, however * in practice it is fine, as it will only be used by server threads. - *

    + * * This is the most common date format, which is why we cache it. */ private static final ThreadLocal RFC1123_PATTERN_FORMAT = new ThreadLocal() { @Override protected SimpleDateFormat initialValue() { - SimpleDateFormat df = new SimpleDateFormat(RFC1123_PATTERN, LOCALE_US); + SimpleDateFormat df = new SimpleDateFormat(RFC1123_PATTERN, LOCALE_US); df.setTimeZone(GMT_ZONE); return df; } }; - /** - * Invalidates the current date - */ - private static final Runnable INVALIDATE_TASK = new Runnable() { - @Override - public void run() { - cachedDateString.set(null); - } - }; - private static final String RFC1036_PATTERN = "EEEEEEEEE, dd-MMM-yy HH:mm:ss z"; private static final String ASCITIME_PATTERN = "EEE MMM d HH:mm:ss yyyyy"; @@ -82,7 +71,7 @@ private static final ThreadLocal COMMON_LOG_PATTERN_FORMAT = new ThreadLocal() { @Override protected SimpleDateFormat initialValue() { - SimpleDateFormat df = new SimpleDateFormat(COMMON_LOG_PATTERN, LOCALE_US); + SimpleDateFormat df = new SimpleDateFormat(COMMON_LOG_PATTERN, LOCALE_US); return df; } }; @@ -124,7 +113,7 @@ */ final int semicolonIndex = date.indexOf(';'); - final String trimmedDate = semicolonIndex >= 0 ? date.substring(0, semicolonIndex) : date; + final String trimmedDate = semicolonIndex >=0 ? date.substring(0, semicolonIndex) : date; ParsePosition pp = new ParsePosition(0); SimpleDateFormat dateFormat = RFC1123_PATTERN_FORMAT.get(); @@ -248,21 +237,15 @@ public static void addDateHeaderIfRequired(HttpServerExchange exchange) { HeaderMap responseHeaders = exchange.getResponseHeaders(); - if (exchange.getConnection().getUndertowOptions().get(UndertowOptions.ALWAYS_SET_DATE, true) && !responseHeaders.contains(Headers.DATE)) { - String dateString = cachedDateString.get(); - if (dateString != null) { - responseHeaders.put(Headers.DATE, dateString); + if(exchange.getConnection().getUndertowOptions().get(UndertowOptions.ALWAYS_SET_DATE, true) && !responseHeaders.contains(Headers.DATE)) { + long time = System.nanoTime(); + if(time < nextUpdateTime) { + responseHeaders.put(Headers.DATE, cachedDateString); } else { - //set the time and register a timer to invalidate it - //note that this is racey, it does not matter if multiple threads do this - //the perf cost of synchronizing would be more than the perf cost of multiple threads running it long realTime = System.currentTimeMillis(); - long mod = realTime % 1000; - long toGo = 1000 - mod; - dateString = DateUtils.toDateString(new Date(realTime)); - if (cachedDateString.compareAndSet(null, dateString)) { - exchange.getConnection().getIoThread().executeAfter(INVALIDATE_TASK, toGo, TimeUnit.MILLISECONDS); - } + String dateString = DateUtils.toDateString(new Date(realTime)); + cachedDateString = dateString; + nextUpdateTime = time + 1000000000; responseHeaders.put(Headers.DATE, dateString); } } @@ -271,5 +254,4 @@ private DateUtils() { } - } Index: 3rdParty_sources/undertow/io/undertow/util/ETag.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/ETag.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/ETag.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/ETag.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; /** Index: 3rdParty_sources/undertow/io/undertow/util/ETagUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/ETagUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/ETagUtils.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/ETagUtils.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import java.util.ArrayList; @@ -171,7 +153,7 @@ char[] headerChars = header.toCharArray(); // The LinkedHashMap is used so that the parameter order can also be retained. - List response = new ArrayList<>(); + List response = new ArrayList(); SearchingFor searchingFor = SearchingFor.START_OF_VALUE; String currentToken = null; @@ -182,7 +164,7 @@ for (int i = 0; i < headerChars.length; i++) { switch (searchingFor) { case START_OF_VALUE: - if (headerChars[i] != COMMA && !Character.isWhitespace(headerChars[i])) { + if (headerChars[i] != COMMA && Character.isWhitespace(headerChars[i]) == false) { if (headerChars[i] == QUOTE) { valueStart = i + 1; searchingFor = SearchingFor.LAST_QUOTE; @@ -251,7 +233,7 @@ for (int i = 0; i < headerChars.length; i++) { switch (searchingFor) { case START_OF_VALUE: - if (headerChars[i] != COMMA && !Character.isWhitespace(headerChars[i])) { + if (headerChars[i] != COMMA && Character.isWhitespace(headerChars[i]) == false) { if (headerChars[i] == QUOTE) { valueStart = i + 1; searchingFor = SearchingFor.LAST_QUOTE; Index: 3rdParty_sources/undertow/io/undertow/util/FastConcurrentDirectDeque.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/FastConcurrentDirectDeque.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/FastConcurrentDirectDeque.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/FastConcurrentDirectDeque.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /* @@ -348,7 +348,7 @@ */ private Node linkFirst(E e) { checkNotNull(e); - final Node newNode = new Node<>(e); + final Node newNode = new Node(e); restartFromHead: for (;;) @@ -381,7 +381,7 @@ */ private Node linkLast(E e) { checkNotNull(e); - final Node newNode = new Node<>(e); + final Node newNode = new Node(e); restartFromTail: for (;;) @@ -815,7 +815,7 @@ * @return the arrayList */ private ArrayList toArrayList() { - ArrayList list = new ArrayList<>(); + ArrayList list = new ArrayList(); for (Node p = first(); p != null; p = succ(p)) { E item = p.item; if (item != null) @@ -828,7 +828,7 @@ * Constructs an empty deque. */ public FastConcurrentDirectDeque() { - head = tail = new Node<>(null); + head = tail = new Node(null); } /** @@ -845,7 +845,7 @@ Node h = null, t = null; for (E e : c) { checkNotNull(e); - Node newNode = new Node<>(e); + Node newNode = new Node(e); if (h == null) h = t = newNode; else { @@ -863,10 +863,10 @@ private void initHeadTail(Node h, Node t) { if (h == t) { if (h == null) - h = t = new Node<>(null); + h = t = new Node(null); else { // Avoid edge case of a single Node with non-null item. - Node newNode = new Node<>(null); + Node newNode = new Node(null); t.lazySetNext(newNode); newNode.lazySetPrev(t); t = newNode; @@ -1172,7 +1172,7 @@ Node beginningOfTheEnd = null, last = null; for (E e : c) { checkNotNull(e); - Node newNode = new Node<>(e); + Node newNode = new Node(e); if (beginningOfTheEnd == null) beginningOfTheEnd = last = newNode; else { @@ -1433,7 +1433,7 @@ Object item; while ((item = s.readObject()) != null) { @SuppressWarnings("unchecked") - Node newNode = new Node<>((E) item); + Node newNode = new Node((E) item); if (h == null) h = t = newNode; else { @@ -1459,9 +1459,9 @@ private static final long headOffset; private static final long tailOffset; static { - PREV_TERMINATOR = new Node<>(); + PREV_TERMINATOR = new Node(); PREV_TERMINATOR.next = PREV_TERMINATOR; - NEXT_TERMINATOR = new Node<>(); + NEXT_TERMINATOR = new Node(); NEXT_TERMINATOR.prev = NEXT_TERMINATOR; try { UNSAFE = getUnsafe(); Index: 3rdParty_sources/undertow/io/undertow/util/FileUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/FileUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/FileUtils.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/FileUtils.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/FlexBase64.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/FlexBase64.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/FlexBase64.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/FlexBase64.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/HeaderMap.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/HeaderMap.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/HeaderMap.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/HeaderMap.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/HeaderToken.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/HeaderToken.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/HeaderToken.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/HeaderToken.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/HeaderTokenParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/HeaderTokenParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/HeaderTokenParser.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/HeaderTokenParser.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -43,7 +43,7 @@ char[] headerChars = header.toCharArray(); // The LinkedHashMap is used so that the parameter order can also be retained. - Map response = new LinkedHashMap<>(); + Map response = new LinkedHashMap(); SearchingFor searchingFor = SearchingFor.START_OF_NAME; int nameStart = 0; @@ -54,7 +54,7 @@ switch (searchingFor) { case START_OF_NAME: // Eliminate any white space before the name of the parameter. - if (headerChars[i] != COMMA && !Character.isWhitespace(headerChars[i])) { + if (headerChars[i] != COMMA && Character.isWhitespace(headerChars[i]) == false) { nameStart = i; searchingFor = SearchingFor.EQUALS_SIGN; } @@ -70,7 +70,7 @@ } break; case START_OF_VALUE: - if (!Character.isWhitespace(headerChars[i])) { + if (Character.isWhitespace(headerChars[i]) == false) { if (headerChars[i] == QUOTE && currentToken.isAllowQuoted()) { valueStart = i + 1; searchingFor = SearchingFor.LAST_QUOTE; Index: 3rdParty_sources/undertow/io/undertow/util/HeaderValues.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/HeaderValues.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/HeaderValues.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/HeaderValues.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -37,7 +37,7 @@ private static final String[] NO_STRINGS = new String[0]; final HttpString key; - byte size; + byte head, size; Object value; HeaderValues(final HttpString key) { @@ -63,20 +63,28 @@ } private void clearInternal(byte size) { + final byte head = this.head; final Object value = this.value; if (value instanceof String[]) { final String[] strings = (String[]) value; final int len = strings.length; - Arrays.fill(strings, 0, len, null); + final int tail = head + size; + if (tail > len) { + Arrays.fill(strings, head, len, null); + Arrays.fill(strings, 0, tail - len, null); + } else { + Arrays.fill(strings, head, tail, null); + } } else { this.value = null; } - this.size = 0; + this.head = this.size = 0; } private int index(int idx) { assert idx >= 0; assert idx < size; + idx += head; final int len = ((String[]) value).length; if (idx > len) { idx -= len; @@ -195,14 +203,19 @@ if (value instanceof String[]) { final String[] strings = (String[]) value; final int len = strings.length; + final byte head = this.head; if (size == len) { - final String[] newStrings = new String[len + 2]; - System.arraycopy(strings, 0, newStrings, 1, len); - newStrings[0] = headerValue; + final String[] newStrings = Arrays.copyOfRange(strings, head, head + len + (len << 1)); + final int end = head + size; + if (end > len) { + System.arraycopy(strings, 0, newStrings, len - head, end - len); + } + newStrings[this.head = (byte) (head - 1)] = headerValue; this.value = newStrings; + } else if (head == 0) { + strings[this.head = (byte) (len - 1)] = headerValue; } else { - System.arraycopy(strings, 0, strings, 1, strings.length - 1); - strings[0] = headerValue; + strings[this.head = (byte) (head - 1)] = headerValue; } this.size = (byte) (size + 1); } else { @@ -213,6 +226,7 @@ this.value = new String[] { headerValue, (String) value, null, null }; this.size = (byte) 2; } + this.head = 0; } return true; } @@ -231,20 +245,27 @@ this.value = new String[] { (String) value, headerValue, null, null }; this.size = (byte) 2; } + this.head = 0; } return true; } private void offerLastMultiValue(String headerValue, int size, String[] value) { - final String[] strings = value; + final String[] strings = (String[]) value; final int len = strings.length; + final byte head = this.head; + final int end = head + size; if (size == len) { - final String[] newStrings = new String[len + 2]; - System.arraycopy(strings, 0, newStrings, 0, len); + final String[] newStrings = Arrays.copyOfRange(strings, head, head + len + (len << 1)); + if (end > len) { + System.arraycopy(strings, 0, newStrings, len - head, end - len); + } newStrings[len] = headerValue; this.value = newStrings; + } else if (end >= len) { + strings[end - len] = headerValue; } else { - strings[size] = headerValue; + strings[end] = headerValue; } this.size = (byte) (size + 1); } @@ -259,22 +280,59 @@ assert value instanceof String[]; final String[] strings = (String[]) value; final int len = strings.length; + final byte head = this.head; + final int end = head + size; + final int headIdx = head + idx; // This stuff is all algebraically derived. if (size == len) { // Grow the list, copy each segment into new spots so that head = 0 - final int newLen = len + 2; + final int newLen = (len << 1) + len; final String[] newStrings = new String[newLen]; - System.arraycopy(value, 0, newStrings, 0, idx); - System.arraycopy(value, idx, newStrings, idx + 1, len - idx); - + if (head == 0) { + assert headIdx == len; + assert end == len; + System.arraycopy(value, 0, newStrings, 0, idx); + System.arraycopy(value, idx, newStrings, idx + 1, len - idx); + } else if (headIdx < len) { + System.arraycopy(value, head, newStrings, 0, idx); + System.arraycopy(value, headIdx, newStrings, idx + 1, len - headIdx); + System.arraycopy(value, 0, newStrings, len - head + 1, head); + } else if (headIdx > len) { + System.arraycopy(value, 0, newStrings, len - head, headIdx - len); + System.arraycopy(value, headIdx - len, newStrings, idx + 1, len - idx + 1); + System.arraycopy(value, head, newStrings, 0, len - head); + } // finally fill in the new value newStrings[idx] = headerValue; this.value = newStrings; - } else{ - System.arraycopy(value, idx, value, idx + 1, len - idx); - - // finally fill in the new value + this.head = 0; + } else if (end > len) { + if (headIdx < len) { + System.arraycopy(value, head, value, head - 1, idx); + strings[headIdx - 1] = headerValue; + this.head = (byte) (head - 1); + } else if (headIdx > len) { + System.arraycopy(value, headIdx - len, value, headIdx - len + 1, size - idx); + strings[headIdx - len] = headerValue; + } else { + assert headIdx == len; + System.arraycopy(value, 0, value, 1, end - len); + strings[0] = headerValue; + } strings[idx] = headerValue; + } else { + assert size < len && end <= len; + if (head == 0 || idx >= size >> 1) { + assert end < len; + System.arraycopy(value, headIdx, value, headIdx + 1, size - idx); + strings[headIdx] = headerValue; + } else { + assert end <= len || idx < size << 1; + assert head > 0; + System.arraycopy(value, headIdx, value, headIdx - 1, size - idx); + strings[headIdx - 1] = headerValue; + this.head = (byte) (head - 1); + } } this.size = (byte) (size + 1); return true; @@ -291,10 +349,15 @@ return (String) value; } else { final String[] strings = (String[]) value; - String ret = strings[0]; - System.arraycopy(strings, 1, strings, 0, strings.length - 1); + int idx = head++; this.size = (byte) (size - 1); - return ret; + final int len = strings.length; + if (idx > len) idx -= len; + try { + return strings[idx]; + } finally { + strings[idx] = null; + } } } @@ -309,7 +372,7 @@ return (String) value; } else { final String[] strings = (String[]) value; - int idx = (this.size = (byte) (size - 1)); + int idx = head + (this.size = (byte) (size - 1)); final int len = strings.length; if (idx > len) idx -= len; try { @@ -329,11 +392,33 @@ // value must be an array since size > 2 final String[] value = (String[]) this.value; final int len = value.length; - String ret = value[idx]; - System.arraycopy(value, idx + 1, value, idx, len - idx - 1); - value[len - 1] = null; - this.size = (byte) (size - 1); - return ret; + final byte head = this.head; + final int headIdx = idx + head; + final int end = head + size; + if (end > len) { + if (headIdx > len) { + try { + return value[headIdx - len]; + } finally { + System.arraycopy(value, headIdx + 1 - len, value, headIdx - len, size - idx - 1); + this.size = (byte) (size - 1); + } + } else { + try { + return value[headIdx]; + } finally { + System.arraycopy(value, head, value, head + 1, idx); + this.size = (byte) (size - 1); + } + } + } else { + try { + return value[headIdx]; + } finally { + System.arraycopy(value, headIdx + 1, value, headIdx, size - idx - 1); + this.size = (byte) (size - 1); + } + } } public String get(int idx) { @@ -355,8 +440,10 @@ if (value instanceof String[]) { final String[] list = (String[]) value; final int len = list.length; + int idx; for (int i = 0; i < size; i ++) { - if ((i > len ? list[i - len] : list[i]).equals(o)) { + idx = i + head; + if ((idx > len ? list[idx - len] : list[idx]).equals(o)) { return i; } } @@ -373,7 +460,7 @@ final int len = list.length; int idx; for (int i = size - 1; i >= 0; i --) { - idx = i; + idx = i + head; if ((idx > len ? list[idx - len] : list[idx]).equals(o)) { return i; } @@ -432,13 +519,14 @@ final Object v = this.value; if (v instanceof String) return new String[] { (String) v }; final String[] list = (String[]) v; + final int head = this.head; final int len = list.length; - final int copyEnd = size; + final int copyEnd = head + size; if (copyEnd < len) { - return Arrays.copyOfRange(list, 0, copyEnd); + return Arrays.copyOfRange(list, head, copyEnd); } else { - String[] ret = Arrays.copyOfRange(list, 0, copyEnd); - System.arraycopy(list, 0, ret, len, copyEnd - len); + String[] ret = Arrays.copyOfRange(list, head, copyEnd); + System.arraycopy(list, 0, ret, len - head, copyEnd - len); return ret; } } @@ -452,7 +540,17 @@ if (v instanceof String) { target[0] = (T)v; } else { - System.arraycopy(v, 0, target, 0, size); + final String[] list = (String[]) v; + final int head = this.head; + final int len = list.length; + final int copyEnd = head + size; + if (copyEnd < len) { + System.arraycopy(list, head, target, 0, size); + } else { + final int wrapEnd = len - head; + System.arraycopy(list, head, target, 0, wrapEnd); + System.arraycopy(list, 0, target, wrapEnd, copyEnd - len); + } } return (T[]) target; } @@ -570,10 +668,6 @@ } public boolean addAll(final Collection c) { - Iterator it = c.iterator(); - while (it.hasNext()) { - add(it.next()); - } - return !c.isEmpty(); + return addAll(0, c); } } Index: 3rdParty_sources/undertow/io/undertow/util/Headers.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/Headers.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/Headers.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/Headers.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -103,8 +103,6 @@ public static final String WWW_AUTHENTICATE_STRING = "WWW-Authenticate"; public static final String X_FORWARDED_FOR_STRING = "X-Forwarded-For"; public static final String X_FORWARDED_PROTO_STRING = "X-Forwarded-Proto"; - public static final String X_FORWARDED_HOST_STRING = "X-Forwarded-Host"; - public static final String X_FORWARDED_PORT_STRING = "X-Forwarded-Port"; // Header names @@ -180,9 +178,7 @@ public static final HttpString WARNING = new HttpString(WARNING_STRING, 65); public static final HttpString WWW_AUTHENTICATE = new HttpString(WWW_AUTHENTICATE_STRING, 66); public static final HttpString X_FORWARDED_FOR = new HttpString(X_FORWARDED_FOR_STRING, 67); - public static final HttpString X_FORWARDED_HOST = new HttpString(X_FORWARDED_HOST_STRING, 68); - public static final HttpString X_FORWARDED_PORT = new HttpString(X_FORWARDED_PORT_STRING, 69); - public static final HttpString X_FORWARDED_PROTO = new HttpString(X_FORWARDED_PROTO_STRING, 70); + public static final HttpString X_FORWARDED_PROTO = new HttpString(X_FORWARDED_PROTO_STRING, 68); // Content codings Index: 3rdParty_sources/undertow/io/undertow/util/HexConverter.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/HexConverter.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/HexConverter.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/HexConverter.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2011 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -135,7 +135,7 @@ byte[] convertedBack = convertFromHex(hexValue); - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); for (byte current : convertedBack) { sb.append((int)current).append(" "); } Index: 3rdParty_sources/undertow/io/undertow/util/HttpString.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/HttpString.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/HttpString.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/HttpString.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -79,7 +79,7 @@ * @param length the number of bytes to copy */ public HttpString(final byte[] bytes, int offset, int length) { - this(copyOfRange(bytes, offset, offset + length), null); + this(copyOfRange(bytes, offset, length), null); } /** Index: 3rdParty_sources/undertow/io/undertow/util/ImmediateAuthenticationMechanismFactory.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/ImmediateAuthenticationMechanismFactory.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/ImmediateAuthenticationMechanismFactory.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/ImmediateAuthenticationMechanismFactory.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import io.undertow.security.api.AuthenticationMechanism; Index: 3rdParty_sources/undertow/io/undertow/util/ImmediateConduitFactory.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/ImmediateConduitFactory.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/ImmediateConduitFactory.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/ImmediateConduitFactory.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import org.xnio.conduits.Conduit; Index: 3rdParty_sources/undertow/io/undertow/util/ImmediatePooled.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/ImmediatePooled.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/ImmediatePooled.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/ImmediatePooled.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import org.xnio.Pooled; @@ -45,8 +27,4 @@ public T getResource() throws IllegalStateException { return value; } - - @Override - public void close() { - } } Index: 3rdParty_sources/undertow/io/undertow/util/LocaleUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/LocaleUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/LocaleUtils.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/LocaleUtils.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -24,8 +24,6 @@ import java.util.Locale; /** - * Utility methods for getting the locale from a request. - * * @author Stuart Douglas */ public class LocaleUtils { @@ -44,34 +42,15 @@ } } - /** - * Parse a header string and return the list of locales that were found. - * - * If the header is empty or null then an empty list will be returned. - * - * @param acceptLanguage The Accept-Language header - * @return The list of locales, in order of preference - */ public static List getLocalesFromHeader(final String acceptLanguage) { - if(acceptLanguage == null) { - return Collections.emptyList(); - } return getLocalesFromHeader(Collections.singletonList(acceptLanguage)); } - /** - * Parse a header string and return the list of locales that were found. - * - * If the header is empty or null then an empty list will be returned. - * - * @param acceptLanguage The Accept-Language header - * @return The list of locales, in order of preference - */ public static List getLocalesFromHeader(final List acceptLanguage) { if (acceptLanguage == null || acceptLanguage.isEmpty()) { - return Collections.emptyList(); + return Collections.singletonList(Locale.getDefault()); } - final List ret = new ArrayList<>(); + final List ret = new ArrayList(); final List> parsedResults = QValueParser.parse(acceptLanguage); for (List qvalueResult : parsedResults) { for (QValueParser.QValueResult res : qvalueResult) { Index: 3rdParty_sources/undertow/io/undertow/util/MalformedMessageException.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/MalformedMessageException.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/MalformedMessageException.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/MalformedMessageException.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/util/Methods.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/Methods.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/Methods.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/Methods.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/MimeMappings.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/MimeMappings.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/MimeMappings.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/MimeMappings.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -34,7 +34,7 @@ public static final Map DEFAULT_MIME_MAPPINGS; static { - Map defaultMappings = new HashMap<>(101); + Map defaultMappings = new HashMap(101); defaultMappings.put("txt", "text/plain"); defaultMappings.put("css", "text/css"); defaultMappings.put("html", "text/html"); @@ -50,7 +50,6 @@ defaultMappings.put("rtx", "text/richtext"); defaultMappings.put("tsv", "text/tab-separated-values"); defaultMappings.put("etx", "text/x-setext"); - defaultMappings.put("json", "application/json"); defaultMappings.put("ps", "application/x-postscript"); defaultMappings.put("class", "application/java"); defaultMappings.put("csh", "application/x-csh"); @@ -112,7 +111,6 @@ defaultMappings.put("aiff", "audio/x-aiff"); defaultMappings.put("aifc", "audio/x-aiff"); defaultMappings.put("wav", "audio/x-wav"); - defaultMappings.put("mp3", "audio/mpeg"); defaultMappings.put("mpeg", "video/mpeg"); defaultMappings.put("mpg", "video/mpeg"); defaultMappings.put("mpe", "video/mpeg"); @@ -155,7 +153,7 @@ } public static class Builder { - private final Map mappings = new HashMap<>(); + private final Map mappings = new HashMap(); private Builder(boolean includeDefault) { Index: 3rdParty_sources/undertow/io/undertow/util/MultipartParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/MultipartParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/MultipartParser.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/MultipartParser.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/NetworkUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/NetworkUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/NetworkUtils.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/NetworkUtils.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; /** Index: 3rdParty_sources/undertow/io/undertow/util/PathMatcher.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/PathMatcher.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/PathMatcher.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/PathMatcher.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -43,8 +43,8 @@ private static final String STRING_PATH_SEPARATOR = "/"; private volatile T defaultHandler; - private final ConcurrentMap paths = new CopyOnWriteMap<>(); - private final ConcurrentMap exactPathMatches = new CopyOnWriteMap<>(); + private final ConcurrentMap paths = new CopyOnWriteMap(); + private final ConcurrentMap exactPathMatches = new CopyOnWriteMap(); /** * lengths of all registered paths @@ -67,7 +67,7 @@ if (!exactPathMatches.isEmpty()) { T match = getExactPath(path); if (match != null) { - return new PathMatch<>("", match); + return new PathMatch("", match); } } @@ -78,20 +78,20 @@ if (pathLength == length) { T next = paths.get(path); if (next != null) { - return new PathMatch<>(path.substring(pathLength), next); + return new PathMatch(path.substring(pathLength), next); } } else if (pathLength < length) { char c = path.charAt(pathLength); if (c == '/') { String part = path.substring(0, pathLength); T next = paths.get(part); if (next != null) { - return new PathMatch<>(path.substring(pathLength), next); + return new PathMatch(path.substring(pathLength), next); } } } } - return new PathMatch<>(path, defaultHandler); + return new PathMatch(path, defaultHandler); } /** @@ -151,7 +151,7 @@ } private void buildLengths() { - final Set lengths = new TreeSet<>(new Comparator() { + final Set lengths = new TreeSet(new Comparator() { @Override public int compare(Integer o1, Integer o2) { return -o1.compareTo(o2); Index: 3rdParty_sources/undertow/io/undertow/util/PathTemplate.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/PathTemplate.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/PathTemplate.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/PathTemplate.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -78,7 +78,7 @@ int state = 0; String base = ""; - List parts = new ArrayList<>(); + List parts = new ArrayList(); int stringStart = 0; //0 parsing base //1 parsing base, last char was / @@ -162,7 +162,7 @@ break; } } - final Set templates = new HashSet<>(); + final Set templates = new HashSet(); for(Part part : parts) { if(part.template) { templates.add(part.part); Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/util/PathTemplateMatch.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/util/PathTemplateMatcher.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/PathTemplateMatcher.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/PathTemplateMatcher.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/PathTemplateMatcher.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,31 +1,11 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import io.undertow.UndertowMessages; import java.util.Comparator; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import java.util.TreeSet; @@ -42,15 +22,15 @@ /** * Map of path template stem to the path templates that share the same base. */ - private Map> pathTemplateMap = new CopyOnWriteMap<>(); + private Map> pathTemplateMap = new CopyOnWriteMap>(); /** * lengths of all registered paths */ private volatile int[] lengths = {}; public PathMatchResult match(final String path) { - final Map params = new HashMap<>(); + final Map params = new HashMap(); int length = path.length(); final int[] lengths = this.lengths; for (int i = 0; i < lengths.length; ++i) { @@ -83,7 +63,7 @@ private PathMatchResult handleStemMatch(Set entry, final String path, final Map params) { for (PathTemplateHolder val : entry) { if (val.template.matches(path, params)) { - return new PathMatchResult<>(params, val.template.getTemplateString(), val.value); + return new PathMatchResult(params, val.template.getTemplateString(), val.value); } else { params.clear(); } @@ -96,9 +76,9 @@ Set values = pathTemplateMap.get(trimBase(template)); Set newValues; if (values == null) { - newValues = new TreeSet<>(); + newValues = new TreeSet(); } else { - newValues = new TreeSet<>(values); + newValues = new TreeSet(values); } PathTemplateHolder holder = new PathTemplateHolder(value, template); if (newValues.contains(holder)) { @@ -125,7 +105,7 @@ } private void buildLengths() { - final Set lengths = new TreeSet<>(new Comparator() { + final Set lengths = new TreeSet(new Comparator() { @Override public int compare(Integer o1, Integer o2) { return -o1.compareTo(o2); @@ -148,29 +128,6 @@ return add(template, value); } - public synchronized PathTemplateMatcher addAll(PathTemplateMatcher pathTemplateMatcher) { - for (Entry> entry : pathTemplateMatcher.getPathTemplateMap().entrySet()) { - for (PathTemplateHolder pathTemplateHolder : entry.getValue()) { - add(pathTemplateHolder.template, pathTemplateHolder.value); - } - } - return this; - } - - Map> getPathTemplateMap() { - return pathTemplateMap; - } - - public Set getPathTemplates() { - Set templates = new HashSet<>(); - for (Set holders : pathTemplateMap.values()) { - for (PathTemplateHolder holder: holders) { - templates.add(holder.template); - } - } - return templates; - } - public synchronized PathTemplateMatcher remove(final String pathTemplate) { final PathTemplate template = PathTemplate.create(pathTemplate); return remove(template); @@ -180,9 +137,9 @@ Set values = pathTemplateMap.get(trimBase(template)); Set newValues; if (values == null) { - return this; + newValues = new TreeSet(); } else { - newValues = new TreeSet<>(values); + newValues = new TreeSet(values); } Iterator it = newValues.iterator(); while (it.hasNext()) { @@ -201,29 +158,25 @@ return this; } - - public synchronized T get(String template) { - PathTemplate pathTemplate = PathTemplate.create(template); - Set values = pathTemplateMap.get(trimBase(pathTemplate)); - if(values == null) { - return null; - } - for (PathTemplateHolder next : values) { - if (next.template.getTemplateString().equals(template)) { - return next.value; - } - } - return null; - } - - public static class PathMatchResult extends PathTemplateMatch { + public static class PathMatchResult { + private final Map parameters; + private final String matchedTemplate; private final T value; public PathMatchResult(Map parameters, String matchedTemplate, T value) { - super(matchedTemplate, parameters); + this.parameters = parameters; + this.matchedTemplate = matchedTemplate; this.value = value; } + public Map getParameters() { + return parameters; + } + + public String getMatchedTemplate() { + return matchedTemplate; + } + public T getValue() { return value; } Index: 3rdParty_sources/undertow/io/undertow/util/PipeliningExecutor.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/PipeliningExecutor.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/PipeliningExecutor.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/PipeliningExecutor.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import io.undertow.UndertowLogger; @@ -33,7 +15,7 @@ private final Executor executor; - private static final ThreadLocal> THREAD_QUEUE = new ThreadLocal<>(); + private static final ThreadLocal> THREAD_QUEUE = new ThreadLocal>(); public PipeliningExecutor(Executor executor) { this.executor = executor; @@ -50,7 +32,7 @@ public void run() { LinkedList queue = THREAD_QUEUE.get(); if (queue == null) { - THREAD_QUEUE.set(queue = new LinkedList<>()); + THREAD_QUEUE.set(queue = new LinkedList()); } try { command.run(); Index: 3rdParty_sources/undertow/io/undertow/util/PortableConcurrentDirectDeque.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/PortableConcurrentDirectDeque.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/PortableConcurrentDirectDeque.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/PortableConcurrentDirectDeque.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /* @@ -331,7 +331,7 @@ */ private Node linkFirst(E e) { checkNotNull(e); - final Node newNode = new Node<>(e); + final Node newNode = new Node(e); restartFromHead: for (;;) @@ -364,7 +364,7 @@ */ private Node linkLast(E e) { checkNotNull(e); - final Node newNode = new Node<>(e); + final Node newNode = new Node(e); restartFromTail: for (;;) @@ -798,7 +798,7 @@ * @return the arrayList */ private ArrayList toArrayList() { - ArrayList list = new ArrayList<>(); + ArrayList list = new ArrayList(); for (Node p = first(); p != null; p = succ(p)) { E item = p.item; if (item != null) @@ -811,7 +811,7 @@ * Constructs an empty deque. */ public PortableConcurrentDirectDeque() { - head = tail = new Node<>(null); + head = tail = new Node(null); } /** @@ -828,7 +828,7 @@ Node h = null, t = null; for (E e : c) { checkNotNull(e); - Node newNode = new Node<>(e); + Node newNode = new Node(e); if (h == null) h = t = newNode; else { @@ -846,10 +846,10 @@ private void initHeadTail(Node h, Node t) { if (h == t) { if (h == null) - h = t = new Node<>(null); + h = t = new Node(null); else { // Avoid edge case of a single Node with non-null item. - Node newNode = new Node<>(null); + Node newNode = new Node(null); t.lazySetNext(newNode); newNode.lazySetPrev(t); t = newNode; @@ -1155,7 +1155,7 @@ Node beginningOfTheEnd = null, last = null; for (E e : c) { checkNotNull(e); - Node newNode = new Node<>(e); + Node newNode = new Node(e); if (beginningOfTheEnd == null) beginningOfTheEnd = last = newNode; else { @@ -1416,7 +1416,7 @@ Object item; while ((item = s.readObject()) != null) { @SuppressWarnings("unchecked") - Node newNode = new Node<>((E) item); + Node newNode = new Node((E) item); if (h == null) h = t = newNode; else { @@ -1439,9 +1439,9 @@ // Unsafe mechanics static { - PREV_TERMINATOR = new Node<>(); + PREV_TERMINATOR = new Node(); PREV_TERMINATOR.next = PREV_TERMINATOR; - NEXT_TERMINATOR = new Node<>(); + NEXT_TERMINATOR = new Node(); NEXT_TERMINATOR.prev = NEXT_TERMINATOR; } } Index: 3rdParty_sources/undertow/io/undertow/util/Protocols.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/Protocols.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/Protocols.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/Protocols.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/QValueParser.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/QValueParser.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/QValueParser.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/QValueParser.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -45,7 +45,7 @@ * @return The q value results */ public static List> parse(List headers) { - final List found = new ArrayList<>(); + final List found = new ArrayList(); QValueResult current = null; for (final String header : headers) { final int l = header.length(); @@ -104,13 +104,13 @@ } Collections.sort(found, Collections.reverseOrder()); String currentQValue = null; - List> values = new ArrayList<>(); + List> values = new ArrayList>(); List currentSet = null; for(QValueResult val : found) { if(!val.qvalue.equals(currentQValue)) { currentQValue = val.qvalue; - currentSet = new ArrayList<>(); + currentSet = new ArrayList(); values.add(currentSet); } currentSet.add(val); Index: 3rdParty_sources/undertow/io/undertow/util/QueryParameterUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/QueryParameterUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/QueryParameterUtils.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/QueryParameterUtils.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,34 +1,10 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import java.util.ArrayDeque; import java.util.Deque; import java.util.LinkedHashMap; import java.util.Map; -import org.xnio.OptionMap; -import io.undertow.UndertowOptions; -import io.undertow.server.HttpServerExchange; - /** * Methods for dealing with the query string * @@ -73,98 +49,57 @@ * @param newQueryString The query string * @return The map of key value parameters */ - @Deprecated public static Map> parseQueryString(final String newQueryString) { - return parseQueryString(newQueryString, null); - } - - /** - * Parses a query string into a map - * @param newQueryString The query string - * @return The map of key value parameters - */ - public static Map> parseQueryString(final String newQueryString, final String encoding) { - Map> newQueryParameters = new LinkedHashMap<>(); + Map> newQueryParameters = new LinkedHashMap>(); int startPos = 0; int equalPos = -1; - boolean needsDecode = false; for(int i = 0; i < newQueryString.length(); ++i) { char c = newQueryString.charAt(i); if(c == '=' && equalPos == -1) { equalPos = i; } else if(c == '&') { - handleQueryParameter(newQueryString, newQueryParameters, startPos, equalPos, i, encoding, needsDecode); - needsDecode = false; + handleQueryParameter(newQueryString, newQueryParameters, startPos, equalPos, i); startPos = i + 1; equalPos = -1; - } else if((c == '%' || c == '+') && encoding != null) { - needsDecode = true; } } if(startPos != newQueryString.length()) { - handleQueryParameter(newQueryString, newQueryParameters, startPos, equalPos, newQueryString.length(), encoding, needsDecode); + handleQueryParameter(newQueryString, newQueryParameters, startPos, equalPos, newQueryString.length()); } return newQueryParameters; } - private static void handleQueryParameter(String newQueryString, Map> newQueryParameters, int startPos, int equalPos, int i, final String encoding, boolean needsDecode) { + private static void handleQueryParameter(String newQueryString, Map> newQueryParameters, int startPos, int equalPos, int i) { String key; String value = ""; if(equalPos == -1) { - key = decodeParam(newQueryString, startPos, i, encoding, needsDecode); + key = newQueryString.substring(startPos, i); } else { - key = decodeParam(newQueryString, startPos, equalPos, encoding, needsDecode); - value = decodeParam(newQueryString, equalPos + 1, i, encoding, needsDecode); + key = newQueryString.substring(startPos, equalPos); + value = newQueryString.substring(equalPos + 1, i); } Deque queue = newQueryParameters.get(key); if (queue == null) { - newQueryParameters.put(key, queue = new ArrayDeque<>(1)); + newQueryParameters.put(key, queue = new ArrayDeque(1)); } if(value != null) { queue.add(value); } } - private static String decodeParam(String newQueryString, int startPos, int equalPos, String encoding, boolean needsDecode) { - String key; - if (needsDecode) { - try { - key = URLDecoder.decode(newQueryString.substring(startPos, equalPos), encoding); - } catch (UnsupportedEncodingException e) { - key = newQueryString.substring(startPos, equalPos); - } - } else { - key = newQueryString.substring(startPos, equalPos); - } - return key; - } - @Deprecated public static Map> mergeQueryParametersWithNewQueryString(final Map> queryParameters, final String newQueryString) { - return mergeQueryParametersWithNewQueryString(queryParameters, newQueryString, "UTF-8"); - } - public static Map> mergeQueryParametersWithNewQueryString(final Map> queryParameters, final String newQueryString, final String encoding) { - - Map> newQueryParameters = parseQueryString(newQueryString, encoding); + Map> newQueryParameters = parseQueryString(newQueryString); //according to the spec the new query parameters have to 'take precedence' for (Map.Entry> entry : queryParameters.entrySet()) { if (!newQueryParameters.containsKey(entry.getKey())) { - newQueryParameters.put(entry.getKey(), new ArrayDeque<>(entry.getValue())); + newQueryParameters.put(entry.getKey(), new ArrayDeque(entry.getValue())); } else { newQueryParameters.get(entry.getKey()).addAll(entry.getValue()); } } return newQueryParameters; } - - public static String getQueryParamEncoding(HttpServerExchange exchange) { - String encoding = null; - OptionMap undertowOptions = exchange.getConnection().getUndertowOptions(); - if(undertowOptions.get(UndertowOptions.DECODE_URL, true)) { - encoding = undertowOptions.get(UndertowOptions.URL_CHARSET, "UTF-8"); - } - return encoding; - } } Index: 3rdParty_sources/undertow/io/undertow/util/RedirectBuilder.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/RedirectBuilder.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/RedirectBuilder.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/RedirectBuilder.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import io.undertow.server.HttpServerExchange; Index: 3rdParty_sources/undertow/io/undertow/util/ReferenceCountedPooled.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/ReferenceCountedPooled.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/ReferenceCountedPooled.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/ReferenceCountedPooled.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import io.undertow.UndertowMessages; @@ -32,7 +14,6 @@ @SuppressWarnings("unused") private volatile int referenceCount; private volatile boolean discard = false; - boolean mainFreed = false; private static final AtomicIntegerFieldUpdater referenceCountUpdater = AtomicIntegerFieldUpdater.newUpdater(ReferenceCountedPooled.class, "referenceCount"); @@ -52,13 +33,6 @@ @Override public void free() { - if(mainFreed) { - throw UndertowMessages.MESSAGES.bufferAlreadyFreed(); - } - mainFreed = true; - freeInternal(); - } - public void freeInternal() { if(referenceCountUpdater.decrementAndGet(this) == 0) { if(discard) { underlying.discard(); @@ -73,11 +47,6 @@ return underlying.getResource(); } - @Override - public void close() { - free(); - } - public Pooled createView(final T newValue) { increaseReferenceCount(); return new Pooled() { @@ -88,7 +57,7 @@ public void discard() { if(!free) { free = true; - ReferenceCountedPooled.this.freeInternal(); + ReferenceCountedPooled.this.discard(); } } @@ -97,7 +66,7 @@ //make sure that a given view can only be freed once if(!free) { free = true; - ReferenceCountedPooled.this.freeInternal(); + ReferenceCountedPooled.this.free(); } } @@ -108,11 +77,6 @@ } return newValue; } - - @Override - public void close() { - free(); - } }; } Index: 3rdParty_sources/undertow/io/undertow/util/SameThreadExecutor.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/SameThreadExecutor.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/SameThreadExecutor.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/SameThreadExecutor.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import java.util.concurrent.Executor; Index: 3rdParty_sources/undertow/io/undertow/util/SecureHashMap.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/SecureHashMap.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/SecureHashMap.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/SecureHashMap.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -95,7 +95,7 @@ this.loadFactor = loadFactor; this.initialCapacity = capacity; - final Table table = new Table<>(capacity, loadFactor); + final Table table = new Table(capacity, loadFactor); tableUpdater.set(this, table); } @@ -203,7 +203,7 @@ } // Row doesn't exist, or row exists but item doesn't; try and add a new item to the row. - final Item newItem = new Item<>(key, hashCode, value); + final Item newItem = new Item(key, hashCode, value); final Item[] newRow = addItem(oldRow, newItem); if (! array.compareAndSet(idx, oldRow, newRow)) { // Nope, row changed; retry. @@ -229,7 +229,7 @@ private void resize(Table origTable) { final AtomicReferenceArray[]> origArray = origTable.array; final int origCapacity = origArray.length(); - final Table newTable = new Table<>(origCapacity << 1, loadFactor); + final Table newTable = new Table(origCapacity << 1, loadFactor); // Prevent resize until we're done... newTable.size = 0x80000000; origTable.resizeView = newTable; @@ -633,7 +633,7 @@ } public void clear() { - table = new Table<>(initialCapacity, loadFactor); + table = new Table(initialCapacity, loadFactor); } public Set> entrySet() { @@ -668,13 +668,13 @@ } public Object[] toArray() { - ArrayList list = new ArrayList<>(size()); + ArrayList list = new ArrayList(size()); list.addAll(this); return list.toArray(); } public T[] toArray(final T[] a) { - ArrayList list = new ArrayList<>(); + ArrayList list = new ArrayList(); list.addAll((Collection) this); return list.toArray(a); } @@ -703,13 +703,13 @@ } public Object[] toArray() { - ArrayList list = new ArrayList<>(size()); + ArrayList list = new ArrayList(size()); list.addAll(this); return list.toArray(); } public T[] toArray(final T[] a) { - ArrayList list = new ArrayList<>(); + ArrayList list = new ArrayList(); list.addAll((Collection) this); return list.toArray(a); } @@ -743,13 +743,13 @@ } public Object[] toArray() { - ArrayList list = new ArrayList<>(size()); + ArrayList list = new ArrayList(size()); list.addAll(this); return list.toArray(); } public T[] toArray(final T[] a) { - ArrayList list = new ArrayList<>(); + ArrayList list = new ArrayList(); list.addAll((Set) this); return list.toArray(a); } @@ -1061,7 +1061,7 @@ volatile Table resizeView; private Table(int capacity, float loadFactor) { - array = new AtomicReferenceArray<>(capacity); + array = new AtomicReferenceArray[]>(capacity); threshold = capacity == MAXIMUM_CAPACITY ? Integer.MAX_VALUE : (int)(capacity * loadFactor); } } Index: 3rdParty_sources/undertow/io/undertow/util/Sessions.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/Sessions.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/Sessions.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/Sessions.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import io.undertow.UndertowMessages; Index: 3rdParty_sources/undertow/io/undertow/util/SimpleAttachmentKey.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/SimpleAttachmentKey.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/SimpleAttachmentKey.java 8 Sep 2014 09:46:41 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/SimpleAttachmentKey.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/StatusCodes.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/StatusCodes.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/StatusCodes.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/StatusCodes.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; @@ -25,30 +25,25 @@ //chosen simply because it gives no collisions //if more codes are added this will need to be re-evaluated - private static final int SIZE = 0x2df; + private static final int SIZE = 0x3f; private static final Entry[] TABLE = new Entry[SIZE]; public static final int CONTINUE = 100; public static final int SWITCHING_PROTOCOLS = 101; - public static final int PROCESSING = 102; public static final int OK = 200; public static final int CREATED = 201; public static final int ACCEPTED = 202; public static final int NON_AUTHORITATIVE_INFORMATION = 203; public static final int NO_CONTENT = 204; public static final int RESET_CONTENT = 205; public static final int PARTIAL_CONTENT = 206; - public static final int MULTI_STATUS = 207; - public static final int ALREADY_REPORTED = 208; - public static final int IM_USED = 226; public static final int MULTIPLE_CHOICES = 300; public static final int MOVED_PERMENANTLY = 301; public static final int FOUND = 302; public static final int SEE_OTHER = 303; public static final int NOT_MODIFIED = 304; public static final int USE_PROXY = 305; public static final int TEMPORARY_REDIRECT = 307; - public static final int PERMANENT_REDIRECT = 308; public static final int BAD_REQUEST = 400; public static final int UNAUTHORIZED = 401; public static final int PAYMENT_REQUIRED = 402; @@ -67,45 +62,29 @@ public static final int UNSUPPORTED_MEDIA_TYPE = 415; public static final int REQUEST_RANGE_NOT_SATISFIABLE = 416; public static final int EXPECTATION_FAILED = 417; - public static final int UNPROCESSABLE_ENTITY = 422; - public static final int LOCKED = 423; - public static final int FAILED_DEPENDENCY = 424; - public static final int UPGRADE_REQUIRED = 426; - public static final int PRECONDITION_REQUIRED = 428; - public static final int TOO_MANY_REQUESTS = 429; - public static final int REQUEST_HEADER_FIELDS_TOO_LARGE = 431; public static final int INTERNAL_SERVER_ERROR = 500; public static final int NOT_IMPLEMENTED = 501; public static final int BAD_GATEWAY = 502; public static final int SERVICE_UNAVAILABLE = 503; public static final int GATEWAY_TIME_OUT = 504; public static final int HTTP_VERSION_NOT_SUPPORTED = 505; - public static final int INSUFFICIENT_STORAGE = 507; - public static final int LOOP_DETECTED = 508; - public static final int NOT_EXTENDED = 510; - public static final int NETWORK_AUTHENTICATION_REQUIRED = 511; public static final String CONTINUE_STRING = "Continue"; public static final String SWITCHING_PROTOCOLS_STRING = "Switching Protocols"; - public static final String PROCESSING_STRING = "Processing"; public static final String OK_STRING = "OK"; public static final String CREATED_STRING = "Created"; public static final String ACCEPTED_STRING = "Accepted"; public static final String NON_AUTHORITATIVE_INFORMATION_STRING = "Non-Authoritative Information"; public static final String NO_CONTENT_STRING = "No Content"; public static final String RESET_CONTENT_STRING = "Reset Content"; public static final String PARTIAL_CONTENT_STRING = "Partial Content"; - public static final String MULTI_STATUS_STRING = "Multi-Status"; - public static final String ALREADY_REPORTED_STRING = "Already Reported"; - public static final String IM_USED_STRING = "IM Used"; public static final String MULTIPLE_CHOICES_STRING = "Multiple Choices"; public static final String MOVED_PERMANENTLY_STRING = "Moved Permanently"; public static final String FOUND_STRING = "Found"; public static final String SEE_OTHER_STRING = "See Other"; public static final String NOT_MODIFIED_STRING = "Not Modified"; public static final String USE_PROXY_STRING = "Use Proxy"; public static final String TEMPORARY_REDIRECT_STRING = "Temporary Redirect"; - public static final String PERMANENT_REDIRECT_STRING = "Permanent Redirect"; public static final String BAD_REQUEST_STRING = "Bad Request"; public static final String UNAUTHORIZED_STRING = "Unauthorized"; public static final String PAYMENT_REQUIRED_STRING = "Payment Required"; @@ -124,46 +103,30 @@ public static final String UNSUPPORTED_MEDIA_TYPE_STRING = "Unsupported Media Type"; public static final String REQUEST_RANGE_NOT_SATISFIABLE_STRING = "Requested range not satisfiable"; public static final String EXPECTATION_FAILED_STRING = "Expectation Failed"; - public static final String UNPROCESSABLE_ENTITY_STRING = "Unprocessable Entity"; - public static final String LOCKED_STRING = "Locked"; - public static final String FAILED_DEPENDENCY_STRING = "Failed Dependency"; - public static final String UPGRADE_REQUIRED_STRING = "Upgrade Required"; - public static final String PRECONDITION_REQUIRED_STRING = "Precondition Required"; - public static final String TOO_MANY_REQUESTS_STRING = "Too Many Requests"; - public static final String REQUEST_HEADER_FIELDS_TOO_LARGE_STRING = "Request Header Fields Too Large"; public static final String INTERNAL_SERVER_ERROR_STRING = "Internal Server Error"; public static final String NOT_IMPLEMENTED_STRING = "Not Implemented"; public static final String BAD_GATEWAY_STRING = "Bad Gateway"; public static final String SERVICE_UNAVAILABLE_STRING = "Service Unavailable"; public static final String GATEWAY_TIME_OUT_STRING = "Gateway Time-out"; public static final String HTTP_VERSION_NOT_SUPPORTED_STRING = "HTTP Version not supported"; - public static final String INSUFFICIENT_STORAGE_STRING = "Insufficient Storage"; - public static final String LOOP_DETECTED_STRING = "Loop Detected"; - public static final String NOT_EXTENDED_STRING = "Not Extended"; - public static final String NETWORK_AUTHENTICATION_REQUIRED_STRING = "Network Authentication Required"; static { putCode(CONTINUE, CONTINUE_STRING); putCode(SWITCHING_PROTOCOLS, SWITCHING_PROTOCOLS_STRING); - putCode(PROCESSING, PROCESSING_STRING); putCode(OK, OK_STRING); putCode(CREATED, CREATED_STRING); putCode(ACCEPTED, ACCEPTED_STRING); putCode(NON_AUTHORITATIVE_INFORMATION, NON_AUTHORITATIVE_INFORMATION_STRING); putCode(NO_CONTENT, NO_CONTENT_STRING); putCode(RESET_CONTENT, RESET_CONTENT_STRING); putCode(PARTIAL_CONTENT, PARTIAL_CONTENT_STRING); - putCode(MULTI_STATUS, MULTI_STATUS_STRING); - putCode(ALREADY_REPORTED, ALREADY_REPORTED_STRING); - putCode(IM_USED, IM_USED_STRING); putCode(MULTIPLE_CHOICES, MULTIPLE_CHOICES_STRING); putCode(MOVED_PERMENANTLY, MOVED_PERMANENTLY_STRING); putCode(FOUND, FOUND_STRING); putCode(SEE_OTHER, SEE_OTHER_STRING); putCode(NOT_MODIFIED, NOT_MODIFIED_STRING); putCode(USE_PROXY, USE_PROXY_STRING); putCode(TEMPORARY_REDIRECT, TEMPORARY_REDIRECT_STRING); - putCode(PERMANENT_REDIRECT, PERMANENT_REDIRECT_STRING); putCode(BAD_REQUEST, BAD_REQUEST_STRING); putCode(UNAUTHORIZED, UNAUTHORIZED_STRING); putCode(PAYMENT_REQUIRED, PAYMENT_REQUIRED_STRING); @@ -182,23 +145,12 @@ putCode(UNSUPPORTED_MEDIA_TYPE, UNSUPPORTED_MEDIA_TYPE_STRING); putCode(REQUEST_RANGE_NOT_SATISFIABLE, REQUEST_RANGE_NOT_SATISFIABLE_STRING); putCode(EXPECTATION_FAILED, EXPECTATION_FAILED_STRING); - putCode(UNPROCESSABLE_ENTITY, UNPROCESSABLE_ENTITY_STRING); - putCode(LOCKED, LOCKED_STRING); - putCode(FAILED_DEPENDENCY, FAILED_DEPENDENCY_STRING); - putCode(UPGRADE_REQUIRED, UPGRADE_REQUIRED_STRING); - putCode(PRECONDITION_REQUIRED, PRECONDITION_REQUIRED_STRING); - putCode(TOO_MANY_REQUESTS, TOO_MANY_REQUESTS_STRING); - putCode(REQUEST_HEADER_FIELDS_TOO_LARGE, REQUEST_HEADER_FIELDS_TOO_LARGE_STRING); putCode(INTERNAL_SERVER_ERROR, INTERNAL_SERVER_ERROR_STRING); putCode(NOT_IMPLEMENTED, NOT_IMPLEMENTED_STRING); putCode(BAD_GATEWAY, BAD_GATEWAY_STRING); putCode(SERVICE_UNAVAILABLE, SERVICE_UNAVAILABLE_STRING); putCode(GATEWAY_TIME_OUT, GATEWAY_TIME_OUT_STRING); putCode(HTTP_VERSION_NOT_SUPPORTED, HTTP_VERSION_NOT_SUPPORTED_STRING); - putCode(INSUFFICIENT_STORAGE, INSUFFICIENT_STORAGE_STRING); - putCode(LOOP_DETECTED, LOOP_DETECTED_STRING); - putCode(NOT_EXTENDED, NOT_EXTENDED_STRING); - putCode(NETWORK_AUTHENTICATION_REQUIRED, NETWORK_AUTHENTICATION_REQUIRED_STRING); } Index: 3rdParty_sources/undertow/io/undertow/util/StringReadChannelListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/StringReadChannelListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/StringReadChannelListener.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/StringReadChannelListener.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import java.io.IOException; Index: 3rdParty_sources/undertow/io/undertow/util/StringWriteChannelListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/StringWriteChannelListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/StringWriteChannelListener.java 8 Sep 2014 09:46:40 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/StringWriteChannelListener.java 8 Sep 2014 10:52:05 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.util; Index: 3rdParty_sources/undertow/io/undertow/util/URLUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/util/Attic/URLUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/util/URLUtils.java 8 Sep 2014 09:46:39 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/util/URLUtils.java 8 Sep 2014 10:52:04 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.util; import io.undertow.UndertowMessages; Index: 3rdParty_sources/undertow/io/undertow/websockets/WebSocketConnectionCallback.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/Attic/WebSocketConnectionCallback.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/WebSocketConnectionCallback.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/WebSocketConnectionCallback.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,19 +1,17 @@ /* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. + * Copyright 2012 JBoss, by Red Hat, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets; Index: 3rdParty_sources/undertow/io/undertow/websockets/WebSocketExtension.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/Attic/WebSocketExtension.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/WebSocketExtension.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/WebSocketExtension.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets; import java.util.ArrayList; @@ -32,7 +14,7 @@ public WebSocketExtension(String name, List parameters) { this.name = name; - this.parameters = Collections.unmodifiableList(new ArrayList<>(parameters)); + this.parameters = Collections.unmodifiableList(new ArrayList(parameters)); } public String getName() { @@ -77,13 +59,13 @@ } public static List parse(final String extensionHeader) { - List extensions = new ArrayList<>(); + List extensions = new ArrayList(); //TODO: more efficient parsing algorithm String[] parts = extensionHeader.split(","); for (String part : parts) { String[] items = part.split(";"); if (items.length > 0) { - final List params = new ArrayList<>(items.length - 1); + final List params = new ArrayList(items.length - 1); String name = items[0]; for (int i = 1; i < items.length; ++i) { String[] param = items[i].split("="); Index: 3rdParty_sources/undertow/io/undertow/websockets/WebSocketProtocolHandshakeHandler.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/Attic/WebSocketProtocolHandshakeHandler.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/WebSocketProtocolHandshakeHandler.java 8 Sep 2014 09:47:05 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/WebSocketProtocolHandshakeHandler.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets; @@ -33,10 +33,8 @@ import org.xnio.StreamConnection; import java.util.Collection; -import java.util.Collections; import java.util.HashSet; import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; /** * {@link HttpHandler} which will process the {@link HttpServerExchange} and do the actual handshake/upgrade @@ -54,8 +52,6 @@ private final WebSocketConnectionCallback callback; - private final Set peerConnections = Collections.newSetFromMap(new ConcurrentHashMap()); - /** * The handler that is invoked if there are no web socket headers */ @@ -79,7 +75,7 @@ */ public WebSocketProtocolHandshakeHandler(final WebSocketConnectionCallback callback, final HttpHandler next) { this.callback = callback; - Set handshakes = new HashSet<>(); + Set handshakes = new HashSet(); handshakes.add(new Hybi13Handshake()); handshakes.add(new Hybi08Handshake()); handshakes.add(new Hybi07Handshake()); @@ -108,7 +104,7 @@ */ public WebSocketProtocolHandshakeHandler(Collection handshakes, final WebSocketConnectionCallback callback, final HttpHandler next) { this.callback = callback; - this.handshakes = new HashSet<>(handshakes); + this.handshakes = new HashSet(handshakes); this.next = next; this.upgradeListener = null; } @@ -131,7 +127,7 @@ */ public WebSocketProtocolHandshakeHandler(final HttpUpgradeListener callback, final HttpHandler next) { this.callback = null; - Set handshakes = new HashSet<>(); + Set handshakes = new HashSet(); handshakes.add(new Hybi13Handshake()); handshakes.add(new Hybi08Handshake()); handshakes.add(new Hybi07Handshake()); @@ -161,7 +157,7 @@ */ public WebSocketProtocolHandshakeHandler(Collection handshakes, final HttpUpgradeListener callback, final HttpHandler next) { this.callback = null; - this.handshakes = new HashSet<>(handshakes); + this.handshakes = new HashSet(handshakes); this.next = next; this.upgradeListener = callback; } @@ -173,7 +169,7 @@ next.handleRequest(exchange); return; } - final AsyncWebSocketHttpServerExchange facade = new AsyncWebSocketHttpServerExchange(exchange, peerConnections); + final AsyncWebSocketHttpServerExchange facade = new AsyncWebSocketHttpServerExchange(exchange); Handshake handshaker = null; for (Handshake method : handshakes) { if (method.matches(facade)) { @@ -191,7 +187,6 @@ @Override public void handleUpgrade(StreamConnection streamConnection, HttpServerExchange exchange) { WebSocketChannel channel = selected.createChannel(facade, streamConnection, facade.getBufferPool()); - peerConnections.add(channel); callback.onConnect(facade, channel); } }); @@ -201,8 +196,4 @@ handshaker.handshake(facade); } } - - public Set getPeerConnections() { - return peerConnections; - } } Index: 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocket13ClientHandshake.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/client/Attic/WebSocket13ClientHandshake.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocket13ClientHandshake.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocket13ClientHandshake.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.client; import io.undertow.util.FlexBase64; @@ -38,7 +20,6 @@ import java.security.SecureRandom; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -64,12 +45,12 @@ @Override public WebSocketChannel createChannel(final StreamConnection channel, final String wsUri, final Pool bufferPool) { - return new WebSocket13Channel(channel, bufferPool, wsUri, negotiation != null ? negotiation.getSelectedSubProtocol() : "", true, false, new HashSet()); + return new WebSocket13Channel(channel, bufferPool, wsUri, negotiation != null ? negotiation.getSelectedSubProtocol() : "", true, false); } public Map createHeaders() { - Map headers = new HashMap<>(); + Map headers = new HashMap(); headers.put(Headers.UPGRADE_STRING, "websocket"); headers.put(Headers.CONNECTION_STRING, "upgrade"); String key = createSecKey(); Index: 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocketClient.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/client/Attic/WebSocketClient.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocketClient.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocketClient.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,27 +1,7 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.client; import io.undertow.websockets.core.WebSocketChannel; import io.undertow.websockets.core.WebSocketVersion; - -import org.xnio.Cancellable; import org.xnio.ChannelListener; import org.xnio.FutureResult; import org.xnio.IoFuture; @@ -59,7 +39,7 @@ public static IoFuture connect(XnioWorker worker, XnioSsl ssl, final Pool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version, WebSocketClientNegotiation clientNegotiation) { - final FutureResult ioFuture = new FutureResult<>(); + final FutureResult ioFuture = new FutureResult(); final URI newUri; try { newUri = new URI(uri.getScheme().equals("wss") ? "https" : "http", uri.getUserInfo(), uri.getHost(), uri.getPort() == -1 ? (uri.getScheme().equals("wss") ? 443 : 80) : uri.getPort(), uri.getPath().isEmpty() ? "/" : uri.getPath(), uri.getQuery(), uri.getFragment()); @@ -71,7 +51,7 @@ if (clientNegotiation != null) { clientNegotiation.beforeRequest(headers); } - final IoFuture result; + IoFuture result; if (ssl != null) { result = HttpUpgrade.performUpgrade(worker, ssl, null, newUri, headers, new ChannelListener() { @Override @@ -97,13 +77,6 @@ } } }, null); - ioFuture.addCancelHandler(new Cancellable() { - @Override - public Cancellable cancel() { - result.cancel(); - return null; - } - }); return ioFuture.getIoFuture(); } Index: 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocketClientHandshake.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/client/Attic/WebSocketClientHandshake.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocketClientHandshake.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocketClientHandshake.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.client; import io.undertow.websockets.core.WebSocketChannel; Index: 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocketClientNegotiation.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/client/Attic/WebSocketClientNegotiation.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocketClientNegotiation.java 8 Sep 2014 09:47:07 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/client/WebSocketClientNegotiation.java 8 Sep 2014 10:52:20 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.client; import io.undertow.websockets.WebSocketExtension; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/AbstractReceiveListener.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/AbstractReceiveListener.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/AbstractReceiveListener.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/AbstractReceiveListener.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.core; import org.xnio.ChannelListener; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/BinaryOutputStream.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/BinaryOutputStream.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/BinaryOutputStream.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/BinaryOutputStream.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,19 +1,17 @@ /* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. + * Copyright 2013 JBoss, by Red Hat, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/BufferedBinaryMessage.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/BufferedBinaryMessage.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/BufferedBinaryMessage.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/BufferedBinaryMessage.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.core; import io.undertow.util.ImmediatePooled; @@ -36,7 +18,7 @@ public class BufferedBinaryMessage { private final boolean bufferFullMessage; - private List> data = new ArrayList<>(1); + private List> data = new ArrayList>(1); private Pooled current; private final long maxMessageSize; private long currentSize; @@ -97,9 +79,6 @@ channel.getReadSetter().set(new ChannelListener() { @Override public void handleEvent(StreamSourceFrameChannel channel) { - if(complete ) { - return; - } try { for (; ; ) { if (current == null) { @@ -170,7 +149,7 @@ public Pooled getData() { if (current == null) { - return new ImmediatePooled<>(new ByteBuffer[0]); + return new ImmediatePooled(new ByteBuffer[0]); } if (data.isEmpty()) { final Pooled current = this.current; @@ -187,7 +166,7 @@ ret[i] = data.get(i).getResource(); } List> data = this.data; - this.data = new ArrayList<>(); + this.data = new ArrayList>(); return new PooledByteBufferArray(data, ret); } @@ -224,10 +203,5 @@ public ByteBuffer[] getResource() throws IllegalStateException { return data; } - - @Override - public void close() { - free(); - } } } Index: 3rdParty_sources/undertow/io/undertow/websockets/core/BufferedTextMessage.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/BufferedTextMessage.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/BufferedTextMessage.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/BufferedTextMessage.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.core; import org.xnio.ChannelListener; @@ -115,9 +97,6 @@ channel.getReadSetter().set(new ChannelListener() { @Override public void handleEvent(StreamSourceFrameChannel channel) { - if(complete ) { - return; - } Pooled pooled = channel.getWebSocketChannel().getBufferPool().allocate(); final ByteBuffer buffer = pooled.getResource(); try { Index: 3rdParty_sources/undertow/io/undertow/websockets/core/CloseMessage.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/CloseMessage.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/CloseMessage.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/CloseMessage.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.core; import java.nio.ByteBuffer; @@ -30,8 +12,8 @@ private static final Charset utf8 = Charset.forName("UTF-8"); - private final int code; - private final String reason; + private final int reason; + private final String string; /* * For the exact meaning of the codes refer to the WebSocket * RFC Section 7.4. @@ -48,35 +30,35 @@ public CloseMessage(final ByteBuffer buffer) { if(buffer.remaining() >= 2) { - code = (buffer.get() & 0XFF) << 8 | (buffer.get() & 0xFF); - reason = new UTF8Output(buffer).extract(); + reason = (buffer.get() & 0XFF) << 8 | (buffer.get() & 0xFF); + string = new UTF8Output(buffer).extract(); } else { - code = GOING_AWAY; - reason = ""; + reason = GOING_AWAY; + string = ""; } } - public CloseMessage(int code, String reason) { - this.code = code; - this.reason = reason == null ? "" : reason; + public CloseMessage(int reason, String string) { + this.reason = reason; + this.string = string; } public CloseMessage(final ByteBuffer[] buffers) { this(WebSockets.mergeBuffers(buffers)); } - public String getReason() { + public int getReason() { return reason; } - public int getCode() { - return code; + public String getString() { + return string; } public ByteBuffer toByteBuffer() { - byte[] data = reason.getBytes(utf8); + byte[] data = string.getBytes(utf8); ByteBuffer buffer = ByteBuffer.allocate(data.length + 2); - buffer.putShort((short) code); + buffer.putShort((short)reason); buffer.put(data); buffer.flip(); return buffer; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/FixedPayloadFrameSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/FixedPayloadFrameSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/FixedPayloadFrameSourceChannel.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/FixedPayloadFrameSourceChannel.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/InvalidOpCodeException.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/InvalidOpCodeException.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/InvalidOpCodeException.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/InvalidOpCodeException.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.core; /** Index: 3rdParty_sources/undertow/io/undertow/websockets/core/SendChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/SendChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/SendChannel.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/SendChannel.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2013 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/StreamSinkFrameChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/StreamSinkFrameChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/StreamSinkFrameChannel.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/StreamSinkFrameChannel.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; @@ -51,6 +51,9 @@ if (!areExtensionsSupported() && rsv != 0) { throw WebSocketMessages.MESSAGES.extensionsNotSupported(); } + if (isActivated()) { + throw WebSocketMessages.MESSAGES.writeInProgress(); + } this.rsv = rsv; } Index: 3rdParty_sources/undertow/io/undertow/websockets/core/StreamSourceFrameChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/StreamSourceFrameChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/StreamSourceFrameChannel.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/StreamSourceFrameChannel.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,26 +9,25 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; -import java.io.IOException; -import java.nio.ByteBuffer; +import io.undertow.server.protocol.framed.AbstractFramedStreamSourceChannel; import org.xnio.ChannelExceptionHandler; import org.xnio.ChannelListener; import org.xnio.ChannelListeners; import org.xnio.IoUtils; import org.xnio.Pooled; import org.xnio.channels.StreamSourceChannel; -import io.undertow.server.protocol.framed.AbstractFramedStreamSourceChannel; -import io.undertow.server.protocol.framed.FrameHeaderData; +import java.io.IOException; +import java.nio.ByteBuffer; /** * Base class for processes Frame bases StreamSourceChannels. @@ -122,11 +121,5 @@ this.finalFragment = true; } - @Override - protected void handleHeaderData(FrameHeaderData headerData) { - super.handleHeaderData(headerData); - if (((WebSocketFrame) headerData).isFinalFragment()) { - finalFrame(); - } - } + } Index: 3rdParty_sources/undertow/io/undertow/websockets/core/UTF8Output.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/UTF8Output.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/UTF8Output.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/UTF8Output.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketCallback.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketCallback.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketCallback.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketCallback.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.core; /** Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketChannel.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketChannel.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,19 +9,17 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; -import io.undertow.conduits.IdleTimeoutConduit; import io.undertow.server.protocol.framed.AbstractFramedChannel; import io.undertow.server.protocol.framed.FrameHeaderData; import org.xnio.ChannelExceptionHandler; -import org.xnio.ChannelListener; import org.xnio.ChannelListeners; import org.xnio.IoUtils; import org.xnio.Pool; @@ -65,49 +63,26 @@ protected StreamSourceFrameChannel fragmentedChannel; /** - * Represents all web socket channels that are attached to the same endpoint. - */ - private final Set peerConnections; - - /** * Create a new {@link WebSocketChannel} * 8 * * @param connectedStreamChannel The {@link org.xnio.channels.ConnectedStreamChannel} over which the WebSocket Frames should get send and received. * Be aware that it already must be "upgraded". * @param bufferPool The {@link org.xnio.Pool} which will be used to acquire {@link java.nio.ByteBuffer}'s from. - * @param version The {@link WebSocketVersion} of the {@link WebSocketChannel} + * @param version The {@link io.undertow.websockets.core.WebSocketVersion} of the {@link io.undertow.websockets.core.WebSocketChannel} * @param wsUrl The url for which the channel was created. * @param client - * @param peerConnections The concurrent set that is used to track open connections associtated with an endpoint */ - protected WebSocketChannel(final StreamConnection connectedStreamChannel, Pool bufferPool, WebSocketVersion version, String wsUrl, String subProtocol, final boolean client, boolean extensionsSupported, Set peerConnections) { - super(connectedStreamChannel, bufferPool, new WebSocketFramePriority(), null); + protected WebSocketChannel(final StreamConnection connectedStreamChannel, Pool bufferPool, WebSocketVersion version, String wsUrl, String subProtocol, final boolean client, boolean extensionsSupported) { + super(connectedStreamChannel, bufferPool, new WebSocketFramePriority()); this.client = client; this.version = version; this.wsUrl = wsUrl; this.extensionsSupported = extensionsSupported; this.subProtocol = subProtocol; - this.peerConnections = peerConnections; - addCloseTask(new ChannelListener() { - @Override - public void handleEvent(WebSocketChannel channel) { - WebSocketChannel.this.peerConnections.remove(WebSocketChannel.this); - } - }); } @Override - protected IdleTimeoutConduit createIdleTimeoutChannel(final StreamConnection connectedStreamChannel) { - return new IdleTimeoutConduit(connectedStreamChannel.getSinkChannel().getConduit(), connectedStreamChannel.getSourceChannel().getConduit()) { - @Override - protected void doClose() { - WebSockets.sendClose(CloseMessage.GOING_AWAY, null, WebSocketChannel.this, null); - } - }; - } - - @Override protected boolean isLastFrameSent() { return closeFrameSent; } @@ -122,21 +97,8 @@ super.markReadsBroken(cause); } - @Override - protected void lastDataRead() { - if(!closeFrameReceived && !closeFrameSent) { - //the peer has likely already gone away, but try and send a close frame anyway - //this will likely just result in the write() failing an immediate connection termination - //which is what we want - closeFrameReceived = true; //not strictly true, but the read side is gone - try { - sendClose(); - } catch (IOException e) { - IoUtils.safeClose(this); - } - } - } + protected boolean isReadsBroken() { return super.isReadsBroken(); } @@ -314,9 +276,6 @@ * to transmit no payload at all. */ public final StreamSinkFrameChannel send(WebSocketFrameType type, long payloadSize) throws IOException { - if(closeFrameSent || (closeFrameReceived && type != WebSocketFrameType.CLOSE)) { - throw WebSocketMessages.MESSAGES.channelClosed(); - } if (payloadSize < 0) { throw WebSocketMessages.MESSAGES.negativePayloadLength(); } @@ -367,7 +326,6 @@ } } )); - closeChannel.resumeWrites(); } } @@ -385,15 +343,6 @@ return (WebSocketFramePriority) super.getFramePriority(); } - /** - * Returns all 'peer' web socket connections that were created from the same endpoint. - * - * - * @return all 'peer' web socket connections - */ - public Set getPeerConnections() { - return Collections.unmodifiableSet(peerConnections); - } /** * Interface that represents a frame channel that is in the process of being created Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketException.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketException.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketException.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketException.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Fisheye: Tag 1.1.2.2 refers to a dead (removed) revision in file `3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFrame.java'. Fisheye: No comparison available. Pass `N' to diff? Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFrameCorruptedException.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketFrameCorruptedException.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFrameCorruptedException.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFrameCorruptedException.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFramePriority.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketFramePriority.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFramePriority.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFramePriority.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.core; import io.undertow.server.protocol.framed.FramePriority; @@ -39,7 +21,7 @@ *

    * TODO: provide a way to disable this. */ - private final Queue strictOrderQueue = new ConcurrentLinkedDeque<>(); + private final Queue strictOrderQueue = new ConcurrentLinkedDeque(); private StreamSinkFrameChannel currentFragmentedSender; boolean closed = false; boolean immediateCloseFrame = false; @@ -115,21 +97,6 @@ @Override public void frameAdded(StreamSinkFrameChannel addedFrame, List pendingFrames, Deque holdFrames) { if (addedFrame.isFinalFragment()) { - while (true) { - StreamSinkFrameChannel frame = strictOrderQueue.peek(); - if(frame == null) { - break; - } - if(holdFrames.contains(frame)) { - if(insertFrame(frame, pendingFrames)) { - holdFrames.remove(frame); - } else { - break; - } - } else { - break; - } - } while (!holdFrames.isEmpty()) { StreamSinkFrameChannel frame = holdFrames.peek(); if (insertFrame(frame, pendingFrames)) { Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFrameType.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketFrameType.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFrameType.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketFrameType.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketHandshakeException.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketHandshakeException.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketHandshakeException.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketHandshakeException.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketInvalidCloseCodeException.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketInvalidCloseCodeException.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketInvalidCloseCodeException.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketInvalidCloseCodeException.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketLogger.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketLogger.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketLogger.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketLogger.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; @@ -61,8 +61,4 @@ @LogMessage(level = Logger.Level.ERROR) @Message(id = 25006, value = "Failed to get idle timeout") void getIdleTimeFailed(@Cause Throwable cause); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 25007, value = "Unhandled exception for annotated endpoint %s") - void unhandledErrorInAnnotatedEndpoint(Object instance, @Cause Throwable thr); } Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketMessages.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketMessages.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketMessages.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketMessages.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketUtils.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketUtils.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketUtils.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketUtils.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,15 +9,14 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; -import io.undertow.UndertowLogger; import org.xnio.Buffers; import org.xnio.ChannelExceptionHandler; import org.xnio.ChannelListener; @@ -181,7 +180,7 @@ try { streamSinkFrameChannel.shutdownWrites(); } catch (IOException e) { - UndertowLogger.REQUEST_IO_LOGGER.ioException(e); + e.printStackTrace(); IoUtils.safeClose(streamSinkFrameChannel, channel); return; } @@ -200,8 +199,7 @@ }, new ChannelExceptionHandler() { @Override public void handleException(StreamSinkFrameChannel streamSinkFrameChannel, IOException e) { - - UndertowLogger.REQUEST_IO_LOGGER.ioException(e); + e.printStackTrace(); IoUtils.safeClose(streamSinkFrameChannel, channel); } @@ -216,21 +214,22 @@ IoUtils.safeClose(streamSinkFrameChannel); } } catch (IOException e) { - UndertowLogger.REQUEST_IO_LOGGER.ioException(e); + e.printStackTrace(); IoUtils.safeClose(streamSinkFrameChannel, channel); } } }, new ChannelExceptionHandler() { @Override public void handleException(StreamSourceFrameChannel streamSourceFrameChannel, IOException e) { - UndertowLogger.REQUEST_IO_LOGGER.ioException(e); + e.printStackTrace(); IoUtils.safeClose(streamSourceFrameChannel, channel); } }, new ChannelExceptionHandler() { @Override public void handleException(StreamSinkFrameChannel streamSinkFrameChannel, IOException e) { - UndertowLogger.REQUEST_IO_LOGGER.ioException(e); + e.printStackTrace(); + IoUtils.safeClose(streamSinkFrameChannel, channel); } }, channel.getBufferPool() @@ -284,7 +283,7 @@ } if (res == 0) { // write first listener - final TransferListener listener = new TransferListener<>(allocated, source, sink, sourceListener, sinkListener, writeExceptionHandler, readExceptionHandler, 1); + final TransferListener listener = new TransferListener(allocated, source, sink, sourceListener, sinkListener, writeExceptionHandler, readExceptionHandler, 1); source.suspendReads(); source.getReadSetter().set(listener); sink.getWriteSetter().set(listener); @@ -300,7 +299,7 @@ } } } while (transferred > 0L); - final TransferListener listener = new TransferListener<>(allocated, source, sink, sourceListener, sinkListener, writeExceptionHandler, readExceptionHandler, 0); + final TransferListener listener = new TransferListener(allocated, source, sink, sourceListener, sinkListener, writeExceptionHandler, readExceptionHandler, 0); sink.suspendWrites(); sink.getWriteSetter().set(listener); source.getReadSetter().set(listener); Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketVersion.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSocketVersion.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketVersion.java 8 Sep 2014 09:46:43 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSocketVersion.java 8 Sep 2014 10:52:06 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/WebSockets.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/Attic/WebSockets.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/WebSockets.java 8 Sep 2014 09:46:44 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/WebSockets.java 8 Sep 2014 10:52:07 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.core; import org.xnio.Buffers; @@ -48,40 +30,18 @@ sendInternal(new ByteBuffer[]{data}, WebSocketFrameType.TEXT, wsChannel, callback); } - /** * Sends a complete text message, invoking the callback when complete * * @param message * @param wsChannel - * @param callback */ - public static void sendText(final ByteBuffer message, final WebSocketChannel wsChannel, final WebSocketCallback callback) { - sendInternal(new ByteBuffer[]{message}, WebSocketFrameType.TEXT, wsChannel, callback); - } - - /** - * Sends a complete text message, invoking the callback when complete - * - * @param message - * @param wsChannel - */ public static void sendTextBlocking(final String message, final WebSocketChannel wsChannel) throws IOException { final ByteBuffer data = ByteBuffer.wrap(message.getBytes(utf8)); sendBlockingInternal(new ByteBuffer[]{data}, WebSocketFrameType.TEXT, wsChannel); } /** - * Sends a complete text message, invoking the callback when complete - * - * @param message - * @param wsChannel - */ - public static void sendTextBlocking(final ByteBuffer message, final WebSocketChannel wsChannel) throws IOException { - sendBlockingInternal(new ByteBuffer[]{message}, WebSocketFrameType.TEXT, wsChannel); - } - - /** * Sends a complete ping message, invoking the callback when complete * * @param data @@ -234,26 +194,6 @@ /** * Sends a complete close message, invoking the callback when complete * - * @param code The close code - * @param wsChannel - * @param callback - */ - public static void sendClose(final int code, String reason, final WebSocketChannel wsChannel, final WebSocketCallback callback) { - sendClose(new CloseMessage(code, reason).toByteBuffer(), wsChannel, callback); - } - - /** - * Sends a complete close message, invoking the callback when complete - * - * @param code - * @param wsChannel - */ - public static void sendCloseBlocking(final int code, String reason, final WebSocketChannel wsChannel) throws IOException { - sendCloseBlocking(new CloseMessage(code, reason).toByteBuffer(), wsChannel); - } - /** - * Sends a complete close message, invoking the callback when complete - * * @param data * @param wsChannel */ Index: 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunction.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/function/Attic/ChannelFunction.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunction.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunction.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.function; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionFileChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/function/Attic/ChannelFunctionFileChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionFileChannel.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionFileChannel.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.function; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionReadableByteChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/function/Attic/ChannelFunctionReadableByteChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionReadableByteChannel.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionReadableByteChannel.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.function; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionStreamSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/function/Attic/ChannelFunctionStreamSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionStreamSourceChannel.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionStreamSourceChannel.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.function; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionWritableByteChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/function/Attic/ChannelFunctionWritableByteChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionWritableByteChannel.java 8 Sep 2014 09:47:08 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/function/ChannelFunctionWritableByteChannel.java 8 Sep 2014 10:52:21 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.function; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/Handshake.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/Attic/Handshake.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/Handshake.java 8 Sep 2014 09:47:10 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/Handshake.java 8 Sep 2014 10:52:22 -0000 1.1.2.2 @@ -1,19 +1,17 @@ /* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. + * Copyright 2012 JBoss, by Red Hat, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Base64.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/Base64.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Base64.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Base64.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,16 +9,14 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; -import io.undertow.UndertowLogger; - /** *

    * Encodes and decodes to and from Base64 notation. @@ -1176,7 +1174,7 @@ } // end try catch (java.io.IOException e) { - UndertowLogger.REQUEST_IO_LOGGER.ioException(e); + e.printStackTrace(); // Just return originally-decoded bytes } // end catch finally { Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Hybi07Handshake.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/Hybi07Handshake.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Hybi07Handshake.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Hybi07Handshake.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,19 +1,17 @@ /* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. + * Copyright 2012 JBoss, by Red Hat, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; @@ -95,11 +93,12 @@ final String concat = nonceBase64.trim() + getMagicNumber(); final MessageDigest digest = MessageDigest.getInstance(getHashAlgorithm()); digest.update(concat.getBytes(WebSocketUtils.UTF_8)); - return Base64.encodeBytes(digest.digest()).trim(); + final String result = Base64.encodeBytes(digest.digest()).trim(); + return result; } @Override public WebSocketChannel createChannel(WebSocketHttpExchange exchange, final StreamConnection channel, final Pool pool) { - return new WebSocket07Channel(channel, pool, getWebSocketLocation(exchange), exchange.getResponseHeader(Headers.SEC_WEB_SOCKET_PROTOCOL_STRING), false, allowExtensions, exchange.getPeerConnections()); + return new WebSocket07Channel(channel, pool, getWebSocketLocation(exchange), exchange.getResponseHeader(Headers.SEC_WEB_SOCKET_PROTOCOL_STRING), false, allowExtensions); } } Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Masker.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/Masker.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Masker.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Masker.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/UTF8Checker.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/UTF8Checker.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/UTF8Checker.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/UTF8Checker.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07BinaryFrameSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07BinaryFrameSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07BinaryFrameSinkChannel.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07BinaryFrameSinkChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07BinaryFrameSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07BinaryFrameSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07BinaryFrameSourceChannel.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07BinaryFrameSourceChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07Channel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07Channel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07Channel.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07Channel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; @@ -22,21 +22,17 @@ import io.undertow.websockets.core.StreamSourceFrameChannel; import io.undertow.websockets.core.WebSocketChannel; import io.undertow.websockets.core.WebSocketException; -import io.undertow.websockets.core.WebSocketFrame; import io.undertow.websockets.core.WebSocketFrameCorruptedException; import io.undertow.websockets.core.WebSocketFrameType; import io.undertow.websockets.core.WebSocketLogger; import io.undertow.websockets.core.WebSocketMessages; import io.undertow.websockets.core.WebSocketVersion; import io.undertow.websockets.core.function.ChannelFunction; - -import org.xnio.IoUtils; import org.xnio.Pool; import org.xnio.Pooled; import org.xnio.StreamConnection; import java.nio.ByteBuffer; -import java.util.Set; /** @@ -87,8 +83,8 @@ * @param wsUrl The url for which the {@link WebSocket07Channel} was created. */ public WebSocket07Channel(StreamConnection channel, Pool bufferPool, - String wsUrl, String subProtocol, final boolean client, boolean allowExtensions, Set openConnections) { - super(channel, bufferPool, WebSocketVersion.V08, wsUrl, subProtocol, client, allowExtensions, openConnections); + String wsUrl, String subProtocol, final boolean client, boolean allowExtensions) { + super(channel, bufferPool, WebSocketVersion.V08, wsUrl, subProtocol, client, allowExtensions); } @Override @@ -102,11 +98,6 @@ } @Override - protected void closeSubChannels() { - IoUtils.safeClose(fragmentedChannel); - } - - @Override protected StreamSinkFrameChannel createStreamSinkChannel(WebSocketFrameType type, long payloadSize) { switch (type) { case TEXT: @@ -124,7 +115,7 @@ } } - class WebSocketFrameHeader implements WebSocketFrame { + class WebSocketFrameHeader implements PartialFrame { private boolean frameFinalFlag; private int frameRsv; @@ -339,7 +330,6 @@ } b = buffer.get(); lengthBuffer.put(b); - state = State.READING_EXTENDED_SIZE8; case READING_EXTENDED_SIZE8: if (!buffer.hasRemaining()) { return; @@ -355,7 +345,6 @@ state = State.DONE; break; } - state = State.READING_MASK_1; case READING_MASK_1: if (!buffer.hasRemaining()) { return; @@ -467,17 +456,11 @@ StreamSourceFrameChannel ret = fragmentedChannel; if(frameFinalFlag) { fragmentedChannel = null; + ret.finalFrame(); //TODO: should be in handle header data, maybe } return ret; } return null; } - - @Override - public boolean isFinalFragment() { - return frameFinalFlag; - } } - - } Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07CloseFrameSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07CloseFrameSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07CloseFrameSinkChannel.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07CloseFrameSinkChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07CloseFrameSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07CloseFrameSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07CloseFrameSourceChannel.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07CloseFrameSourceChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07ContinuationFrameSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07ContinuationFrameSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07ContinuationFrameSourceChannel.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07ContinuationFrameSourceChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07FrameSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07FrameSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07FrameSinkChannel.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07FrameSinkChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,15 +9,14 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; -import io.undertow.server.protocol.framed.SendFrameHeader; import io.undertow.websockets.core.StreamSinkFrameChannel; import io.undertow.websockets.core.WebSocketFrameType; import io.undertow.websockets.core.WebSocketMessages; @@ -56,19 +55,10 @@ } @Override - protected void handleFlushComplete(boolean finalFrame) { + protected void handleFlushComplete() { dataWritten = true; } - - /** - * If a stream sink channel is closed while in the middle of sending fragmented data we need to close the connection. - * @throws IOException - */ - protected void channelForciblyClosed() throws IOException { - getChannel().sendClose(); - } - private byte opCode() { if(dataWritten) { return WebSocket07Channel.OPCODE_CONT; @@ -92,7 +82,7 @@ } @Override - protected SendFrameHeader createFrameHeader() { + protected Pooled createFrameHeader() { if(payloadSize >= 0 && dataWritten) { //for fixed length we don't need more than one header return null; @@ -139,7 +129,7 @@ header.put((byte)((maskingKey & 0xFF))); } header.flip(); - return new SendFrameHeader(0, start); + return start; } @Override Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PingFrameSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07PingFrameSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PingFrameSinkChannel.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PingFrameSinkChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PingFrameSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07PingFrameSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PingFrameSourceChannel.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PingFrameSourceChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PongFrameSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07PongFrameSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PongFrameSinkChannel.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PongFrameSinkChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PongFrameSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07PongFrameSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PongFrameSourceChannel.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07PongFrameSourceChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07TextFrameSinkChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07TextFrameSinkChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07TextFrameSinkChannel.java 8 Sep 2014 09:47:00 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07TextFrameSinkChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07TextFrameSourceChannel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/Attic/WebSocket07TextFrameSourceChannel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07TextFrameSourceChannel.java 8 Sep 2014 09:47:01 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version07/WebSocket07TextFrameSourceChannel.java 8 Sep 2014 10:52:14 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,11 +9,11 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version07; Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version08/Hybi08Handshake.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version08/Attic/Hybi08Handshake.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version08/Hybi08Handshake.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version08/Hybi08Handshake.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,19 +1,17 @@ /* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. + * Copyright 2012 JBoss, by Red Hat, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version08; @@ -47,7 +45,7 @@ @Override public WebSocketChannel createChannel(final WebSocketHttpExchange exchange, final StreamConnection channel, final Pool pool) { - return new WebSocket08Channel(channel, pool, getWebSocketLocation(exchange), exchange.getResponseHeader(Headers.SEC_WEB_SOCKET_PROTOCOL_STRING), false, allowExtensions, exchange.getPeerConnections()); + return new WebSocket08Channel(channel, pool, getWebSocketLocation(exchange), exchange.getResponseHeader(Headers.SEC_WEB_SOCKET_PROTOCOL_STRING), false, allowExtensions); } } Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version08/WebSocket08Channel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version08/Attic/WebSocket08Channel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version08/WebSocket08Channel.java 8 Sep 2014 09:47:06 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version08/WebSocket08Channel.java 8 Sep 2014 10:52:19 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,22 +9,20 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version08; -import io.undertow.websockets.core.WebSocketChannel; import io.undertow.websockets.core.WebSocketVersion; import io.undertow.websockets.core.protocol.version07.WebSocket07Channel; import org.xnio.Pool; import org.xnio.StreamConnection; import java.nio.ByteBuffer; -import java.util.Set; /** @@ -33,8 +31,8 @@ * @author Norman Maurer */ public class WebSocket08Channel extends WebSocket07Channel { - public WebSocket08Channel(StreamConnection channel, Pool bufferPool, String wsUrl, String subProtocols, final boolean client, boolean allowExtensions, Set openConnections) { - super(channel, bufferPool, wsUrl, subProtocols, client, allowExtensions, openConnections); + public WebSocket08Channel(StreamConnection channel, Pool bufferPool, String wsUrl, String subProtocols, final boolean client, boolean allowExtensions) { + super(channel, bufferPool, wsUrl, subProtocols, client, allowExtensions); } @Override Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version13/Hybi13Handshake.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version13/Attic/Hybi13Handshake.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version13/Hybi13Handshake.java 8 Sep 2014 09:47:10 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version13/Hybi13Handshake.java 8 Sep 2014 10:52:22 -0000 1.1.2.2 @@ -1,19 +1,17 @@ /* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. + * Copyright 2012 JBoss, by Red Hat, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version13; @@ -70,6 +68,6 @@ @Override public WebSocketChannel createChannel(WebSocketHttpExchange exchange, final StreamConnection channel, final Pool pool) { - return new WebSocket13Channel(channel, pool, getWebSocketLocation(exchange), exchange.getResponseHeader(Headers.SEC_WEB_SOCKET_PROTOCOL_STRING), false, allowExtensions, exchange.getPeerConnections()); + return new WebSocket13Channel(channel, pool, getWebSocketLocation(exchange), exchange.getResponseHeader(Headers.SEC_WEB_SOCKET_PROTOCOL_STRING), false, allowExtensions); } } Index: 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version13/WebSocket13Channel.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version13/Attic/WebSocket13Channel.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version13/WebSocket13Channel.java 8 Sep 2014 09:47:10 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/core/protocol/version13/WebSocket13Channel.java 8 Sep 2014 10:52:22 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors + * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,22 +9,20 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.undertow.websockets.core.protocol.version13; -import io.undertow.websockets.core.WebSocketChannel; import io.undertow.websockets.core.WebSocketVersion; import io.undertow.websockets.core.protocol.version07.WebSocket07Channel; import org.xnio.Pool; import org.xnio.StreamConnection; import java.nio.ByteBuffer; -import java.util.Set; /** * @@ -33,8 +31,8 @@ * @author Norman Maurer */ public class WebSocket13Channel extends WebSocket07Channel { - public WebSocket13Channel(StreamConnection channel, Pool bufferPool, String wsUrl, String subProtocols, final boolean client, boolean allowExtensions, Set openConnections) { - super(channel, bufferPool, wsUrl, subProtocols, client, allowExtensions, openConnections); + public WebSocket13Channel(StreamConnection channel, Pool bufferPool, String wsUrl, String subProtocols, final boolean client, boolean allowExtensions) { + super(channel, bufferPool, wsUrl, subProtocols, client, allowExtensions); } @Override Index: 3rdParty_sources/undertow/io/undertow/websockets/spi/AsyncWebSocketHttpServerExchange.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/spi/Attic/AsyncWebSocketHttpServerExchange.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/spi/AsyncWebSocketHttpServerExchange.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/spi/AsyncWebSocketHttpServerExchange.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,21 +1,3 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.spi; import io.undertow.UndertowLogger; @@ -25,12 +7,9 @@ import io.undertow.security.idm.Account; import io.undertow.server.HttpServerExchange; import io.undertow.server.HttpUpgradeListener; -import io.undertow.server.session.SessionConfig; -import io.undertow.server.session.SessionManager; import io.undertow.util.AttachmentKey; import io.undertow.util.HeaderMap; import io.undertow.util.HttpString; -import io.undertow.websockets.core.WebSocketChannel; import org.xnio.ChannelListener; import org.xnio.FinishedIoFuture; import org.xnio.FutureResult; @@ -50,8 +29,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.TreeMap; /** * @author Stuart Douglas @@ -60,11 +37,9 @@ private final HttpServerExchange exchange; private Sender sender; - private final Set peerConnections; - public AsyncWebSocketHttpServerExchange(final HttpServerExchange exchange, Set peerConnections) { + public AsyncWebSocketHttpServerExchange(final HttpServerExchange exchange) { this.exchange = exchange; - this.peerConnections = peerConnections; } @@ -85,9 +60,9 @@ @Override public Map> getRequestHeaders() { - Map> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); + Map> headers = new HashMap>(); for (final HttpString header : exchange.getRequestHeaders().getHeaderNames()) { - headers.put(header.toString(), new ArrayList<>(exchange.getRequestHeaders().get(header))); + headers.put(header.toString(), new ArrayList(exchange.getRequestHeaders().get(header))); } return Collections.unmodifiableMap(headers); } @@ -99,9 +74,9 @@ @Override public Map> getResponseHeaders() { - Map> headers = new HashMap<>(); + Map> headers = new HashMap>(); for (final HttpString header : exchange.getResponseHeaders().getHeaderNames()) { - headers.put(header.toString(), new ArrayList<>(exchange.getResponseHeaders().get(header))); + headers.put(header.toString(), new ArrayList(exchange.getResponseHeaders().get(header))); } return Collections.unmodifiableMap(headers); } @@ -130,7 +105,7 @@ if (sender == null) { this.sender = exchange.getResponseSender(); } - final FutureResult future = new FutureResult<>(); + final FutureResult future = new FutureResult(); sender.send(data, new IoCallback() { @Override public void onComplete(final HttpServerExchange exchange, final Sender sender) { @@ -158,10 +133,10 @@ try { res = channel.read(buffer); if (res == -1) { - return new FinishedIoFuture<>(data.toByteArray()); + return new FinishedIoFuture(data.toByteArray()); } else if (res == 0) { //callback - final FutureResult future = new FutureResult<>(); + final FutureResult future = new FutureResult(); channel.getReadSetter().set(new ChannelListener() { @Override public void handleEvent(final StreamSourceChannel channel) { @@ -198,7 +173,7 @@ } } catch (IOException e) { - final FutureResult future = new FutureResult<>(); + final FutureResult future = new FutureResult(); future.setException(e); return future.getIoFuture(); } @@ -228,12 +203,7 @@ @Override public String getRequestURI() { - String q = exchange.getQueryString(); - if (q == null || q.isEmpty()) { - return exchange.getRequestURI(); - } else { - return exchange.getRequestURI() + "?" + q; - } + return exchange.getRequestURI() + exchange.getQueryString(); } @Override @@ -248,19 +218,14 @@ @Override public Object getSession() { - SessionManager sm = exchange.getAttachment(SessionManager.ATTACHMENT_KEY); - SessionConfig sessionCookieConfig = exchange.getAttachment(SessionConfig.ATTACHMENT_KEY); - if(sm != null && sessionCookieConfig != null) { - return sm.getSession(exchange, sessionCookieConfig); - } return null; } @Override public Map> getRequestParameters() { - Map> params = new HashMap<>(); + Map> params = new HashMap>(); for (Map.Entry> param : exchange.getQueryParameters().entrySet()) { - params.put(param.getKey(), new ArrayList<>(param.getValue())); + params.put(param.getKey(), new ArrayList(param.getValue())); } return params; } @@ -290,9 +255,4 @@ } return authenticatedAccount.getRoles().contains(role); } - - @Override - public Set getPeerConnections() { - return peerConnections; - } } Index: 3rdParty_sources/undertow/io/undertow/websockets/spi/BlockingWebSocketHttpServerExchange.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/spi/Attic/BlockingWebSocketHttpServerExchange.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/spi/BlockingWebSocketHttpServerExchange.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/spi/BlockingWebSocketHttpServerExchange.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,25 +1,6 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.spi; import io.undertow.server.HttpServerExchange; -import io.undertow.websockets.core.WebSocketChannel; import org.xnio.FinishedIoFuture; import org.xnio.FutureResult; import org.xnio.IoFuture; @@ -29,7 +10,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; -import java.util.Set; /** * @author Stuart Douglas @@ -39,8 +19,8 @@ private final OutputStream out; private final InputStream in; - public BlockingWebSocketHttpServerExchange(final HttpServerExchange exchange, Set peerConnections) { - super(exchange, peerConnections); + public BlockingWebSocketHttpServerExchange(final HttpServerExchange exchange) { + super(exchange); out = exchange.getOutputStream(); in = exchange.getInputStream(); } @@ -51,9 +31,9 @@ while (data.hasRemaining()) { out.write(data.get()); } - return new FinishedIoFuture<>(null); + return new FinishedIoFuture(null); } catch (IOException e) { - final FutureResult ioFuture = new FutureResult<>(); + final FutureResult ioFuture = new FutureResult(); ioFuture.setException(e); return ioFuture.getIoFuture(); } @@ -68,9 +48,9 @@ while ((r = in.read(buf)) != -1) { data.write(buf, 0, r); } - return new FinishedIoFuture<>(data.toByteArray()); + return new FinishedIoFuture(data.toByteArray()); } catch (IOException e) { - final FutureResult ioFuture = new FutureResult<>(); + final FutureResult ioFuture = new FutureResult(); ioFuture.setException(e); return ioFuture.getIoFuture(); } Index: 3rdParty_sources/undertow/io/undertow/websockets/spi/WebSocketHttpExchange.java =================================================================== RCS file: /usr/local/cvsroot/3rdParty_sources/undertow/io/undertow/websockets/spi/Attic/WebSocketHttpExchange.java,v diff -u -r1.1.2.1 -r1.1.2.2 --- 3rdParty_sources/undertow/io/undertow/websockets/spi/WebSocketHttpExchange.java 8 Sep 2014 09:46:58 -0000 1.1.2.1 +++ 3rdParty_sources/undertow/io/undertow/websockets/spi/WebSocketHttpExchange.java 8 Sep 2014 10:52:12 -0000 1.1.2.2 @@ -1,26 +1,7 @@ -/* - * JBoss, Home of Professional Open Source. - * Copyright 2014 Red Hat, Inc., and individual contributors - * as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package io.undertow.websockets.spi; import io.undertow.server.HttpUpgradeListener; import io.undertow.util.AttachmentKey; -import io.undertow.websockets.core.WebSocketChannel; import org.xnio.IoFuture; import org.xnio.Pool; @@ -29,7 +10,6 @@ import java.security.Principal; import java.util.List; import java.util.Map; -import java.util.Set; /** @@ -158,6 +138,4 @@ Principal getUserPrincipal(); boolean isUserInRole(String role); - - Set getPeerConnections(); }