From 79cc6e8df43fc7327d99fb6f3bc6f20c705acacd Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 12 Jul 2007 21:48:02 +0000
Subject: [PATCH] Update the LDAP connection handler so that an operation is removed from the "operations in progress" queue for the associated client connection immediately before the response is sent to the client. This can help avoid race conditions in which the client immediately re-uses the same message ID for the next synchronous request and it could be received while post-response processing is still in progress for that connection. Previously, this would have caused the new request to be rejected even though there was technically nothing wrong with what the client had done.
---
opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java b/opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java
index 92a5fed..41072fb 100644
--- a/opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java
+++ b/opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java
@@ -545,6 +545,13 @@
*/
public void sendResponse(Operation operation)
{
+ // Since this is the final response for this operation, we can go ahead and
+ // remove it from the "operations in progress" list. It can't be canceled
+ // after this point, and this will avoid potential race conditions in which
+ // the client immediately sends another request with the same message ID as
+ // was used for this operation.
+ removeOperationInProgress(operation.getMessageID());
+
LDAPMessage message = operationToResponseLDAPMessage(operation);
if (message != null)
{
--
Gitblit v1.10.0