You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2020/11/17 09:09:35 UTC

[directory-ldap-api] branch master updated (ef1e2af -> ee02049)

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

elecharny pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git.


    from ef1e2af  Updating Commons Pool to 2.8.1
     new 8d16cfe  Patch for DIRAPI-364
     new c037f94  Patch for DIRAPI-358
     new ee02049  Bumped up dependencies and plugins

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:
 .../api/dsmlv2/response/BindResponseDsml.java      | 15 +++-
 .../ldap/client/api/LdapNetworkConnection.java     | 88 +++++++++++++---------
 pom.xml                                            | 14 ++--
 3 files changed, 74 insertions(+), 43 deletions(-)


[directory-ldap-api] 02/03: Patch for DIRAPI-358

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git

commit c037f94331a5f0213e9a321797d390e0f8d89ab2
Author: emmanuel lecharny <em...@busit.com>
AuthorDate: Tue Nov 17 10:09:09 2020 +0100

    Patch for DIRAPI-358
---
 .../ldap/client/api/LdapNetworkConnection.java     | 88 +++++++++++++---------
 1 file changed, 53 insertions(+), 35 deletions(-)

diff --git a/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java b/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
index a3969c8..a7f2f6b 100644
--- a/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
+++ b/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
@@ -702,6 +702,11 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements Lda
             // It may be an exception, or a timeout
             Throwable connectionException = connectionFuture.getException();
 
+            if ( ( connector != null ) && !connector.isDisposing() && !connector.isDisposed() )
+            { 
+                connector.dispose();
+            }
+
             connector = null;
 
             if ( connectionException == null )
@@ -943,46 +948,59 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements Lda
             return true;
         }
         
-        // Create the connector if needed
-        if ( connector == null )
-        {
-            createConnector();
-        }
-
-        // And create the connection future
-        ConnectFuture connectionFuture = tryConnect();
-
-        // Check if we are good to go
-        if ( !connectionFuture.isConnected() )
+        try
         {
-            // Release the latch
-            connectionCloseFuture.cancel( true );
+            // Create the connector if needed
+            if ( connector == null )
+            {
+                createConnector();
+            }
+    
+            // And create the connection future
+            ConnectFuture connectionFuture = tryConnect();
+    
+            // Check if we are good to go
+            if ( !connectionFuture.isConnected() )
+            {
+                // Release the latch
+                connectionCloseFuture.cancel( true );
+                
+                close( connectionFuture );
+            }
+    
+            // Check if we are secured if requested
+            if ( config.isUseSsl() )
+            {
+                checkSecured( connectionFuture );
+            }
+    
+            // Add a listener to close the session in the session.
+            setCloseListener( connectionFuture );
+    
+            // Get back the session
+            ioSession = connectionFuture.getSession();
+    
+            // Store the container into the session if we don't have one
+            setBinaryDetector();
+    
+            // Initialize the MessageId
+            messageId.set( 0 );
             
-            close( connectionFuture );
+            connectionCloseFuture = new CompletableFuture<>();
+    
+            // And return
+            return true;
         }
-
-        // Check if we are secured if requested
-        if ( config.isUseSsl() )
+        catch ( Exception e )
         {
-            checkSecured( connectionFuture );
-        }
-
-        // Add a listener to close the session in the session.
-        setCloseListener( connectionFuture );
-
-        // Get back the session
-        ioSession = connectionFuture.getSession();
-
-        // Store the container into the session if we don't have one
-        setBinaryDetector();
-
-        // Initialize the MessageId
-        messageId.set( 0 );
-        
-        connectionCloseFuture = new CompletableFuture<>();
+            if ( ( connector != null ) && !connector.isDisposing() && !connector.isDisposed() ) 
+            {
+                connector.dispose();
+                connector = null;
+            }
 
-        // And return
-        return true;
+            throw e;
+        }
     }
 
 


[directory-ldap-api] 03/03: Bumped up dependencies and plugins

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git

