From 6a6a18307477865c3f6c99158bf91d4816a0bc2b Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 11 Jul 2007 19:50:27 +0000
Subject: [PATCH] Update the bind processing code so that the ClientConnection.bindInProgress flag will not be unset between stages of a multi-stage SASL bind.

---
 opends/src/server/org/opends/server/core/BindOperationBasis.java |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/BindOperationBasis.java b/opends/src/server/org/opends/server/core/BindOperationBasis.java
index 541d04a..72f04e8 100644
--- a/opends/src/server/org/opends/server/core/BindOperationBasis.java
+++ b/opends/src/server/org/opends/server/core/BindOperationBasis.java
@@ -827,6 +827,7 @@
 
         logBindRequest(this);
         logBindResponse(this);
+        clientConnection.setBindInProgress(false);
         return;
       }
       else if (preParseResult.sendResponseImmediately())
@@ -884,14 +885,16 @@
       setProcessingStopTime();
       logBindResponse(this);
       invokePostResponsePlugins();
+      clientConnection.setBindInProgress(false);
       return;
     }
 
-    // Unset the "bind in progress" flag to allow other operations to be
-    // processed.
-    // FIXME -- Make sure this also gets unset at every possible point at which
-    // the bind could fail and this method could return early.
-    clientConnection.setBindInProgress(false);
+    // If the bind processing is finished, then unset the "bind in progress"
+    // flag to allow other operations to be processed on the connection.
+    if (getResultCode() != ResultCode.SASL_BIND_IN_PROGRESS)
+    {
+      clientConnection.setBindInProgress(false);
+    }
 
     // Stop the processing timer.
     setProcessingStopTime();

--
Gitblit v1.10.0