You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2018/04/02 08:22:59 UTC

[1/6] mina git commit: Removed a useless import

Repository: mina
Updated Branches:
  refs/heads/2.0 a19707817 -> 5d8b27b0b


Removed a useless import

Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/5eba67dd
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/5eba67dd
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/5eba67dd

Branch: refs/heads/2.0
Commit: 5eba67dd8cfd0035d0122e171ea380feb94dc806
Parents: 60cb619
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Sat Mar 31 09:35:59 2018 +0200
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Sat Mar 31 09:35:59 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java  | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/5eba67dd/mina-example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java
----------------------------------------------------------------------
diff --git a/mina-example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java b/mina-example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java
index e330290..c5ac40e 100644
--- a/mina-example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java
+++ b/mina-example/src/test/java/org/apache/mina/example/echoserver/ssl/SslFilterTest.java
@@ -24,7 +24,6 @@ import static org.junit.Assert.assertTrue;
 
 import java.net.InetSocketAddress;
 import java.net.Socket;
-import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.security.cert.CertificateException;
 import java.util.ArrayList;


[3/6] mina git commit: Added a flag to be used when one does not want the handshake to start immediately after the SslFilter has been added into the chain

Posted by el...@apache.org.
Added a flag to be used when one does not want the handshake to start
immediately after the SslFilter has been added into the chain

Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/7c4dc7b9
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/7c4dc7b9
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/7c4dc7b9