commit ee0204902dccd24338fed1314196adf159d6f46a
Author: emmanuel lecharny <em...@busit.com>
AuthorDate: Tue Nov 17 10:09:26 2020 +0100

    Bumped up dependencies and plugins
---
 pom.xml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index d779497..0970329 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,15 +56,15 @@
     
     <!-- Set versions for depending jars -->
     <antlr.version>2.7.7</antlr.version>
-    <commons.codec.version>1.14</commons.codec.version>
+    <commons.codec.version>1.15</commons.codec.version>
     <commons.collections.version>4.4</commons.collections.version>
-    <commons.lang.version>3.9</commons.lang.version>
-    <commons.pool.version>2.8.1</commons.pool.version>
+    <commons.lang.version>3.11</commons.lang.version>
+    <commons.pool.version>2.9.0</commons.pool.version>
     <dom4j.version>2.1.3</dom4j.version>
     <forbiddenapis.version>2.6</forbiddenapis.version>
     <hamcrest.version>2.2</hamcrest.version>
-    <junit.engine.version>5.6.0</junit.engine.version>
-    <junit.platform.version>1.6.0</junit.platform.version>
+    <junit.engine.version>5.7.0</junit.engine.version>
+    <junit.platform.version>1.7.0</junit.platform.version>
     <log4j.version>1.2.17</log4j.version>
     <logback.version>1.3.0-alpha5</logback.version>
     <mina.core.version>2.1.3</mina.core.version>
@@ -76,8 +76,8 @@
     <slf4j.api.bundleversion>"$«range;[==,=+)»"</slf4j.api.bundleversion>
     <slf4j.log4j12.version>1.7.26</slf4j.log4j12.version>
     <velocity.version>1.5</velocity.version>
-    <wagon.ssh.version>3.3.4</wagon.ssh.version>
-    <wagon.ssh.external.version>3.3.4</wagon.ssh.external.version>
+    <wagon.ssh.version>3.4.0</wagon.ssh.version>
+    <wagon.ssh.external.version>3.4.0</wagon.ssh.external.version>
     <xml.apis.version>2.0.2</xml.apis.version>
     <xpp3.version>1.1.4c</xpp3.version>
   </properties>


[directory-ldap-api] 01/03: Patch for DIRAPI-364

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git

commit 8d16cfef572b6b223fd417405475f9021a5a49eb
Author: emmanuel lecharny <em...@busit.com>
AuthorDate: Tue Nov 17 10:08:33 2020 +0100

    Patch for DIRAPI-364
---
 .../directory/api/dsmlv2/response/BindResponseDsml.java   | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/BindResponseDsml.java b/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/BindResponseDsml.java
index ca3106c..43c6fa2 100644
--- a/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/BindResponseDsml.java
+++ b/dsml/parser/src/main/java/org/apache/directory/api/dsmlv2/response/BindResponseDsml.java
@@ -24,6 +24,7 @@ import org.apache.directory.api.ldap.codec.api.LdapApiService;
 import org.apache.directory.api.ldap.model.message.BindResponse;
 import org.apache.directory.api.ldap.model.message.BindResponseImpl;
 import org.dom4j.Element;
+import org.dom4j.tree.DefaultElement;
 
 
 /**
@@ -33,6 +34,8 @@ import org.dom4j.Element;
  */
 public class BindResponseDsml extends AbstractResultResponseDsml<BindResponse> implements BindResponse
 {
+    private static final String AUTH_RESPONSE_TAG = "authResponse";
+
     /**
      * Creates a new getDecoratedMessage() of AuthResponseDsml.
      * 
@@ -62,7 +65,17 @@ public class BindResponseDsml extends AbstractResultResponseDsml<BindResponse> i
     @Override
     public Element toDsml( Element root )
     {
-        Element element = root.addElement( "authResponse" );
+        Element element;
+
+        if ( root != null )
+        {
+            element = root.addElement( AUTH_RESPONSE_TAG );
+        }
+        else
+        {
+            element = new DefaultElement( AUTH_RESPONSE_TAG );
+        }
+
 
         LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(),
             getDecorated().getLdapResult(), getDecorated() );