]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Move op counting to operation_init
authorOndřej Kuzník <okuznik@symas.com>
Wed, 14 Feb 2018 15:43:16 +0000 (15:43 +0000)
committerOndřej Kuzník <okuznik@symas.com>
Tue, 17 Nov 2020 17:58:14 +0000 (17:58 +0000)
servers/lloadd/client.c
servers/lloadd/operation.c

index 1044341c615a315fe221f7f8dca7c1993a25c7bb..5874b8860eafe92f5c745976f742baa08e2c9c11 100644 (file)
@@ -213,7 +213,6 @@ handle_one_request( LloadConnection *c )
 
     switch ( op->o_tag ) {
         case LDAP_REQ_UNBIND:
-            lload_stats.counters[LLOAD_STATS_OPS_OTHER].lc_ops_received++;
             /* There is never a response for this operation */
             op->o_res = LLOAD_OP_COMPLETED;
             operation_destroy_from_client( op );
@@ -223,17 +222,14 @@ handle_one_request( LloadConnection *c )
             CONNECTION_DESTROY(c);
             return -1;
         case LDAP_REQ_BIND:
-            lload_stats.counters[LLOAD_STATS_OPS_BIND].lc_ops_received++;
             handler = request_bind;
             break;
         case LDAP_REQ_ABANDON:
-            lload_stats.counters[LLOAD_STATS_OPS_OTHER].lc_ops_received++;
             /* We can't send a response to abandon requests even if a bind is
              * currently in progress */
             handler = request_abandon;
             break;
         case LDAP_REQ_EXTENDED:
-            lload_stats.counters[LLOAD_STATS_OPS_OTHER].lc_ops_received++;
             handler = request_extended;
             break;
         default:
@@ -241,7 +237,6 @@ handle_one_request( LloadConnection *c )
                 return operation_send_reject_locked(
                         op, LDAP_PROTOCOL_ERROR, "bind in progress", 0 );
             }
-            lload_stats.counters[LLOAD_STATS_OPS_OTHER].lc_ops_received++;
             handler = request_process;
             break;
     }
index 54b8667afecd4f21fdad6946c32b86ab8d9d0d42..40204d2ba81bbd55caee81f02c7f97f50de4851e 100644 (file)
@@ -526,6 +526,15 @@ operation_init( LloadConnection *c, BerElement *ber )
         ber_skip_element( ber, &op->o_ctrls );
     }
 
+    switch ( op->o_tag ) {
+        case LDAP_REQ_BIND:
+            lload_stats.counters[LLOAD_STATS_OPS_BIND].lc_ops_received++;
+            break;
+        default:
+            lload_stats.counters[LLOAD_STATS_OPS_OTHER].lc_ops_received++;
+            break;
+    }
+
     Debug( LDAP_DEBUG_STATS, "operation_init: "
             "received a new operation, %s with msgid=%d for client "
             "connid=%lu\n",