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

Matthew Swift
06.15.2011 d44745cf3a55bf943670fe8b262874bcc414ca34
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java
@@ -1587,9 +1587,25 @@
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message m =
        ERR_LDAP_CLIENT_DECODE_LDAP_MESSAGE_FAILED.get(String.valueOf(e));
      disconnect(DisconnectReason.PROTOCOL_ERROR, true, m);
      if (asn1Reader.hasRemainingData())
      {
        // The connection failed, but there was an unread partial message so
        // interpret this as an IO error.
        Message m = ERR_LDAP_CLIENT_IO_ERROR_DURING_READ.get(String
            .valueOf(e));
        disconnect(DisconnectReason.IO_ERROR, true, m);
      }
      else
      {
        // The connection failed and there was no unread data, so interpret this
        // as indicating that the client aborted (reset) the connection. This
        // happens when a client configures closes a connection which has been
        // configured with SO_LINGER set to 0.
        Message m = ERR_LDAP_CLIENT_IO_ERROR_BEFORE_READ.get();
        disconnect(DisconnectReason.CLIENT_DISCONNECT, true, m);
      }
      return -1;
    }
  }