From ede52c8f25aa2b7815e006cdfd6fe09f0766b548 Mon Sep 17 00:00:00 2001
From: Yannick Lecaillez <yannick.lecaillez@forgerock.com>
Date: Wed, 09 Nov 2016 14:54:10 +0000
Subject: [PATCH] OPENDJ-3179: Migrate LDAP Connection Handler to SDK Grizzly transport

---
 opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java
index f67783c..86c5b54 100644
--- a/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java
+++ b/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java
@@ -145,24 +145,24 @@
      *            The maximum BER element size, or <code>0</code> to indicate
      *            that there is no limit.
      * @param buffer
-     *            The buffer where the content will be read from.
+     *            The buffer where the content will be read from. Note that
+     *            @{code {@link #close()} this reader will also dispose the buffer.
      */
     ASN1BufferReader(final int maxElementSize, final Buffer buffer) {
         this.readLimiter = new RootSequenceLimiter();
         this.buffer = buffer;
-        this.buffer.allowBufferDispose(false);
         this.maxElementSize = maxElementSize;
     }
 
     /**
-     * Closes this ASN.1 reader and the underlying stream.
+     * Closes this ASN.1 reader and the underlying {@link Buffer}.
      *
      * @throws IOException
      *             if an I/O error occurs
      */
     @Override
     public void close() throws IOException {
-        // Nothing to do
+        buffer.tryDispose();
     }
 
     /**

--
Gitblit v1.10.0