Branch: refs/heads/2.0
Commit: 7c4dc7b9868b4b51dfa4d84e0c2ac80813831f7a
Parents: 1ee000d
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Sat Mar 31 09:42:18 2018 +0200
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Sat Mar 31 09:42:18 2018 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/mina/filter/ssl/SslFilter.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/7c4dc7b9/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java
index 3494d50..846f1d8 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java
@@ -159,7 +159,10 @@ public class SslFilter extends IoFilterAdapter {
     private final boolean autoStart;
 
     /** A flag used to determinate if the handshake should start immediately */
-    private static final boolean START_HANDSHAKE = true;
+    public static final boolean START_HANDSHAKE = true;
+
+    /** A flag used to determinate if the handshake should wait for the client to initiate the handshake */
+    public static final boolean CLIENT_HANDSHAKE = false;
 
     private boolean client;
 
@@ -173,7 +176,8 @@ public class SslFilter extends IoFilterAdapter {
 
     /**
      * Creates a new SSL filter using the specified {@link SSLContext}.
-     * The handshake will start immediately.
+     * The handshake will start immediately after the filter has been added
+     * to the chain.
      * 
      * @param sslContext The SSLContext to use
      */
@@ -184,7 +188,8 @@ public class SslFilter extends IoFilterAdapter {
     /**
      * Creates a new SSL filter using the specified {@link SSLContext}.
      * If the <tt>autostart</tt> flag is set to <tt>true</tt>, the
-     * handshake will start immediately.
+     * handshake will start immediately after the filter has been added
+     * to the chain.
      * 
      * @param sslContext The SSLContext to use
      * @param autoStart The flag used to tell the filter to start the handshake immediately


[6/6] mina git commit: Turned a 'for(; ; )' loop into a while with a condition.

Posted by el...@apache.org.
Turned a 'for(;;)' loop into a while with a condition.

Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/5d8b27b0
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/5d8b27b0
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/5d8b27b0

Branch: refs/heads/2.0
Commit: 5d8b27b0bdec16605f870c599b28d3d606776b83
Parents: 11ec332
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Mon Apr 2 10:22:47 2018 +0200
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Mon Apr 2 10:22:47 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/mina/filter/ssl/SslHandler.java   | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/5d8b27b0/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
index 72bf0e6..28917d3 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
@@ -592,15 +592,13 @@ class SslHandler {
                 SSLEngineResult result;
                 createOutNetBuffer(0);
 
-                for (;;) {
+                result = sslEngine.wrap(emptyBuffer.buf(), outNetBuffer.buf());
+
+                while ( result.getStatus() == SSLEngineResult.Status.BUFFER_OVERFLOW ) {
+                    outNetBuffer.capacity(outNetBuffer.capacity() << 1);
+                    outNetBuffer.limit(outNetBuffer.capacity());
+
                     result = sslEngine.wrap(emptyBuffer.buf(), outNetBuffer.buf());
-                    
-                    if (result.getStatus() == SSLEngineResult.Status.BUFFER_OVERFLOW) {
-                        outNetBuffer.capacity(outNetBuffer.capacity() << 1);
-                        outNetBuffer.limit(outNetBuffer.capacity());
-                    } else {
-                        break;
-                    }
                 }
 
                 outNetBuffer.flip();


[4/6] mina git commit: Don't call the SSLEngine.beginHandshake(). This is useless, if the NOT_HANDSHAKING state is properly handled by the handshake() method.

Posted by el...@apache.org.
Don't call the SSLEngine.beginHandshake(). This is useless, if
the NOT_HANDSHAKING state is properly handled by the handshake()
method.

Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/f617acca
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/f617acca
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/f617acca

Branch: refs/heads/2.0
Commit: f617accadce9cb60fdfa12ccb23d7e4df8c1a2ef
Parents: 7c4dc7b
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Sat Mar 31 09:43:29 2018 +0200
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Sat Mar 31 09:43:29 2018 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/mina/filter/ssl/SslHandler.java     | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/f617acca/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
index a0d29b7..72bf0e6 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
@@ -181,8 +181,6 @@ class SslHandler {
 
         // TODO : we may not need to call this method...
         // However, if we don't call it here, the tests are failing. Why?
-        sslEngine.beginHandshake();
-
         handshakeStatus = sslEngine.getHandshakeStatus();
 
         // Default value
@@ -531,7 +529,6 @@ class SslHandler {
         for (;;) {
             switch (handshakeStatus) {
             case FINISHED:
-            case NOT_HANDSHAKING:
                 if (LOGGER.isDebugEnabled()) {
                     LOGGER.debug("{} processing the FINISHED state", sslFilter.getSessionInfo(session));
                 }
@@ -580,6 +577,7 @@ class SslHandler {
                 break;
 
             case NEED_WRAP:
+            case NOT_HANDSHAKING:
                 if (LOGGER.isDebugEnabled()) {
                     LOGGER.debug("{} processing the NEED_WRAP state", sslFilter.getSessionInfo(session));
                 }


[5/6] mina git commit: Merge branch '2.0' of https://git-wip-us.apache.org/repos/asf/mina into 2.0

Posted by el...@apache.org.
Merge branch '2.0' of https://git-wip-us.apache.org/repos/asf/mina into 2.0


Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/11ec3326
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/11ec3326
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/11ec3326

Branch: refs/heads/2.0
Commit: 11ec33265678f3c3d0bc13f5033309f61f5fc87e
Parents: f617acc a197078
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Sat Mar 31 09:43:55 2018 +0200
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Sat Mar 31 09:43:55 2018 +0200

----------------------------------------------------------------------
 .../org/apache/mina/http/api/HttpMethod.java    | 22 ++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[2/6] mina git commit: Added a check to avoid a potential NPE

Posted by el...@apache.org.
Added a check to avoid a potential NPE

Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/1ee000d2
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/1ee000d2
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/1ee000d2

Branch: refs/heads/2.0
Commit: 1ee000d22e4acf3c53f8364600d3e8780ee5c9a2
Parents: 5eba67d
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Sat Mar 31 09:37:01 2018 +0200
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Sat Mar 31 09:37:01 2018 +0200

----------------------------------------------------------------------
 .../mina/core/filterchain/DefaultIoFilterChainBuilder.java       | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/1ee000d2/mina-core/src/main/java/org/apache/mina/core/filterchain/DefaultIoFilterChainBuilder.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/filterchain/DefaultIoFilterChainBuilder.java b/mina-core/src/main/java/org/apache/mina/core/filterchain/DefaultIoFilterChainBuilder.java
index bbf3f9e..55b81af 100644
--- a/mina-core/src/main/java/org/apache/mina/core/filterchain/DefaultIoFilterChainBuilder.java
+++ b/mina-core/src/main/java/org/apache/mina/core/filterchain/DefaultIoFilterChainBuilder.java
@@ -451,6 +451,10 @@ public class DefaultIoFilterChainBuilder implements IoFilterChainBuilder {
 
     @SuppressWarnings("unchecked")
     private boolean isOrderedMap(Map<String,? extends IoFilter> map) {
+        if (map == null) {
+            return false;
+        }
+        
         Class<?> mapType = map.getClass();
         
         if (LinkedHashMap.class.isAssignableFrom(mapType)) {