[Bug 65851] DefaultServlet.checkIfNoneMatch return 400
https://bz.apache.org/bugzilla/show_bug.cgi?id=65851 Mark Thomas changed: What|Removed |Added Resolution|CLOSED |INVALID --- Comment #8 from Mark Thomas --- Restoring correct resolution. Please do not change this. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] tandraschko opened a new pull request #476: EL FunctionMapperImpl: skip Method lookup if not required
tandraschko opened a new pull request #476: URL: https://github.com/apache/tomcat/pull/476 we currently have a weird case, where it seems that our session-manager seems to use the wrong CL (memcached-session-manager), and therefore a ClassNotFoundException is logged. Nevertheless, it only happens on the second request, where the method infos are already loaded. So this PR improves the performance a bit as the lookup isnt done anymore for cases, where the infos are already loaded and it fixes our special case. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] tandraschko commented on pull request #476: EL FunctionMapperImpl: skip Method lookup if not required
tandraschko commented on pull request #476: URL: https://github.com/apache/tomcat/pull/476#issuecomment-1044201475 i would also be happy if you could backport it to 9.0.x -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 8.5.x updated (552f1a6 -> 0b6f251)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git. from 552f1a6 Align with 9.0.x new 6752a0b Align with 9.0.x onwards - refactor timeoute new 0b6f251 Align with 9.0.x onwards - formatting The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: java/org/apache/tomcat/util/net/Nio2Endpoint.java | 4 +--- java/org/apache/tomcat/util/net/NioEndpoint.java | 25 +-- 2 files changed, 20 insertions(+), 9 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 01/02: Align with 9.0.x onwards - refactor timeoute
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 6752a0b60fdc0f706392ba285e36ce8439115624 Author: Mark Thomas AuthorDate: Fri Feb 18 00:19:33 2022 + Align with 9.0.x onwards - refactor timeoute --- java/org/apache/tomcat/util/net/NioEndpoint.java | 25 ++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 4306052..6f31c0c 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -1141,25 +1141,38 @@ public class NioEndpoint extends AbstractJsseEndpoint processKey(key, socketWrapper); } else if ((socketWrapper.interestOps() & SelectionKey.OP_READ) == SelectionKey.OP_READ || (socketWrapper.interestOps() & SelectionKey.OP_WRITE) == SelectionKey.OP_WRITE) { -boolean isTimedOut = false; +boolean readTimeout = false; +boolean writeTimeout = false; // Check for read timeout if ((socketWrapper.interestOps() & SelectionKey.OP_READ) == SelectionKey.OP_READ) { long delta = now - socketWrapper.getLastRead(); long timeout = socketWrapper.getReadTimeout(); -isTimedOut = timeout > 0 && delta > timeout; +if (timeout > 0 && delta > timeout) { +readTimeout = true; +} } // Check for write timeout -if (!isTimedOut && (socketWrapper.interestOps() & SelectionKey.OP_WRITE) == SelectionKey.OP_WRITE) { +if (!readTimeout && (socketWrapper.interestOps() & SelectionKey.OP_WRITE) == SelectionKey.OP_WRITE) { long delta = now - socketWrapper.getLastWrite(); long timeout = socketWrapper.getWriteTimeout(); -isTimedOut = timeout > 0 && delta > timeout; +if (timeout > 0 && delta > timeout) { +writeTimeout = true; +} } -if (isTimedOut) { +if (readTimeout || writeTimeout) { key.interestOps(0); // Avoid duplicate timeout calls socketWrapper.interestOps(0); socketWrapper.setError(new SocketTimeoutException()); -if (!processSocket(socketWrapper, SocketEvent.ERROR, true)) { +if (readTimeout && socketWrapper.readOperation != null) { +if (!socketWrapper.readOperation.process()) { +cancelledKey(key); +} +} else if (writeTimeout && socketWrapper.writeOperation != null) { +if (!socketWrapper.writeOperation.process()) { +cancelledKey(key); +} +} else if (!processSocket(socketWrapper, SocketEvent.ERROR, true)) { cancelledKey(key); } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: Align with 9.0.x onwards - formatting
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 0b6f2517beac4e884577407b773cae119dc3b17f Author: Mark Thomas AuthorDate: Fri Feb 18 12:02:11 2022 + Align with 9.0.x onwards - formatting --- java/org/apache/tomcat/util/net/Nio2Endpoint.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java b/java/org/apache/tomcat/util/net/Nio2Endpoint.java index e480490..6adf5d9 100644 --- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java +++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java @@ -113,7 +113,6 @@ public class Nio2Endpoint extends AbstractJsseEndpoint { private SendfileData sendfileData = null; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/06: s
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 78b216839fd27dd92994652dd094bb8cf9612eca Author: Mark Thomas AuthorDate: Fri Feb 18 14:13:16 2022 + s --- java/org/apache/tomcat/util/net/AprEndpoint.java | 57 ++-- java/org/apache/tomcat/util/net/Nio2Endpoint.java | 34 +-- java/org/apache/tomcat/util/net/NioEndpoint.java | 106 +++--- 3 files changed, 83 insertions(+), 114 deletions(-) diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 5145432..3fa5a2d 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -765,37 +765,34 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB */ protected boolean processSocketWithOptions(long socket) { try { -// During shutdown, executor may be null - avoid NPE -if (running) { -if (log.isDebugEnabled()) { -log.debug(sm.getString("endpoint.debug.socket", -Long.valueOf(socket))); -} - -// Do the duplicate accept check here rather than in Acceptor.run() -// so we can cache the results in the SocketWrapper -AprSocketWrapper wrapper = new AprSocketWrapper(Long.valueOf(socket), this); -// Bug does not affect Windows. Skip the check on that platform. -if (!JrePlatform.IS_WINDOWS) { -long currentNanoTime = System.nanoTime(); -if (wrapper.getRemotePort() == previousAcceptedPort) { -if (wrapper.getRemoteAddr().equals(previousAcceptedAddress)) { -if (currentNanoTime - previousAcceptedSocketNanoTime < 1000) { -throw new IOException(sm.getString("endpoint.err.duplicateAccept")); -} +if (log.isDebugEnabled()) { +log.debug(sm.getString("endpoint.debug.socket", socket)); +} + +// Do the duplicate accept check here rather than in Acceptor.run() +// so we can cache the results in the SocketWrapper +AprSocketWrapper wrapper = new AprSocketWrapper(Long.valueOf(socket), this); +// Bug does not affect Windows. Skip the check on that platform. +if (!JrePlatform.IS_WINDOWS) { +long currentNanoTime = System.nanoTime(); +if (wrapper.getRemotePort() == previousAcceptedPort) { +if (wrapper.getRemoteAddr().equals(previousAcceptedAddress)) { +if (currentNanoTime - previousAcceptedSocketNanoTime < 1000) { +throw new IOException(sm.getString("endpoint.err.duplicateAccept")); } } -previousAcceptedPort = wrapper.getRemotePort(); -previousAcceptedAddress = wrapper.getRemoteAddr(); -previousAcceptedSocketNanoTime = currentNanoTime; } - -wrapper.setKeepAliveLeft(getMaxKeepAliveRequests()); -wrapper.setReadTimeout(getConnectionTimeout()); -wrapper.setWriteTimeout(getConnectionTimeout()); -connections.put(Long.valueOf(socket), wrapper); -getExecutor().execute(new SocketWithOptionsProcessor(wrapper)); +previousAcceptedPort = wrapper.getRemotePort(); +previousAcceptedAddress = wrapper.getRemoteAddr(); +previousAcceptedSocketNanoTime = currentNanoTime; } + +connections.put(Long.valueOf(socket), wrapper); +wrapper.setKeepAliveLeft(getMaxKeepAliveRequests()); +wrapper.setReadTimeout(getConnectionTimeout()); +wrapper.setWriteTimeout(getConnectionTimeout()); +getExecutor().execute(new SocketWithOptionsProcessor(wrapper)); +return true; } catch (RejectedExecutionException x) { log.warn(sm.getString("endpoint.rejectedExecution", socket), x); } catch (Throwable t) { @@ -803,9 +800,8 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB // This means we got an OOM or similar creating a thread, or that // the pool and its queue are full log.error(sm.getString("endpoint.process.fail"), t); -return false; } -return true; +return false; } @@ -2437,6 +2433,9 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB @Override protected void doClose() { +if (log.isDebugEnabled()) { +log.debug("Calling [" + getEndpoint() + "].
[tomcat] 01/06: Back-port of sock wrapper close refactoring
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 7067ee3941dd9169365a988e13bf3fd9bf952fa7 Author: Mark Thomas AuthorDate: Fri Feb 18 13:52:42 2022 + Back-port of sock wrapper close refactoring --- .../apache/coyote/http2/Http2UpgradeHandler.java | 4 +- java/org/apache/tomcat/util/net/AprEndpoint.java | 68 ++ java/org/apache/tomcat/util/net/Nio2Endpoint.java | 36 +++- java/org/apache/tomcat/util/net/NioChannel.java| 50 +- java/org/apache/tomcat/util/net/NioEndpoint.java | 101 - .../apache/tomcat/util/net/SocketWrapperBase.java | 31 ++- 6 files changed, 175 insertions(+), 115 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java index a2c87ed..390463f 100644 --- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java @@ -1202,8 +1202,8 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH } try { socketWrapper.close(); -} catch (IOException ioe) { -log.debug(sm.getString("upgradeHandler.socketCloseFailed"), ioe); +} catch (Exception e) { +log.debug(sm.getString("upgradeHandler.socketCloseFailed"), e); } } diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 51de670..5145432 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -574,8 +574,6 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB wl.lock(); try { socketWrapper.close(); -} catch (IOException e) { -// Ignore } finally { wl.unlock(); } @@ -2228,9 +2226,6 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB private final ByteBuffer sslOutputBuffer; -private final Object closedLock = new Object(); -private volatile boolean closed = false; - // This field should only be used by Poller#run() private int pollerFlags = 0; @@ -2344,7 +2339,7 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB private int fillReadBuffer(boolean block, ByteBuffer to) throws IOException { -if (closed) { +if (isClosed()) { throw new IOException(sm.getString("socket.apr.closed", getSocket())); } @@ -2441,15 +2436,18 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB @Override -public void close() { -getEndpoint().getHandler().release(this); -synchronized (closedLock) { -// APR typically crashes if the same socket is closed twice so -// make sure that doesn't happen. -if (closed) { -return; +protected void doClose() { +try { +getEndpoint().getHandler().release(this); +} catch (Throwable e) { +ExceptionUtils.handleThrowable(e); +if (log.isDebugEnabled()) { +log.error(sm.getString("endpoint.debug.handlerRelease"), e); } -closed = true; +} +socketBufferHandler = SocketBufferHandler.EMPTY; +nonBlockingWriteBuffer.clear(); +synchronized (closed) { if (sslOutputBuffer != null) { ByteBufferUtils.cleanDirectBuffer(sslOutputBuffer); } @@ -2462,16 +2460,8 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB @Override -public boolean isClosed() { -synchronized (closedLock) { -return closed; -} -} - - -@Override protected void doWrite(boolean block, ByteBuffer from) throws IOException { -if (closed) { +if (isClosed()) { throw new IOException(sm.getString("socket.apr.closed", getSocket())); } @@ -2591,8 +2581,8 @@ public class AprEndpoint extends AbstractEndpoint implements SNICallB @Override public void registerReadInterest() { // Make sure an already closed socket is not added to the poller -synchronized (closedLock) { -if (closed) { +synchronized (closed) { +if (isClosed()) { return; } if (log.isDebugEnabled()) { @@ -2609,8 +2599,8 @@ public class AprEndpoint extends AbstractEndpoint implements SNICall
[tomcat] 05/06: s
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 4025253bf4d29782fb8a5a39dd487ad9ebc23798 Author: Mark Thomas AuthorDate: Fri Feb 18 14:41:21 2022 + s --- java/org/apache/tomcat/util/compat/JreCompat.java | 9 ++- java/org/apache/tomcat/util/net/NioChannel.java | 9 +-- java/org/apache/tomcat/util/net/NioEndpoint.java | 80 ++- 3 files changed, 60 insertions(+), 38 deletions(-) diff --git a/java/org/apache/tomcat/util/compat/JreCompat.java b/java/org/apache/tomcat/util/compat/JreCompat.java index 3850ef7..162eccc 100644 --- a/java/org/apache/tomcat/util/compat/JreCompat.java +++ b/java/org/apache/tomcat/util/compat/JreCompat.java @@ -43,6 +43,7 @@ public class JreCompat { private static final JreCompat instance; private static StringManager sm = StringManager.getManager(JreCompat.class.getPackage().getName()); +private static final boolean jre11Available; private static final boolean jre9Available; private static final boolean jre8Available; @@ -62,9 +63,10 @@ public class JreCompat { jre8Available = true; } else { instance = new JreCompat(); -jre9Available = false; jre8Available = false; +jre9Available = false; } +jre11Available = instance.jarFileRuntimeMajorVersion() >= 11; } @@ -80,6 +82,11 @@ public class JreCompat { } +public static boolean isJre11Available() { +return jre11Available; +} + + @SuppressWarnings("unused") public void setUseServerCipherSuitesOrder(SSLParameters engine, boolean useCipherSuitesOrder) { throw new UnsupportedOperationException(sm.getString("jreCompat.noServerCipherSuiteOrder")); diff --git a/java/org/apache/tomcat/util/net/NioChannel.java b/java/org/apache/tomcat/util/net/NioChannel.java index 4874d36..b718e39 100644 --- a/java/org/apache/tomcat/util/net/NioChannel.java +++ b/java/org/apache/tomcat/util/net/NioChannel.java @@ -270,11 +270,7 @@ public class NioChannel implements ByteChannel, ScatteringByteChannel, Gathering return appReadBufHandler; } -static final NioChannel CLOSED_NIO_CHANNEL = new ClosedNioChannel(); -public static class ClosedNioChannel extends NioChannel { -public ClosedNioChannel() { -super(SocketBufferHandler.EMPTY); -} +static final NioChannel CLOSED_NIO_CHANNEL = new NioChannel(SocketBufferHandler.EMPTY) { @Override public void close() throws IOException { } @@ -314,5 +310,6 @@ public class NioChannel implements ByteChannel, ScatteringByteChannel, Gathering public String toString() { return "Closed NioChannel"; } -} +}; + } diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 579ed4b..3e929d2 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -52,9 +52,9 @@ import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.IntrospectionUtils; import org.apache.tomcat.util.collections.SynchronizedQueue; import org.apache.tomcat.util.collections.SynchronizedStack; +import org.apache.tomcat.util.compat.JreCompat; import org.apache.tomcat.util.compat.JrePlatform; import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState; -import org.apache.tomcat.util.net.NioChannel.ClosedNioChannel; import org.apache.tomcat.util.net.jsse.JSSESupport; /** @@ -1335,7 +1335,7 @@ public class NioEndpoint extends AbstractJsseEndpoint private int fillReadBuffer(boolean block, ByteBuffer to) throws IOException { int nRead; NioChannel socket = getSocket(); -if (socket instanceof ClosedNioChannel) { +if (socket == NioChannel.CLOSED_NIO_CHANNEL) { throw new ClosedChannelException(); } if (block) { @@ -1665,8 +1665,14 @@ public class NioEndpoint extends AbstractJsseEndpoint @Override protected void doRun() { -NioChannel socket = socketWrapper.getSocket(); -SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector()); +/* + * Do not cache and re-use the value of socketWrapper.getSocket() in + * this method. If the socket closes the value will be updated to + * CLOSED_NIO_CHANNEL and the previous value potentially re-used for + * a new connection. That can result in a stale cached value which + * in turn can result in unintentionally closing currently active + * connections. + */ Poller poller = NioEndpoint.this.poller; if (poller == null) { socket
[tomcat] 03/06: s
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit bad4d11a1cc15d7e0f22064d93f408473fa0d41f Author: Mark Thomas AuthorDate: Fri Feb 18 14:17:42 2022 + s --- java/org/apache/tomcat/util/net/NioChannel.java | 5 - java/org/apache/tomcat/util/net/NioEndpoint.java | 13 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/java/org/apache/tomcat/util/net/NioChannel.java b/java/org/apache/tomcat/util/net/NioChannel.java index ff8d329..d9bd848 100644 --- a/java/org/apache/tomcat/util/net/NioChannel.java +++ b/java/org/apache/tomcat/util/net/NioChannel.java @@ -273,7 +273,7 @@ public class NioChannel implements ByteChannel, ScatteringByteChannel, Gathering static final NioChannel CLOSED_NIO_CHANNEL = new ClosedNioChannel(); public static class ClosedNioChannel extends NioChannel { public ClosedNioChannel() { -super(null, null); +super(null, SocketBufferHandler.EMPTY); } @Override public void close() throws IOException { @@ -289,6 +289,9 @@ public class NioChannel implements ByteChannel, ScatteringByteChannel, Gathering public void free() { } @Override +public void setAppReadBufHandler(ApplicationBufferHandler handler) { +} +@Override public int read(ByteBuffer dst) throws IOException { return -1; } diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 9813467..286f33e 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -28,6 +28,7 @@ import java.net.SocketTimeoutException; import java.nio.ByteBuffer; import java.nio.channels.CancelledKeyException; import java.nio.channels.Channel; +import java.nio.channels.ClosedChannelException; import java.nio.channels.CompletionHandler; import java.nio.channels.FileChannel; import java.nio.channels.NetworkChannel; @@ -53,6 +54,7 @@ import org.apache.tomcat.util.collections.SynchronizedQueue; import org.apache.tomcat.util.collections.SynchronizedStack; import org.apache.tomcat.util.compat.JrePlatform; import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState; +import org.apache.tomcat.util.net.NioChannel.ClosedNioChannel; import org.apache.tomcat.util.net.jsse.JSSESupport; /** @@ -1335,7 +1337,10 @@ public class NioEndpoint extends AbstractJsseEndpoint private int fillReadBuffer(boolean block, ByteBuffer to) throws IOException { int nRead; -NioChannel channel = getSocket(); +NioChannel socket = getSocket(); +if (socket instanceof ClosedNioChannel) { +throw new ClosedChannelException(); +} if (block) { Selector selector = null; try { @@ -1344,19 +1349,19 @@ public class NioEndpoint extends AbstractJsseEndpoint // Ignore } try { -NioEndpoint.NioSocketWrapper att = (NioEndpoint.NioSocketWrapper) channel +NioEndpoint.NioSocketWrapper att = (NioEndpoint.NioSocketWrapper) socket .getAttachment(); if (att == null) { throw new IOException("Key must be cancelled."); } -nRead = pool.read(to, channel, selector, att.getReadTimeout()); +nRead = pool.read(to, socket, selector, att.getReadTimeout()); } finally { if (selector != null) { pool.put(selector); } } } else { -nRead = channel.read(to); +nRead = socket.read(to); if (nRead == -1) { throw new EOFException(); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 06/06: s
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 62ff43ab9380d885e4900df97edc6cff2d483a39 Author: Mark Thomas AuthorDate: Fri Feb 18 14:50:00 2022 + s --- .../tomcat/websocket/TestWebSocketFrameClient.java | 24 +- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java b/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java index 49f7597..0ad0dcb 100644 --- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java +++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java @@ -23,8 +23,6 @@ import java.util.Map; import java.util.Queue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import java.util.logging.LogManager; import javax.websocket.ClientEndpointConfig; import javax.websocket.ClientEndpointConfig.Configurator; @@ -120,20 +118,11 @@ public class TestWebSocketFrameClient extends WebSocketBaseTest { tomcat.start(); - LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.ALL); - LogManager.getLogManager().getLogger("org.apache.tomcat.websocket").setLevel(Level.ALL); - LogManager.getLogManager().getLogger("org.apache.tomcat.util.net").setLevel(Level.ALL); -try { -echoTester("",null); -echoTester("/",null); -// This will trigger a redirect so there will be 5 requests logged -echoTester("/foo",null); -echoTester("/foo/",null); -} finally { - LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.INFO); - LogManager.getLogManager().getLogger("org.apache.tomcat.websocket.WsWebSocketContainer").setLevel(Level.INFO); - LogManager.getLogManager().getLogger("org.apache.tomcat.util.net").setLevel(Level.INFO); -} +echoTester("",null); +echoTester("/",null); +// This will trigger a redirect so there will be 5 requests logged +echoTester("/foo",null); +echoTester("/foo/",null); } public void echoTester(String path, ClientEndpointConfig clientEndpointConfig) @@ -201,7 +190,6 @@ public class TestWebSocketFrameClient extends WebSocketBaseTest { clientEndpointConfig.getUserProperties().put(Constants.WS_AUTHENTICATION_PASSWORD, utf8Pass); echoTester(URI_PROTECTED, clientEndpointConfig); - } @Test @@ -238,7 +226,5 @@ public class TestWebSocketFrameClient extends WebSocketBaseTest { clientEndpointConfig.getUserProperties().put(Constants.WS_AUTHENTICATION_PASSWORD,PWD); echoTester(URI_PROTECTED, clientEndpointConfig); - } - } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 8.5.x updated (0b6f251 -> 62ff43a)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git. from 0b6f251 Align with 9.0.x onwards - formatting new 7067ee3 Back-port of sock wrapper close refactoring new 78b2168 s new bad4d11 s new 87c3a96 s new 4025253 s new 62ff43a s The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../apache/coyote/http2/Http2UpgradeHandler.java | 4 +- java/org/apache/tomcat/util/compat/JreCompat.java | 9 +- java/org/apache/tomcat/util/net/AprEndpoint.java | 125 +- java/org/apache/tomcat/util/net/Nio2Endpoint.java | 70 +++--- java/org/apache/tomcat/util/net/NioChannel.java| 60 - java/org/apache/tomcat/util/net/NioEndpoint.java | 261 ++--- .../apache/tomcat/util/net/SecureNioChannel.java | 7 +- .../apache/tomcat/util/net/SocketWrapperBase.java | 31 ++- .../tomcat/websocket/TestWebSocketFrameClient.java | 24 +- 9 files changed, 317 insertions(+), 274 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [tomcat] branch 8.5.x updated (0b6f251 -> 62ff43a)
On 18/02/2022 14:50, ma...@apache.org wrote: This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git. from 0b6f251 Align with 9.0.x onwards - formatting new 7067ee3 Back-port of sock wrapper close refactoring new 78b2168 s new bad4d11 s new 87c3a96 s new 4025253 s new 62ff43a s Sorry. Pressed the wrong button in my IDE. This is a work in progress and tests are currently failing. I should have things sorted out in a few hours. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 04/06: s
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 87c3a96e7008b5707215ffe1d967c2ff0940184c Author: Mark Thomas AuthorDate: Fri Feb 18 14:23:13 2022 + s --- java/org/apache/tomcat/util/net/NioChannel.java | 18 +- java/org/apache/tomcat/util/net/NioEndpoint.java | 5 + java/org/apache/tomcat/util/net/SecureNioChannel.java | 7 --- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/java/org/apache/tomcat/util/net/NioChannel.java b/java/org/apache/tomcat/util/net/NioChannel.java index d9bd848..4874d36 100644 --- a/java/org/apache/tomcat/util/net/NioChannel.java +++ b/java/org/apache/tomcat/util/net/NioChannel.java @@ -25,6 +25,7 @@ import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.SocketChannel; +import org.apache.tomcat.util.net.NioEndpoint.NioSocketWrapper; import org.apache.tomcat.util.net.NioEndpoint.Poller; import org.apache.tomcat.util.res.StringManager; @@ -46,17 +47,20 @@ public class NioChannel implements ByteChannel, ScatteringByteChannel, Gathering protected Poller poller; -public NioChannel(SocketChannel channel, SocketBufferHandler bufHandler) { -this.sc = channel; +public NioChannel(SocketBufferHandler bufHandler) { this.bufHandler = bufHandler; } /** * Reset the channel * + * @param channel the socket channel + * @param socketWrapper the socket wrapper * @throws IOException If a problem was encountered resetting the channel */ -public void reset() throws IOException { +public void reset(SocketChannel channel, NioSocketWrapper socketWrapper) throws IOException { +this.sc = channel; +this.socketWrapper = socketWrapper; bufHandler.reset(); } @@ -221,10 +225,6 @@ public class NioChannel implements ByteChannel, ScatteringByteChannel, Gathering this.poller = poller; } -public void setIOChannel(SocketChannel sc) { -this.sc = sc; -} - @Override public String toString() { return super.toString() + ":" + sc.toString(); @@ -273,7 +273,7 @@ public class NioChannel implements ByteChannel, ScatteringByteChannel, Gathering static final NioChannel CLOSED_NIO_CHANNEL = new ClosedNioChannel(); public static class ClosedNioChannel extends NioChannel { public ClosedNioChannel() { -super(null, SocketBufferHandler.EMPTY); +super(SocketBufferHandler.EMPTY); } @Override public void close() throws IOException { @@ -283,7 +283,7 @@ public class NioChannel implements ByteChannel, ScatteringByteChannel, Gathering return false; } @Override -public void reset() throws IOException { +public void reset(SocketChannel channel, NioSocketWrapper socketWrapper) throws IOException { } @Override public void free() { diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 286f33e..579ed4b 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -444,11 +444,8 @@ public class NioEndpoint extends AbstractJsseEndpoint if (isSSLEnabled()) { channel = new SecureNioChannel(socket, bufhandler, selectorPool, this); } else { -channel = new NioChannel(socket, bufhandler); +channel = new NioChannel(bufhandler); } -} else { -channel.setIOChannel(socket); -channel.reset(); } poller.register(channel); return true; diff --git a/java/org/apache/tomcat/util/net/SecureNioChannel.java b/java/org/apache/tomcat/util/net/SecureNioChannel.java index e2ae886..fb3924b8 100644 --- a/java/org/apache/tomcat/util/net/SecureNioChannel.java +++ b/java/org/apache/tomcat/util/net/SecureNioChannel.java @@ -39,6 +39,7 @@ import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.buf.ByteBufferUtils; import org.apache.tomcat.util.compat.JreCompat; +import org.apache.tomcat.util.net.NioEndpoint.NioSocketWrapper; import org.apache.tomcat.util.net.TLSClientHelloExtractor.ExtractorResult; import org.apache.tomcat.util.net.openssl.ciphers.Cipher; import org.apache.tomcat.util.res.StringManager; @@ -76,7 +77,7 @@ public class SecureNioChannel extends NioChannel { public SecureNioChannel(SocketChannel channel, SocketBufferHandler bufHandler, NioSelectorPool pool, NioEndpoint endpoint) { -super(channel, bufHandler); +super(bufHandler); // Create the network buffers (these hold the encrypted data).
[tomcat] branch 8.5.x updated: Update i18n files after backports
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/8.5.x by this push: new 2337501 Update i18n files after backports 2337501 is described below commit 2337501b5844a82adac105822de9af69dc27a8e6 Author: Mark Thomas AuthorDate: Fri Feb 18 18:03:51 2022 + Update i18n files after backports --- java/org/apache/tomcat/util/net/LocalStrings.properties | 6 +- java/org/apache/tomcat/util/net/LocalStrings_de.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_es.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_fr.properties| 6 +- java/org/apache/tomcat/util/net/LocalStrings_ja.properties| 6 +- java/org/apache/tomcat/util/net/LocalStrings_ko.properties| 6 +- java/org/apache/tomcat/util/net/LocalStrings_ru.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties | 6 +- 8 files changed, 25 insertions(+), 8 deletions(-) diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties b/java/org/apache/tomcat/util/net/LocalStrings.properties index ced6b20..a715752 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings.properties @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +acceptor.stop.fail=The acceptor thread [{0}] did not stop cleanly +acceptor.stop.interrupted=Interrupt was received while waiting for the acceptor thread [{0}] to stop + channel.nio.interrupted=The current thread was interrupted channel.nio.ssl.appInputNotEmpty=Application input buffer still contains data. Data would have been lost. channel.nio.ssl.appOutputNotEmpty=Application output buffer still contains data. Data would have been lost. @@ -62,6 +65,7 @@ endpoint.apr.remoteport=APR socket [{0}] opened with remote port [{1}] endpoint.apr.tooManyCertFiles=More certificate files were configured than the AprEndpoint can handle endpoint.debug.channelCloseFail=Failed to close channel endpoint.debug.destroySocket=Destroying socket [{0}] +endpoint.debug.handlerRelease=Handler failed to release socket wrapper endpoint.debug.pollerAdd=Add to addList socket [{0}], timeout [{1}], flags [{2}] endpoint.debug.pollerAddDo=Add to poller socket [{0}] endpoint.debug.pollerProcess=Processing socket [{0}] for event(s) [{1}] @@ -70,7 +74,6 @@ endpoint.debug.pollerRemoved=Removed [{0}] from poller endpoint.debug.registerRead=Registered read interest for [{0}] endpoint.debug.registerWrite=Registered write interest for [{0}] endpoint.debug.socket=socket [{0}] -endpoint.debug.socketCloseFail=Failed to close socket endpoint.debug.socketTimeout=Timing out [{0}] endpoint.debug.unlock.fail=Caught exception trying to unlock accept on port [{0}] endpoint.debug.unlock.localFail=Unable to determine local address for [{0}] @@ -95,6 +98,7 @@ endpoint.jsse.cannotHonorServerCipherOrder=The Java Runtime does not support "us endpoint.jsse.noSslContext=No SSLContext could be found for the host name [{0}] endpoint.launch.fail=Failed to launch new runnable endpoint.nio.keyProcessingError=Error processing selection key +endpoint.nio.nullSocketChannel=Invalid null socket channel while processing poller event endpoint.nio.registerFail=Failed to register socket with selector from poller endpoint.nio.selectorCloseFail=Failed to close selector when closing the poller endpoint.nio.selectorLoopError=Error in selector loop diff --git a/java/org/apache/tomcat/util/net/LocalStrings_de.properties b/java/org/apache/tomcat/util/net/LocalStrings_de.properties index 44e49bc..434e26e 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_de.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_de.properties @@ -24,7 +24,6 @@ endpoint.apr.errMakeConf=Konnte OpenSSLConf Kontext nicht erzeugen endpoint.apr.pollAddInvalid=Ungültiger Versuch einen Socket [{0}] zum Poller hinzuzufügen endpoint.apr.tooManyCertFiles=Es wurden mehr Zertifikatsdateien konfiguriert als ein APR Endpunkt handhaben kann endpoint.debug.channelCloseFail=Kanal konnte nicht geschlossen werden -endpoint.debug.socketCloseFail=Socket konnte nicht geschlossen werden endpoint.init.bind=Binden des Sockets fehlgeschlagen: [{0}] [{1}] endpoint.init.notavail=APR nicht verfügbar endpoint.noSslHostName=Es wurde kein Hostname für die SSL Host Konfiguration angegeben diff --git a/java/org/apache/tomcat/util/net/LocalStrings_es.properties b/java/org/apache/tomcat/util/net/LocalStrings_es.properties index 568e78c..54493f3 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_es.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_es.properties @@ -28,7 +28,6 @@ endpoint.apr.maxConnections.running=El endpoint APR no soporta cambiar el parám endpoint.apr.pollAddInva
[tomcat] branch 9.0.x updated: i18n removed one unused and add one missing
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/9.0.x by this push: new a5db2e0 i18n removed one unused and add one missing a5db2e0 is described below commit a5db2e06df071da4480886049446162a1a886f5d Author: Mark Thomas AuthorDate: Fri Feb 18 18:10:53 2022 + i18n removed one unused and add one missing --- java/org/apache/tomcat/util/net/LocalStrings.properties | 2 +- java/org/apache/tomcat/util/net/LocalStrings_fr.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_ja.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_ko.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties b/java/org/apache/tomcat/util/net/LocalStrings.properties index 0cc32e4..a8c8eb7 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings.properties @@ -103,7 +103,6 @@ endpoint.nio.nullLatch=Latch cannot be null endpoint.nio.nullSocketChannel=Invalid null socket channel while processing poller event endpoint.nio.perms.readFail=Failed to set read permissions for Unix domain socket [{0}] endpoint.nio.perms.writeFail=Failed to set write permissions for Unix domain socket [{0}] -endpoint.nio.pollerEventError=Error processing poller event endpoint.nio.registerFail=Failed to register socket with selector from poller endpoint.nio.selectorCloseFail=Failed to close selector when closing the poller endpoint.nio.selectorLoopError=Error in selector loop @@ -164,6 +163,7 @@ sslHostConfig.certificateVerificationInvalid=The certificate verification value sslHostConfig.fileNotFound=Configured file [{0}] does not exist sslHostConfig.invalid_truststore_password=The provided trust store password could not be used to unlock and/or validate the trust store. Retrying to access the trust store with a null password which will skip validation. sslHostConfig.mismatch=The property [{0}] was set on the SSLHostConfig named [{1}] and is for the [{2}] configuration syntax but the SSLHostConfig is being used with the [{3}] configuration syntax +sslHostConfig.opensslconf.alreadyset=Attempt to set another OpenSSLConf ignored sslHostConfig.opensslconf.null=Attempt to set null OpenSSLConf ignored sslHostConfig.prefix_missing=The protocol [{0}] was added to the list of protocols on the SSLHostConfig named [{1}]. Check if a +/- prefix is missing. diff --git a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties index 11c19fd..139d447 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties @@ -100,7 +100,6 @@ endpoint.nio.nullLatch=Le latch ne peut être null endpoint.nio.nullSocketChannel=Le canal du socket est invalide car null lors du traitement de l'évênement du poller endpoint.nio.perms.readFail=Echec d''ajout des permissions en lecture pour le socket de domaine Unix [{0}] endpoint.nio.perms.writeFail=Echec d''ajout des permissions en écriture pour le socket de domaine Unix [{0}] -endpoint.nio.pollerEventError=Erreur lors du traitement de l'évènement du poller endpoint.nio.registerFail=Echec d'enregistrement du socket avec le sélecteur du poller endpoint.nio.selectorCloseFail=Impossible de fermer le sélecteur lors de la fermeture du poller endpoint.nio.selectorLoopError=Erreur dans la boucle du sélecteur diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties index 9853ad9..fee1ac0 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties @@ -100,7 +100,6 @@ endpoint.nio.nullLatch=Latch に null は指定できません。 endpoint.nio.nullSocketChannel=pollerイベントの処理中の無効なnullソケットチャネル endpoint.nio.perms.readFail=Unixドメインソケット [{0}] の読み取り権限の設定に失敗しました endpoint.nio.perms.writeFail=Unixドメインソケット [{0}] の書き込み権限の設定に失敗しました -endpoint.nio.pollerEventError=poller イベント処理中のエラー endpoint.nio.registerFail=Pollerからソケットのセレクタに登録できませんでした。 endpoint.nio.selectorCloseFail=Pollerを閉じるときにセレクターを閉じることができませんでした。 endpoint.nio.selectorLoopError=セレクタの処理ループ中のエラー diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties index 6fae3c6..b9fd685 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties @@ -100,7 +100,6 @@ endpoint.nio.nullLatch=Latch가 널이어서는 안됩니다. endpoint.nio.nullSocketChannel=PollerEvent를 처리하는 중 유효하지 않은 널 소켓 채널이 발견되었습니다. endpoint.nio.perms.readFail=Unix 도메인 소켓 [{0}]에 읽기를 허용하는 데에 실패했습니
[tomcat] branch 10.0.x updated: i18n removed one unused and add one missing
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/10.0.x by this push: new 7ccb068 i18n removed one unused and add one missing 7ccb068 is described below commit 7ccb06852934df7601459ba5fb0178dcac71efee Author: Mark Thomas AuthorDate: Fri Feb 18 18:11:04 2022 + i18n removed one unused and add one missing --- java/org/apache/tomcat/util/net/LocalStrings.properties | 2 +- java/org/apache/tomcat/util/net/LocalStrings_fr.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_ja.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_ko.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties b/java/org/apache/tomcat/util/net/LocalStrings.properties index 0cc32e4..a8c8eb7 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings.properties @@ -103,7 +103,6 @@ endpoint.nio.nullLatch=Latch cannot be null endpoint.nio.nullSocketChannel=Invalid null socket channel while processing poller event endpoint.nio.perms.readFail=Failed to set read permissions for Unix domain socket [{0}] endpoint.nio.perms.writeFail=Failed to set write permissions for Unix domain socket [{0}] -endpoint.nio.pollerEventError=Error processing poller event endpoint.nio.registerFail=Failed to register socket with selector from poller endpoint.nio.selectorCloseFail=Failed to close selector when closing the poller endpoint.nio.selectorLoopError=Error in selector loop @@ -164,6 +163,7 @@ sslHostConfig.certificateVerificationInvalid=The certificate verification value sslHostConfig.fileNotFound=Configured file [{0}] does not exist sslHostConfig.invalid_truststore_password=The provided trust store password could not be used to unlock and/or validate the trust store. Retrying to access the trust store with a null password which will skip validation. sslHostConfig.mismatch=The property [{0}] was set on the SSLHostConfig named [{1}] and is for the [{2}] configuration syntax but the SSLHostConfig is being used with the [{3}] configuration syntax +sslHostConfig.opensslconf.alreadyset=Attempt to set another OpenSSLConf ignored sslHostConfig.opensslconf.null=Attempt to set null OpenSSLConf ignored sslHostConfig.prefix_missing=The protocol [{0}] was added to the list of protocols on the SSLHostConfig named [{1}]. Check if a +/- prefix is missing. diff --git a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties index 11c19fd..139d447 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties @@ -100,7 +100,6 @@ endpoint.nio.nullLatch=Le latch ne peut être null endpoint.nio.nullSocketChannel=Le canal du socket est invalide car null lors du traitement de l'évênement du poller endpoint.nio.perms.readFail=Echec d''ajout des permissions en lecture pour le socket de domaine Unix [{0}] endpoint.nio.perms.writeFail=Echec d''ajout des permissions en écriture pour le socket de domaine Unix [{0}] -endpoint.nio.pollerEventError=Erreur lors du traitement de l'évènement du poller endpoint.nio.registerFail=Echec d'enregistrement du socket avec le sélecteur du poller endpoint.nio.selectorCloseFail=Impossible de fermer le sélecteur lors de la fermeture du poller endpoint.nio.selectorLoopError=Erreur dans la boucle du sélecteur diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties index 9853ad9..fee1ac0 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties @@ -100,7 +100,6 @@ endpoint.nio.nullLatch=Latch に null は指定できません。 endpoint.nio.nullSocketChannel=pollerイベントの処理中の無効なnullソケットチャネル endpoint.nio.perms.readFail=Unixドメインソケット [{0}] の読み取り権限の設定に失敗しました endpoint.nio.perms.writeFail=Unixドメインソケット [{0}] の書き込み権限の設定に失敗しました -endpoint.nio.pollerEventError=poller イベント処理中のエラー endpoint.nio.registerFail=Pollerからソケットのセレクタに登録できませんでした。 endpoint.nio.selectorCloseFail=Pollerを閉じるときにセレクターを閉じることができませんでした。 endpoint.nio.selectorLoopError=セレクタの処理ループ中のエラー diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties index 6fae3c6..b9fd685 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties @@ -100,7 +100,6 @@ endpoint.nio.nullLatch=Latch가 널이어서는 안됩니다. endpoint.nio.nullSocketChannel=PollerEvent를 처리하는 중 유효하지 않은 널 소켓 채널이 발견되었습니다. endpoint.nio.perms.readFail=Unix 도메인 소켓 [{0}]에 읽기를 허용하는 데에 실패했
[tomcat] branch main updated: i18n removed one unused and add one missing
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/main by this push: new 3af116c i18n removed one unused and add one missing 3af116c is described below commit 3af116c2d5b2cb0ec0bfe1eee63d76d0a362fbbb Author: Mark Thomas AuthorDate: Fri Feb 18 18:11:09 2022 + i18n removed one unused and add one missing --- java/org/apache/tomcat/util/net/LocalStrings.properties | 2 +- java/org/apache/tomcat/util/net/LocalStrings_fr.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_ja.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_ko.properties| 1 - java/org/apache/tomcat/util/net/LocalStrings_zh_CN.properties | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties b/java/org/apache/tomcat/util/net/LocalStrings.properties index 3389f01..8c22c84 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings.properties @@ -86,7 +86,6 @@ endpoint.nio.nullLatch=Latch cannot be null endpoint.nio.nullSocketChannel=Invalid null socket channel while processing poller event endpoint.nio.perms.readFail=Failed to set read permissions for Unix domain socket [{0}] endpoint.nio.perms.writeFail=Failed to set write permissions for Unix domain socket [{0}] -endpoint.nio.pollerEventError=Error processing poller event endpoint.nio.registerFail=Failed to register socket with selector from poller endpoint.nio.selectorCloseFail=Failed to close selector when closing the poller endpoint.nio.selectorLoopError=Error in selector loop @@ -143,6 +142,7 @@ sslHostConfig.certificateVerificationInvalid=The certificate verification value sslHostConfig.fileNotFound=Configured file [{0}] does not exist sslHostConfig.invalid_truststore_password=The provided trust store password could not be used to unlock and/or validate the trust store. Retrying to access the trust store with a null password which will skip validation. sslHostConfig.mismatch=The property [{0}] was set on the SSLHostConfig named [{1}] and is for the [{2}] configuration syntax but the SSLHostConfig is being used with the [{3}] configuration syntax +sslHostConfig.opensslconf.alreadyset=Attempt to set another OpenSSLConf ignored sslHostConfig.opensslconf.null=Attempt to set null OpenSSLConf ignored sslHostConfig.prefix_missing=The protocol [{0}] was added to the list of protocols on the SSLHostConfig named [{1}]. Check if a +/- prefix is missing. diff --git a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties index 14128f6..801cd2e 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_fr.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_fr.properties @@ -85,7 +85,6 @@ endpoint.nio.nullLatch=Le latch ne peut être null endpoint.nio.nullSocketChannel=Le canal du socket est invalide car null lors du traitement de l'évênement du poller endpoint.nio.perms.readFail=Echec d''ajout des permissions en lecture pour le socket de domaine Unix [{0}] endpoint.nio.perms.writeFail=Echec d''ajout des permissions en écriture pour le socket de domaine Unix [{0}] -endpoint.nio.pollerEventError=Erreur lors du traitement de l'évènement du poller endpoint.nio.registerFail=Echec d'enregistrement du socket avec le sélecteur du poller endpoint.nio.selectorCloseFail=Impossible de fermer le sélecteur lors de la fermeture du poller endpoint.nio.selectorLoopError=Erreur dans la boucle du sélecteur diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties index 69d71e1..3fb7f1e 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_ja.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_ja.properties @@ -85,7 +85,6 @@ endpoint.nio.nullLatch=Latch に null は指定できません。 endpoint.nio.nullSocketChannel=pollerイベントの処理中の無効なnullソケットチャネル endpoint.nio.perms.readFail=Unixドメインソケット [{0}] の読み取り権限の設定に失敗しました endpoint.nio.perms.writeFail=Unixドメインソケット [{0}] の書き込み権限の設定に失敗しました -endpoint.nio.pollerEventError=poller イベント処理中のエラー endpoint.nio.registerFail=Pollerからソケットのセレクタに登録できませんでした。 endpoint.nio.selectorCloseFail=Pollerを閉じるときにセレクターを閉じることができませんでした。 endpoint.nio.selectorLoopError=セレクタの処理ループ中のエラー diff --git a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties index 6c186ce..fddc8b1 100644 --- a/java/org/apache/tomcat/util/net/LocalStrings_ko.properties +++ b/java/org/apache/tomcat/util/net/LocalStrings_ko.properties @@ -85,7 +85,6 @@ endpoint.nio.nullLatch=Latch가 널이어서는 안됩니다. endpoint.nio.nullSocketChannel=PollerEvent를 처리하는 중 유효하지 않은 널 소켓 채널이 발견되었습니다. endpoint.nio.perms.readFail=Unix 도메인 소켓 [{0}]에 읽기를 허용하는 데에 실패했습니다. endpoi
[tomcat] branch 8.5.x updated: Back-port the enhancement to the graceful close feature. BZ 64080
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/8.5.x by this push: new 551061e Back-port the enhancement to the graceful close feature. BZ 64080 551061e is described below commit 551061e203f7925a7b6fa074c5d529c8e6ad9ec2 Author: Mark Thomas AuthorDate: Fri Feb 18 19:02:17 2022 + Back-port the enhancement to the graceful close feature. BZ 64080 --- java/org/apache/catalina/core/StandardService.java | 41 -- java/org/apache/coyote/AbstractProtocol.java | 14 java/org/apache/coyote/LocalStrings.properties | 1 + java/org/apache/coyote/LocalStrings_fr.properties | 1 + java/org/apache/coyote/LocalStrings_ja.properties | 1 + java/org/apache/coyote/LocalStrings_ko.properties | 1 + .../apache/coyote/LocalStrings_zh_CN.properties| 1 + java/org/apache/coyote/ProtocolHandler.java| 34 ++ .../apache/tomcat/util/net/AbstractEndpoint.java | 34 +++--- webapps/docs/changelog.xml | 7 webapps/docs/config/service.xml| 10 ++ 11 files changed, 129 insertions(+), 16 deletions(-) diff --git a/java/org/apache/catalina/core/StandardService.java b/java/org/apache/catalina/core/StandardService.java index d148eeb..c7616b1 100644 --- a/java/org/apache/catalina/core/StandardService.java +++ b/java/org/apache/catalina/core/StandardService.java @@ -100,8 +100,21 @@ public class StandardService extends LifecycleMBeanBase implements Service { protected final MapperListener mapperListener = new MapperListener(this); +private long gracefulStopAwaitMillis = 0; + + // - Properties +public long getGracefulStopAwaitMillis() { +return gracefulStopAwaitMillis; +} + + +public void setGracefulStopAwaitMillis(long gracefulStopAwaitMillis) { +this.gracefulStopAwaitMillis = gracefulStopAwaitMillis; +} + + @Override public Mapper getMapper() { return mapper; @@ -459,20 +472,26 @@ public class StandardService extends LifecycleMBeanBase implements Service { @Override protected void stopInternal() throws LifecycleException { -// Pause connectors first synchronized (connectorsLock) { +// Initiate a graceful stop for each connector +// This will only work if the bindOnInit==false which is not the +// default. for (Connector connector: connectors) { -try { -connector.pause(); -} catch (Exception e) { -log.error(sm.getString( -"standardService.connector.pauseFailed", -connector), e); -} -// Close server socket if bound on start -// Note: test is in AbstractEndpoint connector.getProtocolHandler().closeServerSocketGraceful(); } + +// Wait for the graceful shutdown to complete +long waitMillis = gracefulStopAwaitMillis; +if (waitMillis > 0) { +for (Connector connector: connectors) { +waitMillis = connector.getProtocolHandler().awaitConnectionsClose(waitMillis); +} +} + +// Pause the connectors +for (Connector connector: connectors) { +connector.pause(); +} } if(log.isInfoEnabled()) { @@ -480,7 +499,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { } setState(LifecycleState.STOPPING); -// Stop our defined Container second +// Stop our defined Container once the Connectors are all paused if (engine != null) { synchronized (engine) { engine.stop(); diff --git a/java/org/apache/coyote/AbstractProtocol.java b/java/org/apache/coyote/AbstractProtocol.java index 5b10150..59aff52 100644 --- a/java/org/apache/coyote/AbstractProtocol.java +++ b/java/org/apache/coyote/AbstractProtocol.java @@ -287,6 +287,12 @@ public abstract class AbstractProtocol implements ProtocolHandler, public void setSoLinger(int soLinger) { endpoint.setSoLinger(soLinger); } +/** + * The time Tomcat will wait for a subsequent request before closing the + * connection. The default is {@link #getConnectionTimeout()}. + * + * @return The timeout in milliseconds + */ public int getKeepAliveTimeout() { return endpoint.getKeepAliveTimeout(); } public void setKeepAliveTimeout(int keepAliveTimeout) { endpoint.setKeepAliveTimeout(keepAliveTimeout); @@ -710,6 +716,14 @@ public abstract class AbstractProtocol implements ProtocolHandler,
[Bug 64080] Graceful shutdown does not occur for connected clients that have not yet submitted their request payload
https://bz.apache.org/bugzilla/show_bug.cgi?id=64080 --- Comment #15 from Mark Thomas --- This has now been back-ported to 8.5.x for 8.5.76 onwards. Other fixes required 8.5.x to be updated to align with 9.0.x which made this back-port possible. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 8.5.x updated: Back-port the portOffset feature BZ 61171
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/8.5.x by this push: new b036c9e Back-port the portOffset feature BZ 61171 b036c9e is described below commit b036c9e034d496d434a596a50b02df8ab326a087 Author: Mark Thomas AuthorDate: Fri Feb 18 20:18:31 2022 + Back-port the portOffset feature BZ 61171 https://bz.apache.org/bugzilla/show_bug.cgi?id=61171 --- java/org/apache/catalina/Server.java | 31 +++ java/org/apache/catalina/connector/Connector.java | 45 -- .../catalina/connector/mbeans-descriptors.xml | 21 -- .../apache/catalina/core/LocalStrings.properties | 2 + .../catalina/core/LocalStrings_fr.properties | 2 + .../catalina/core/LocalStrings_ja.properties | 2 + .../catalina/core/LocalStrings_ko.properties | 2 + .../catalina/core/LocalStrings_zh_CN.properties| 2 + java/org/apache/catalina/core/StandardServer.java | 43 ++--- .../apache/catalina/core/mbeans-descriptors.xml| 11 +- java/org/apache/catalina/mbeans/MBeanFactory.java | 2 +- java/org/apache/catalina/realm/RealmBase.java | 2 +- .../apache/catalina/startup/AddPortOffsetRule.java | 36 + java/org/apache/catalina/startup/Catalina.java | 27 - .../catalina/startup/LocalStrings.properties | 3 +- .../catalina/startup/LocalStrings_fr.properties| 3 +- .../catalina/startup/LocalStrings_ja.properties| 2 + .../catalina/startup/LocalStrings_ko.properties| 2 + .../catalina/startup/LocalStrings_zh_CN.properties | 2 + .../apache/catalina/valves/RemoteAddrValve.java| 2 +- .../apache/catalina/valves/RemoteHostValve.java| 3 +- java/org/apache/coyote/AbstractProtocol.java | 27 +++-- java/org/apache/coyote/LocalStrings.properties | 1 + java/org/apache/coyote/LocalStrings_fr.properties | 1 + java/org/apache/coyote/LocalStrings_ja.properties | 1 + java/org/apache/coyote/LocalStrings_ko.properties | 1 + .../apache/coyote/LocalStrings_zh_CN.properties| 1 + .../apache/tomcat/util/net/AbstractEndpoint.java | 23 ++- java/org/apache/tomcat/util/net/AprEndpoint.java | 3 +- .../apache/tomcat/util/net/LocalStrings.properties | 1 + .../tomcat/util/net/LocalStrings_fr.properties | 1 + .../tomcat/util/net/LocalStrings_ja.properties | 1 + .../tomcat/util/net/LocalStrings_ko.properties | 1 + .../tomcat/util/net/LocalStrings_zh_CN.properties | 1 + java/org/apache/tomcat/util/net/Nio2Endpoint.java | 2 +- java/org/apache/tomcat/util/net/NioEndpoint.java | 6 +-- webapps/docs/changelog.xml | 6 +++ webapps/docs/config/server.xml | 6 +++ 38 files changed, 288 insertions(+), 40 deletions(-) diff --git a/java/org/apache/catalina/Server.java b/java/org/apache/catalina/Server.java index b9e254f..9cba300 100644 --- a/java/org/apache/catalina/Server.java +++ b/java/org/apache/catalina/Server.java @@ -71,6 +71,9 @@ public interface Server extends Lifecycle { /** * @return the port number we listen to for shutdown commands. + * + * @see #getPortOffset() + * @see #getPortWithOffset() */ public int getPort(); @@ -79,9 +82,37 @@ public interface Server extends Lifecycle { * Set the port number we listen to for shutdown commands. * * @param port The new port number + * + * @see #setPortOffset(int) */ public void setPort(int port); +/** + * Get the number that offsets the port used for shutdown commands. + * For example, if port is 8005, and portOffset is 1000, + * the server listens at 9005. + * + * @return the port offset + */ +public int getPortOffset(); + +/** + * Set the number that offsets the server port used for shutdown commands. + * For example, if port is 8005, and you set portOffset to 1000, + * connector listens at 9005. + * + * @param portOffset sets the port offset + */ +public void setPortOffset(int portOffset); + +/** + * Get the actual port on which server is listening for the shutdown commands. + * If you do not set port offset, port is returned. If you set + * port offset, port offset + port is returned. + * + * @return the port with offset + */ +public int getPortWithOffset(); /** * @return the address on which we listen to for shutdown commands. diff --git a/java/org/apache/catalina/connector/Connector.java b/java/org/apache/catalina/connector/Connector.java index 320e1c4..c13b80e 100644 --- a/java/org/apache/catalina/connector/Connector.java +++ b/java/org/apache/catalina/connector/Connector.java @@ -33,6 +33,7 @@ import org.apache.catalina.LifecycleState; import org.apac
[Bug 65755] Users sporadically receive responses intended for other user's session
https://bz.apache.org/bugzilla/show_bug.cgi?id=65755 Mark Thomas changed: What|Removed |Added Resolution|--- |DUPLICATE Status|NEEDINFO|RESOLVED --- Comment #6 from Mark Thomas --- Marking this as a duplicate of the the earlier bug since the root cause is the same. *** This bug has been marked as a duplicate of bug 65408 *** -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 65408] tomcat8.5.X occurs an AssertionError occationally after running for a period of time
https://bz.apache.org/bugzilla/show_bug.cgi?id=65408 Mark Thomas changed: What|Removed |Added CC||dimitrios.psymar...@atos.ne ||t --- Comment #19 from Mark Thomas --- *** Bug 65755 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 8.5.x updated: Update changelog
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/8.5.x by this push: new 7b6486d Update changelog 7b6486d is described below commit 7b6486d5d3d443af02f5f6ef6f8072e6f19bf0c5 Author: Mark Thomas AuthorDate: Fri Feb 18 20:46:32 2022 + Update changelog --- webapps/docs/changelog.xml | 7 +++ 1 file changed, 7 insertions(+) diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index ccaddf4..a2933ee 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -167,6 +167,13 @@ +65408: Backport the socket close refactoring - along with +supporting changes - that ensures that a socket is only closed once. +Pooled objects associated with the socket are now replaced with dummy +instances to protect against applications that attempt to continue to +use the socket after it has been closed. (markt/remm) + + Correct a regression in the fix for 65454 that meant that minSpareThreads and maxThreads settings were ignored when the Connector used an internal executor. (markt) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 65408] tomcat8.5.X occurs an AssertionError occationally after running for a period of time
https://bz.apache.org/bugzilla/show_bug.cgi?id=65408 Mark Thomas changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |FIXED --- Comment #20 from Mark Thomas --- I've finally managed to track down the root cause of this. If an application attempts to send a WebSocket message concurrently with the WwebSocket connection closing, it is possible that the application will continue to use the socket after it has been closed. Because some objects associated with the socket are pooled, this could cause problems. This has been fixed in 8.5.x for 8.5.76 onwards. The fix required back-porting a lot of changes to the connectors. Users that implement their own Endpoints might see a compatibility issue due to these changes. We will look at options to fix these compatibility issues on a case by case basis as they are identified. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org