mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

ludovicp
28.41.2010 8fbed892b4de6c50e977a5c76ac52c7cb3807a21
Fix for issue #4406. Server should sent a notice of disconnection and close connection when an exception occurs during protocol decode
1 files modified
25 ■■■■■ changed files
opends/src/server/org/opends/server/protocols/ldap/LDAPRequestHandler.java 25 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/ldap/LDAPRequestHandler.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 */
package org.opends.server.protocols.ldap;
@@ -50,10 +50,11 @@
import org.opends.server.loggers.ErrorLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1ByteChannelReader;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DisconnectReason;
import org.opends.server.types.InitializationException;
import org.opends.server.types.LDAPException;
/**
@@ -214,12 +215,32 @@
            }
          }
        }
        catch (ASN1Exception e)
        {
          if (debugEnabled())
          {
            TRACER.debugCaught(DebugLogLevel.ERROR, e);
          }
          readyConnection.disconnect(DisconnectReason.PROTOCOL_ERROR, true,
            e.getMessageObject());
        }
        catch (LDAPException e)
        {
          if (debugEnabled())
          {
            TRACER.debugCaught(DebugLogLevel.ERROR, e);
          }
          readyConnection.disconnect(DisconnectReason.PROTOCOL_ERROR, true,
            e.getMessageObject());
        }
        catch (Exception e)
        {
          if (debugEnabled())
          {
            TRACER.debugCaught(DebugLogLevel.ERROR, e);
          }
          readyConnection.disconnect(DisconnectReason.PROTOCOL_ERROR, true,
            Message.raw(e.toString()));
        }
      }