]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Reset connection state on abandon
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 11 Jul 2017 12:08:53 +0000 (13:08 +0100)
committerOndřej Kuzník <okuznik@symas.com>
Tue, 17 Nov 2020 17:55:46 +0000 (17:55 +0000)
servers/lloadd/operation.c
servers/lloadd/upstream.c

index f5a9b6a0152d73185dfc5612068507be73ac585b..6621b4845dc65f78970b82c040ab7a7ab0d5fd57 100644 (file)
@@ -541,6 +541,9 @@ operation_abandon( Operation *op )
         /* The operation has already been abandoned or finished */
         goto unlock;
     }
+    if ( c->c_state == SLAP_C_BINDING ) {
+        c->c_state = SLAP_C_READY;
+    }
     c->c_n_ops_executing--;
     b = (Backend *)c->c_private;
     CONNECTION_UNLOCK_INCREF(c);
@@ -586,6 +589,9 @@ done:
 
     /* Caller should hold a reference on client */
     CONNECTION_LOCK(c);
+    if ( c->c_state == SLAP_C_BINDING ) {
+        c->c_state = SLAP_C_READY;
+    }
     op->o_client_refcnt--;
     operation_destroy_from_client( op );
     CONNECTION_UNLOCK(c);
@@ -623,6 +629,13 @@ request_abandon( Connection *c, Operation *op )
             c->c_connid, op->o_client_msgid, slap_msgtype2str( request->o_tag ),
             needle.o_client_msgid );
 
+    if ( c->c_state == SLAP_C_BINDING ) {
+        /* We have found the request and we are binding, it must be a bind
+         * request */
+        assert( request->o_tag == LDAP_REQ_BIND );
+        c->c_state = SLAP_C_READY;
+    }
+
     CONNECTION_UNLOCK_INCREF(c);
     operation_abandon( request );
     CONNECTION_LOCK_DECREF(c);
index c6d8bc2c7a76ea619d48140398450ee1ce560fd2..70b0f0a7ce927131f1bf2c9dc1afaaf38fe11a39 100644 (file)
@@ -443,6 +443,9 @@ handle_one_response( Connection *c )
         CONNECTION_LOCK_DECREF(c);
         op->o_upstream_refcnt--;
         if ( !client || !op->o_upstream_refcnt ) {
+            if ( c->c_state == SLAP_C_BINDING ) {
+                c->c_state = SLAP_C_READY;
+            }
             operation_destroy_from_upstream( op );
         }
     } else {