You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/10/12 10:12:53 UTC

[tomcat] branch main updated (39821e7b3c -> 2763077bba)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


    from 39821e7b3c Add the initial plumbing for the loom module
     new 1c21f344be Refactor in preparation for adding initial Loom endpoint
     new ebbe5f1d16 Add initial Loom implementation
     new 2763077bba Sync local snapshot version with nexus snapshot version

The 3 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/tomcat/util/net/AbstractEndpoint.java   |  17 +-
 .../util/net/AbstractNetworkChannelEndpoint.java   |  39 +-
 java/org/apache/tomcat/util/net/Nio2Endpoint.java  |   2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java   |   2 +-
 .../coyote/http11/Http11BioLoomProtocol.java       |  33 +-
 .../apache/coyote/http11/Http11LoomProcessor.java  |  13 +-
 .../apache/tomcat/util/net/BioLoomEndpoint.java    | 455 +++++++++++++++++++++
 res/maven/mvn-pub.xml                              |   2 +-
 8 files changed, 509 insertions(+), 54 deletions(-)
 copy test/org/apache/catalina/loader/EchoTag.java => java/org/apache/tomcat/util/net/AbstractNetworkChannelEndpoint.java (54%)
 copy java/org/apache/catalina/users/SparseUserDatabase.java => modules/loom/src/main/java/org/apache/coyote/http11/Http11LoomProcessor.java (76%)
 create mode 100644 modules/loom/src/main/java/org/apache/tomcat/util/net/BioLoomEndpoint.java


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/03: Refactor in preparation for adding initial Loom endpoint

Posted by ma...@apache.org.
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

commit 1c21f344bed88f9846bd8c172e4181325b8a64ea
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Oct 12 10:48:19 2022 +0100

    Refactor in preparation for adding initial Loom endpoint
---
 .../apache/tomcat/util/net/AbstractEndpoint.java   | 17 +--------
 .../util/net/AbstractNetworkChannelEndpoint.java   | 43 ++++++++++++++++++++++
 java/org/apache/tomcat/util/net/Nio2Endpoint.java  |  2 +-
 java/org/apache/tomcat/util/net/NioEndpoint.java   |  2 +-
 4 files changed, 46 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 1e473fe9a1..4e3b692ad1 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -21,9 +21,7 @@ import java.io.OutputStreamWriter;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.NetworkInterface;
-import java.net.SocketAddress;
 import java.net.SocketException;
