directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r797955 - /directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Date Sun, 26 Jul 2009 17:04:08 GMT
Author: kayyagari
Date: Sun Jul 26 17:04:07 2009
New Revision: 797955

URL: http://svn.apache.org/viewvc?rev=797955&view=rev
Log:
fixed handling of OID of a failed extended operation's response

Modified:
    directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java

Modified: directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java?rev=797955&r1=797954&r2=797955&view=diff
==============================================================================
--- directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
(original)
+++ directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Sun Jul 26 17:04:07 2009
@@ -43,6 +43,8 @@
 import javax.net.ssl.SSLContext;
 
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
+import org.apache.directory.shared.asn1.codec.DecoderException;
+import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.ldap.client.api.exception.InvalidConnectionException;
 import org.apache.directory.shared.ldap.client.api.exception.LdapException;
 import org.apache.directory.shared.ldap.client.api.listeners.AddListener;
@@ -2414,6 +2416,21 @@
     {
         ExtendedResponse extResponse = new ExtendedResponse();
         
+        OID oid = null;
+        try
+        {
+            if( extRespCodec.getResponseName() != null )
+            {
+                oid = new OID( extRespCodec.getResponseName() );
+            }
+        }
+        catch( DecoderException e )
+        {
+            // can happen in case of a PROTOCOL_ERROR result, ignore 
+            //LOG.error( "invalid response name {}", extRespCodec.getResponseName() );
+        }
+        
+        extResponse.setOid( oid );
         extResponse.setValue( extRespCodec.getResponse() );
         extResponse.setMessageId( extRespCodec.getMessageId() );
         extResponse.setLdapResult( convert( extRespCodec.getLdapResult() ) );



Mime
View raw message