Skip to content

Commit

Permalink
fix for DIRAPI-366
Browse files Browse the repository at this point in the history
  • Loading branch information
elecharny committed Feb 19, 2021
1 parent f7944a8 commit dcb5ab0
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -29,6 +29,7 @@
import org.apache.directory.api.ldap.codec.api.LdapMessageContainer;
import org.apache.directory.api.ldap.model.message.Control;
import org.apache.directory.api.ldap.model.message.Message;
import org.apache.directory.api.ldap.model.message.controls.OpaqueControl;
import org.apache.directory.api.util.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -78,7 +79,16 @@ public void action( LdapMessageContainer<Message> container ) throws DecoderExce
if ( tlv.getLength() >= 0 )
{
ControlFactory<?> factory = container.getControlFactory();
factory.decodeValue( control, value.getData() );

if ( factory == null )
{
// We don't know about this control, so it's an opaque control
( ( OpaqueControl ) control ).setEncodedValue( value.getData() );
}
else
{
factory.decodeValue( control, value.getData() );
}
}

// We can have an END transition
Expand Down

0 comments on commit dcb5ab0

Please sign in to comment.