directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r348443 - /directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java
Date Wed, 23 Nov 2005 14:06:19 GMT
Author: elecharny
Date: Wed Nov 23 06:06:15 2005
New Revision: 348443

URL: http://svn.apache.org/viewcvs?rev=348443&view=rev
Log:
Added a log when the OID is incorrect.

Modified:
    directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java

Modified: directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java?rev=348443&r1=348442&r2=348443&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/main/java/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java
Wed Nov 23 06:06:15 2005
@@ -192,11 +192,20 @@
                         else
                         {
                         	// The OID is encoded as a String, not an Object Id
+                        	try
+                        	{
+                        		new OID( StringUtils.toUtf8( tlv.getValue().getData() ) );
+                        	}
+                        	catch ( DecoderException de )
+                        	{
+                                log.error("The control type " + StringUtils.dumpBytes( tlv.getValue().getData()
) + 
+                                        " is not a valid OID : " + de.getMessage() );
+                            
+                                throw de;
+                        	}
+                        	
                         	try 
                         	{
-                        		String oidString = StringUtils.toUtf8( tlv.getValue().getData()
);
-                        		
-                        		OID oid = new OID( oidString );
                         		control.setControlType( new LdapString( tlv.getValue().getData()
) );
                         	}
                         	catch ( LdapStringEncodingException lsee )
@@ -205,7 +214,6 @@
                                         " is invalid : " + lsee.getMessage() );
                             
                                 throw new DecoderException( lsee.getMessage() );
-
                         	}
                         }
                         



Mime
View raw message