From 48ac4129c6b93fff96360e71f722c0447153dc06 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 05 Sep 2012 09:58:26 +0000
Subject: [PATCH] Fix OPENDJ-515: Upgrade OpenDJ SDK to Grizzly 2.2.x

---
 opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java |   33 ++++++++++-----------------------
 1 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java b/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java
index 3659b85..5cbe12c 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java
@@ -139,10 +139,8 @@
 
         if (pendingRequest == null) {
             // There has never been a request with the specified message ID or
-            // the
-            // response has already been received and handled. We can ignore
-            // this
-            // abandon request.
+            // the response has already been received and handled. We can ignore
+            // this abandon request.
 
             // Message ID will be -1 since no request was sent.
             return new CompletedFutureResult<Void>((Void) null);
@@ -280,8 +278,7 @@
             final ASN1BufferWriter asn1Writer = ASN1BufferWriter.getWriter();
             try {
                 // Use the bind client to get the initial request instead of
-                // using the
-                // bind request passed to this method.
+                // using the bind request passed to this method.
                 final GenericBindRequest initialRequest = context.nextBindRequest();
                 ldapWriter.bindRequest(asn1Writer, messageID, 3, initialRequest);
                 connection.write(asn1Writer.getBuffer(), null);
@@ -723,15 +720,11 @@
                 connectionInvalidReason = reason;
             } else {
                 // Connection termination was triggered remotely. We don't want
-                // to
-                // blindly pass on the result code to requests since it could be
-                // confused for a genuine response. For example, if the
-                // disconnect
-                // contained the invalidCredentials result code then this could
-                // be
-                // misinterpreted as a genuine authentication failure for
-                // subsequent
-                // bind requests.
+                // to blindly pass on the result code to requests since it could
+                // be confused for a genuine response. For example, if the
+                // disconnect contained the invalidCredentials result code then
+                // this could be misinterpreted as a genuine authentication
+                // failure for subsequent bind requests.
                 connectionInvalidReason =
                         Responses.newResult(ResultCode.CLIENT_SIDE_SERVER_DOWN)
                                 .setDiagnosticMessage("Connection closed by server");
@@ -762,12 +755,7 @@
                 // Underlying channel prob blown up. Just ignore.
             }
         }
-
-        try {
-            connection.close();
-        } catch (final IOException e) {
-            // Ignore.
-        }
+        connection.closeSilently();
 
         // Notify listeners.
         if (notifyClose) {
@@ -817,8 +805,7 @@
             int filterIndex = oldFilterChain.size() - 1;
             if (filter instanceof SSLFilter) {
                 // Beneath any ConnectionSecurityLayerFilters if present,
-                // otherwise
-                // beneath the LDAP filter.
+                // otherwise beneath the LDAP filter.
                 for (int i = oldFilterChain.size() - 2; i >= 0; i--) {
                     if (!(oldFilterChain.get(i) instanceof ConnectionSecurityLayerFilter)) {
                         filterIndex = i + 1;

--
Gitblit v1.10.0