From bdb54bc45ce05fcb01e106a8e9b52db188579efd Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 25 Nov 2009 10:05:23 +0000
Subject: [PATCH] Fix issue 4360 - OpenDS does not answer anymore when doing 24+ simultaneous subtree searches without reading the response.

---
 opends/src/server/org/opends/server/extensions/SASLByteChannel.java |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/SASLByteChannel.java b/opends/src/server/org/opends/server/extensions/SASLByteChannel.java
index 7348209..6159f49 100644
--- a/opends/src/server/org/opends/server/extensions/SASLByteChannel.java
+++ b/opends/src/server/org/opends/server/extensions/SASLByteChannel.java
@@ -31,10 +31,8 @@
 import java.security.cert.Certificate;
 import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.nio.channels.ClosedChannelException;
 import javax.security.sasl.Sasl;
 import org.opends.server.api.ClientConnection;
-import org.opends.server.util.StaticUtils;
 
 /**
  * This class implements a SASL byte channel that can be used during
@@ -310,14 +308,7 @@
      *         to the socket channel, or, {@code false} if not.
      */
     private int writeChannel(ByteBuffer buffer) throws IOException {
-        int bytesWritten = channel.write(buffer);
-        if (bytesWritten < 0)
-            throw new ClosedChannelException();
-        else if (bytesWritten == 0) {
-            if(!StaticUtils.writeWithTimeout(connection, buffer))
-                throw new ClosedChannelException();
-        }
-        return bytesWritten;
+        return channel.write(buffer);
       }
 
     /**

--
Gitblit v1.10.0