for ( Control control : req.getControls().values() )
{
if ( control.isCritical() && ! ldapServer.getSupportedControls().contains( control.getOid() ) )
{
InternalResultResponse resp = req.getResultResponse();
resp.getLdapResult().setErrorMessage( "Unsupport critical control: " + control.getOid() );
resp.getLdapResult().setResultCode( ResultCodeEnum.UNAVAILABLE_CRITICAL_EXTENSION );
session.write( resp );
return;
}
}
}