-import java.nio.channels.NetworkChannel;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -739,9 +737,6 @@ public abstract class AbstractEndpoint<S,U> {
     public void setAddress(InetAddress address) { this.address = address; }
 
 
-    protected abstract NetworkChannel getServerSocket();
-
-
     /**
      * Obtain the network address the server socket is bound to. This primarily
      * exists to enable the correct address to be used when unlocking the server
@@ -754,17 +749,7 @@ public abstract class AbstractEndpoint<S,U> {
      * @throws IOException If there is a problem determining the currently bound
      *                     socket
      */
-    protected final InetSocketAddress getLocalAddress() throws IOException {
-        NetworkChannel serverSock = getServerSocket();
-        if (serverSock == null) {
-            return null;
-        }
-        SocketAddress sa = serverSock.getLocalAddress();
-        if (sa instanceof InetSocketAddress) {
-            return (InetSocketAddress) sa;
-        }
-        return null;
-    }
+    protected abstract InetSocketAddress getLocalAddress() throws IOException;
 
 
     /**
diff --git a/java/org/apache/tomcat/util/net/AbstractNetworkChannelEndpoint.java b/java/org/apache/tomcat/util/net/AbstractNetworkChannelEndpoint.java
new file mode 100644
index 0000000000..b52291e778
--- /dev/null
+++ b/java/org/apache/tomcat/util/net/AbstractNetworkChannelEndpoint.java
@@ -0,0 +1,43 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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 org.apache.tomcat.util.net;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.nio.channels.Channel;
+import java.nio.channels.NetworkChannel;
+
+public abstract class AbstractNetworkChannelEndpoint<S extends Channel, U extends NetworkChannel>
+        extends AbstractEndpoint<S, U> {
+
+    protected abstract NetworkChannel getServerSocket();
+
+
+    @Override
+    protected final InetSocketAddress getLocalAddress() throws IOException {
+        NetworkChannel serverSock = getServerSocket();
+        if (serverSock == null) {
+            return null;
+        }
+        SocketAddress sa = serverSock.getLocalAddress();
+        if (sa instanceof InetSocketAddress) {
+            return (InetSocketAddress) sa;
+        }
+        return null;
+    }
+}
\ No newline at end of file
diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index 75444cfbc2..9ad21cfbde 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -52,7 +52,7 @@ import org.apache.tomcat.util.net.jsse.JSSESupport;
 /**
  * NIO2 endpoint.
  */
-public class Nio2Endpoint extends AbstractEndpoint<Nio2Channel,AsynchronousSocketChannel> {
+public class Nio2Endpoint extends AbstractNetworkChannelEndpoint<Nio2Channel,AsynchronousSocketChannel> {
 
 
     // -------------------------------------------------------------- Constants
diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java
index d15aef314e..bdc534263e 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -76,7 +76,7 @@ import org.apache.tomcat.util.net.jsse.JSSESupport;
  * @author Mladen Turk
  * @author Remy Maucherat
  */
-public class NioEndpoint extends AbstractEndpoint<NioChannel,SocketChannel> {
+public class NioEndpoint extends AbstractNetworkChannelEndpoint<NioChannel,SocketChannel> {
 
 
     // -------------------------------------------------------------- Constants


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/03: Add initial Loom implementation

Posted by ma...@apache.org.
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

commit ebbe5f1d16c8ee345b3334abc3cd2c20d61171f4
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Oct 12 10:49:31 2022 +0100

    Add initial Loom implementation
    
    Supports basic HTTP requests. No TLS, no async.
---
 .../coyote/http11/Http11BioLoomProtocol.java       |  33 +-
 ...oLoomProtocol.java => Http11LoomProcessor.java} |  17 +-
 .../apache/tomcat/util/net/BioLoomEndpoint.java    | 455 +++++++++++++++++++++
 3 files changed, 486 insertions(+), 19 deletions(-)

diff --git a/modules/loom/src/main/java/org/apache/coyote/http11/Http11BioLoomProtocol.java b/modules/loom/src/main/java/org/apache/coyote/http11/Http11BioLoomProtocol.java
index 9b6efddac6..e3c8acf1e1 100644
--- a/modules/loom/src/main/java/org/apache/coyote/http11/Http11BioLoomProtocol.java
+++ b/modules/loom/src/main/java/org/apache/coyote/http11/Http11BioLoomProtocol.java
@@ -16,13 +16,27 @@
  */
 package org.apache.coyote.http11;
 
-/**
- * Dummy implementation for now that just extends the standard NIO
- * implementation.
- */
-public class Http11BioLoomProtocol extends Http11NioProtocol {
+import java.net.Socket;
+
+import org.apache.coyote.Processor;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.net.BioLoomEndpoint;
+
+public class Http11BioLoomProtocol extends AbstractHttp11Protocol<Socket> {
+
+    private static final Log log = LogFactory.getLog(Http11BioLoomProtocol.class);
+
+    public Http11BioLoomProtocol() {
+        super(new BioLoomEndpoint());
+    }
+
+
+    @Override
+    protected Log getLog() {
+        return log;
+    }
 
-    // ----------------------------------------------------- JMX related methods
 
     @Override
     protected String getNamePrefix() {
@@ -32,4 +46,11 @@ public class Http11BioLoomProtocol extends Http11NioProtocol {
             return "http-bio-loom";
         }
     }
+
+
+    @Override
+    protected Processor createProcessor() {
+        Http11Processor processor = new Http11LoomProcessor(this, adapter);
+        return processor;
+    }
 }
diff --git a/modules/loom/src/main/java/org/apache/coyote/http11/Http11BioLoomProtocol.java b/modules/loom/src/main/java/org/apache/coyote/http11/Http11LoomProcessor.java
similarity index 65%
copy from modules/loom/src/main/java/org/apache/coyote/http11/Http11BioLoomProtocol.java
copy to modules/loom/src/main/java/org/apache/coyote/http11/Http11LoomProcessor.java
index 9b6efddac6..cc1e5de4d0 100644
--- a/modules/loom/src/main/java/org/apache/coyote/http11/Http11BioLoomProtocol.java
+++ b/modules/loom/src/main/java/org/apache/coyote/http11/Http11LoomProcessor.java
@@ -16,20 +16,11 @@
  */
 package org.apache.coyote.http11;
 
-/**
- * Dummy implementation for now that just extends the standard NIO
- * implementation.
- */
-public class Http11BioLoomProtocol extends Http11NioProtocol {
+import org.apache.coyote.Adapter;
 
-    // ----------------------------------------------------- JMX related methods
+public class Http11LoomProcessor extends Http11Processor {
 
-    @Override
-    protected String getNamePrefix() {
-        if (isSSLEnabled()) {
-            return "https-" + getSslImplementationShortName()+ "-bio-loom";
-        } else {
-            return "http-bio-loom";
-        }
+    public Http11LoomProcessor(AbstractHttp11Protocol<?> protocol, Adapter adapter) {
+        super(protocol, adapter);
     }
 }
diff --git a/modules/loom/src/main/java/org/apache/tomcat/util/net/BioLoomEndpoint.java b/modules/loom/src/main/java/org/apache/tomcat/util/net/BioLoomEndpoint.java
new file mode 100644
index 0000000000..3047253a4c
--- /dev/null
+++ b/modules/loom/src/main/java/org/apache/tomcat/util/net/BioLoomEndpoint.java
@@ -0,0 +1,455 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.tomcat.util.net;
+
+import java.io.IOException;
+import java.net.BindException;
+import java.net.InetSocketAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.nio.ByteBuffer;
+import java.nio.channels.CompletionHandler;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+import javax.net.ServerSocketFactory;
+
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.ExceptionUtils;
+
+public class BioLoomEndpoint extends AbstractEndpoint<Socket, Socket> {
+
+    private static final Log log = LogFactory.getLog(BioLoomEndpoint.class);
+    //private static final Log logHandshake = LogFactory.getLog(JioLoomEndpoint.class.getName() + ".handshake");
+
+    private volatile ServerSocket serverSocket = null;
+
+    private SocketAddress previousAcceptedSocketRemoteAddress = null;
+    private long previousAcceptedSocketNanoTime = 0;
+
+    private Thread.Builder threadBuilder;
+
+
+    @Override
+    public void bind() throws Exception {
+        initServerSocket();
+
+        // Initialize SSL if needed
+        initialiseSsl();
+    }
+
+
+    protected void initServerSocket() throws Exception {
+        try {
+            ServerSocketFactory serverSocketFactory = ServerSocketFactory.getDefault();
+            if (getAddress() == null) {
+                serverSocket = serverSocketFactory.createServerSocket(getPort(), getAcceptCount());
+            } else {
+                serverSocket = serverSocketFactory.createServerSocket(getPort(), getAcceptCount(), getAddress());
+            }
+        } catch (BindException orig) {
+            String msg;
+            if (getAddress() == null) {
+              msg = orig.getMessage() + " <null>:" + getPort();
+            } else {
+              msg = orig.getMessage() + " " + getAddress().toString() + ":" + getPort();
+            }
+            BindException be = new BindException(msg);
+            be.initCause(orig);
+            throw be;
+        }
+    }
+
+
+    @Override
+    public void startInternal() throws Exception {
+        if (!running) {
+            running = true;
+            paused = false;
+
+            threadBuilder = Thread.ofVirtual().name(getName() + "-", 0);
+
+            initializeConnectionLatch();
+
+            startAcceptorThread();
+        }
+    }
+
+
+    @Override
+    public void stopInternal() throws Exception {
+        if (!paused) {
+            pause();
+        }
+        if (running) {
+            running = false;
+            acceptor.stop(10);
+        }
+    }
+
+
+    @Override
+    public void unbind() throws Exception {
+        if (log.isDebugEnabled()) {
+            log.debug("Destroy initiated for " +
+                    new InetSocketAddress(getAddress(),getPortWithOffset()));
+        }
+        if (running) {
+            stop();
+        }
+        try {
+            doCloseServerSocket();
+        } catch (IOException ioe) {
+            getLog().warn(sm.getString("endpoint.serverSocket.closeFailed", getName()), ioe);
+        }
+        destroySsl();
+        super.unbind();
+        if (getHandler() != null ) {
+            getHandler().recycle();
+        }
+        if (log.isDebugEnabled()) {
+            log.debug("Destroy completed for " +
+                    new InetSocketAddress(getAddress(), getPortWithOffset()));
+        }
+    }
+
+
+    @Override
+    protected void doCloseServerSocket() throws IOException {
+        ServerSocket serverSocket = this.serverSocket;
+
+        if (serverSocket != null) {
+            serverSocket.close();
+            serverSocket = null;
+        }
+    }
+
+
+    @Override
+    protected Socket serverSocketAccept() throws Exception {
+        Socket result = serverSocket.accept();
+
+        SocketAddress currentRemoteAddress = result.getRemoteSocketAddress();
+        long currentNanoTime = System.nanoTime();
+        if (currentRemoteAddress.equals(previousAcceptedSocketRemoteAddress) &&
+                currentNanoTime - previousAcceptedSocketNanoTime < 1000) {
+            throw new IOException(sm.getString("endpoint.err.duplicateAccept"));
+        }
+        previousAcceptedSocketRemoteAddress = currentRemoteAddress;
+        previousAcceptedSocketNanoTime = currentNanoTime;
+
+        return result;
+    }
+
+
+    @Override
+    protected boolean setSocketOptions(Socket socket) {
+        try {
+            socketProperties.setProperties(socket);
+
+        } catch (SocketException s) {
+            // Error here is common if the client has reset the connection
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("endpoint.err.unexpected"), s);
+            }
+            // Close the socket
+            return false;
+        } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
+            log.error(sm.getString("endpoint.err.unexpected"), t);
+            // Close the socket
+            return false;
+        }
+
+        // Process the request from this socket
+        try {
+            BioLoomSocketWrapper wrapper = new BioLoomSocketWrapper(socket, this);
+
+            connections.put(socket, wrapper);
+            wrapper.setKeepAliveLeft(getMaxKeepAliveRequests());
+
+            SocketProcessor socketProcessor = new SocketProcessor(wrapper);
+            threadBuilder.start(socketProcessor);
+        } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
+            log.error(sm.getString("endpoint.process.fail"), t);
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    protected void destroySocket(Socket socket) {
+        countDownConnection();
+        try {
+            socket.close();
+        } catch (IOException ioe) {
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("endpoint.err.close"), ioe);
+            }
+        }
+    }
+
+
+    @Override
+    protected InetSocketAddress getLocalAddress() throws IOException {
+
+        ServerSocket serverSocket = this.serverSocket;
+
+        if (serverSocket == null) {
+            return null;
+        }
+
+        SocketAddress sa = serverSocket.getLocalSocketAddress();
+        if (sa instanceof InetSocketAddress) {
+            return (InetSocketAddress) sa;
+        }
+
+        return null;
+    }
+
+
+    @Override
+    protected Log getLog() {
+        return log;
+    }
+
+
+    @Override
+    protected SocketProcessorBase<Socket> createSocketProcessor(SocketWrapperBase<Socket> socketWrapper,
+            SocketEvent event) {
+        // This method should never be called for this Endpoint.
+        // TODO i18n message
+        throw new IllegalStateException();
+    }
+
+
+    @Override
+    public boolean getUseSendfile() {
+        // Disable sendfile
+        return false;
+    }
+
+
+    public static class BioLoomSocketWrapper extends SocketWrapperBase<Socket> {
+
+        public BioLoomSocketWrapper(Socket socket, AbstractEndpoint<Socket, ?> endpoint) {
+            super(socket, endpoint);
+            socketBufferHandler = new SocketBufferHandler(
+                    endpoint.getSocketProperties().getAppReadBufSize(),
+                    endpoint.getSocketProperties().getAppWriteBufSize(),
+                    false);
+        }
+
+        @Override
+        protected void populateRemoteHost() {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        protected void populateRemoteAddr() {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        protected void populateRemotePort() {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        protected void populateLocalName() {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        protected void populateLocalAddr() {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        protected void populateLocalPort() {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        public int read(boolean block, byte[] b, int off, int len) throws IOException {
+            // TODO Auto-generated method stub
+            return 0;
+        }
+
+
+        @Override
+        public int read(boolean block, ByteBuffer to) throws IOException {
+            if (to.hasArray()) {
+                int read = getSocket().getInputStream().read(
+                        to.array(), to.arrayOffset() + to.position(), to.remaining());
+                if (read > 0) {
+                    to.position(to.position() + read);
+                }
+                return read;
+            } else {
+                throw new IllegalStateException();
+            }
+        }
+
+
+        @Override
+        public boolean isReadyForRead() throws IOException {
+            // TODO Auto-generated method stub
+            return false;
+        }
+
+        @Override
+        public void setAppReadBufHandler(ApplicationBufferHandler handler) {
+            // TODO Auto-generated method stub
+
+        }
+
+
+        @Override
+        protected void doClose() {
+            if (log.isDebugEnabled()) {
+                log.debug("Calling [" + getEndpoint() + "].closeSocket([" + this + "])");
+            }
+            try {
+                getEndpoint().connections.remove(getSocket());
+                getSocket().close();
+            } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
+                if (log.isDebugEnabled()) {
+                    // TODO i18n
+                    log.error("Socket close fail", e);
+                }
+            } finally {
+                socketBufferHandler = SocketBufferHandler.EMPTY;
+                nonBlockingWriteBuffer.clear();
+            }
+        }
+
+
+        @Override
+        protected boolean flushNonBlocking() throws IOException {
+            // TODO Auto-generated method stub
+            return false;
+        }
+
+        @Override
+        protected void doWrite(boolean block, ByteBuffer from) throws IOException {
+            if (from.hasArray()) {
+                getSocket().getOutputStream().write(from.array(), from.arrayOffset(), from.remaining());
+                from.position(from.limit());
+            } else {
+                throw new IllegalStateException();
+            }
+        }
+
+        @Override
+        public void registerReadInterest() {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        public void registerWriteInterest() {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        public SendfileDataBase createSendfileData(String filename, long pos, long length) {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        @Override
+        public SendfileState processSendfile(SendfileDataBase sendfileData) {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        @Override
+        public void doClientAuth(SSLSupport sslSupport) throws IOException {
+            // TODO Auto-generated method stub
+
+        }
+
+        @Override
+        public SSLSupport getSslSupport() {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        @Override
+        protected <A> SocketWrapperBase<Socket>.OperationState<A> newOperationState(boolean read, ByteBuffer[] buffers,
+                int offset, int length, BlockingMode block, long timeout, TimeUnit unit, A attachment,
+                CompletionCheck check, CompletionHandler<Long, ? super A> handler, Semaphore semaphore,
+                SocketWrapperBase<Socket>.VectoredIOCompletionHandler<A> completion) {
+            // TODO Auto-generated method stub
+            return null;
+        }
+    }
+
+
+    protected class SocketProcessor implements Runnable {
+
+        private final SocketWrapperBase<Socket> socketWrapper;
+
+        public SocketProcessor(SocketWrapperBase<Socket> socketWrapper) {
+            this.socketWrapper = socketWrapper;
+        }
+
+        @Override
+        public void run() {
+            try {
+                if (isSSLEnabled()) {
+                    // Need to do handshake
+                    Socket s = socketWrapper.getSocket();
+
+                    // TODO
+                    socketWrapper.reset(s);
+                    /*
+                    try {
+                    } catch (IOException ioe) {
+                        if (logHandshake.isDebugEnabled()) {
+                            logHandshake.debug(sm.getString("endpoint.err.handshake",
+                                    socketWrapper.getRemoteAddr(), Integer.toString(socketWrapper.getRemotePort())), ioe);
+                        }
+                    }
+                    */
+                }
+
+                getHandler().process(socketWrapper, SocketEvent.OPEN_READ);
+
+            } catch (VirtualMachineError vme) {
+                ExceptionUtils.handleThrowable(vme);
+            } catch (Throwable t) {
+                log.error(sm.getString("endpoint.processing.fail"), t);
+            } finally {
+                socketWrapper.close();
+            }
+        }
+    }
+}
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 03/03: Sync local snapshot version with nexus snapshot version

Posted by ma...@apache.org.
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

commit 2763077bbaf018cf76a3247c8ea08c486b505ea7
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Oct 12 11:12:40 2022 +0100

    Sync local snapshot version with nexus snapshot version
---
 res/maven/mvn-pub.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/maven/mvn-pub.xml b/res/maven/mvn-pub.xml
index e24188a968..f7c6a9e190 100644
--- a/res/maven/mvn-pub.xml
+++ b/res/maven/mvn-pub.xml
@@ -79,7 +79,7 @@
         <param name="pom" value="${tomcat.pom.path}/@{pom}"/>
         <param name="src" value="@{src}"/>
         <param name="src.skip" value="@{src.skip}"/>
-        <param name="maven.deploy.version" value="${maven.asf.release.deploy.version}-dev"/>
+        <param name="maven.deploy.version" value="${maven.asf.release.deploy.version}-SNAPSHOT"/>
       </antcall>
     </sequential>
   </macrodef>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org