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

Matthew Swift
26.44.2013 1f2f46fa65db97b476f588e9f92d19d447b1b6ea
opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java
@@ -623,20 +623,22 @@
            }
        }
        // Now try cleanly closing the connection if possible.
        // Only send unbind if specified.
        /*
         * Now try cleanly closing the connection if possible. Only send unbind
         * if specified.
         */
        if (unbindRequest != null) {
            final ASN1BufferWriter asn1Writer = ASN1BufferWriter.getWriter();
            try {
                final ASN1BufferWriter asn1Writer = ASN1BufferWriter.getWriter();
                try {
                    ldapWriter
                            .unbindRequest(asn1Writer, nextMsgID.getAndIncrement(), unbindRequest);
                    connection.write(asn1Writer.getBuffer(), null);
                } finally {
                    asn1Writer.recycle();
                }
            } catch (final IOException e) {
                // Underlying channel prob blown up. Just ignore.
                ldapWriter.unbindRequest(asn1Writer, nextMsgID.getAndIncrement(), unbindRequest);
                connection.write(asn1Writer.getBuffer(), null);
            } catch (final Exception ignore) {
                /*
                 * Underlying channel probably blown up. Ignore all errors,
                 * including possibly runtime exceptions (see OPENDJ-672).
                 */
            } finally {
                asn1Writer.recycle();
            }
        }
        factory.getTimeoutChecker().removeConnection(this);