]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slap.h
Vienna Bulk Commit
[openldap] / servers / slapd / slap.h
index dabf8c7bec159ad75ea5fe168e462bdab9e2c979..5b231775b1e1184cadab18493d300844dbe84fd1 100644 (file)
@@ -5,13 +5,10 @@
 
 #include <stdlib.h>
 
-#ifndef LDAP_SYSLOG
-#define LDAP_SYSLOG 1
-#endif
-
 #include <sys/types.h>
 #include <ac/syslog.h>
 #include <ac/regex.h>
+#include <ac/socket.h>                 /* needed by LDAP_CONNECTIONLESS */
 
 #include "avl.h"
 
@@ -22,7 +19,7 @@
 
 #include "ldap_log.h"
 
-#include "../../libraries/liblber/lber-int.h"
+#include "lber.h"
 #include "ldap.h"
 
 #include "ldap_pvt_thread.h"
@@ -253,6 +250,7 @@ struct backend_db {
 #define                be_modrdn       bd_info->bi_op_modrdn
 #define                be_search       bd_info->bi_op_search
 
+#define                be_release      bd_info->bi_entry_release_rw
 #define                be_group        bd_info->bi_acl_group
 
        /* these should be renamed from be_ to bd_ */
@@ -365,6 +363,7 @@ struct backend_info {
                int msgid));
 
        /* Auxilary Functions */
+       int     (*bi_entry_release_rw) LDAP_P((BackendDB *bd, Entry *e, int rw));
 #ifdef SLAPD_ACLGROUPS
        int     (*bi_acl_group)  LDAP_P((Backend *bd,
                Entry *e, char *bdn, char *edn,
@@ -414,25 +413,12 @@ typedef struct slap_op {
  * represents a connection from an ldap client
  */
 
-/* structure state (protected by connections_mutex) */
-#define SLAP_C_UNINITIALIZED   0x0     /* MUST BE ZERO (0) */
-#define SLAP_C_UNUSED                  0x1
-#define SLAP_C_USED                            0x2
-
-/* connection state (protected by c_mutex ) */
-#define SLAP_C_INVALID                 0x0     /* MUST BE ZERO (0) */
-#define SLAP_C_INACTIVE                        0x1     /* zero threads */
-#define SLAP_C_ACTIVE                  0x2 /* one or more threads */
-#define SLAP_C_BINDING                 0x3     /* binding */
-#define SLAP_C_CLOSING                 0x4     /* closing */
-
 typedef struct slap_conn {
        int                     c_struct_state; /* structure management state */
        int                     c_conn_state;   /* connection state */
 
        ldap_pvt_thread_mutex_t c_mutex; /* protect the connection */
-       Sockbuf         c_sb;           /* ber connection stuff           */
+       Sockbuf         *c_sb;                  /* ber connection stuff           */
 
        /* only can be changed by connect_init */
        time_t          c_starttime;    /* when the connection was opened */
@@ -459,22 +445,20 @@ typedef struct slap_conn {
        int             c_writewaiter;  /* true if writer is waiting */
 
        long    c_n_ops_received;               /* num of ops received (next op_id) */
-#ifdef LDAP_COUNTERS
        long    c_n_ops_executing;      /* num of ops currently executing */
        long    c_n_ops_pending;                /* num of ops pending execution */
        long    c_n_ops_completed;      /* num of ops completed */
-#endif
 } Connection;
 
 #if defined(LDAP_SYSLOG) && defined(LDAP_DEBUG)
 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \
-       { \
-               if ( ldap_debug & level ) \
-                       fprintf( stderr, fmt, connid, opid, arg1, arg2, arg3 );\
-               if ( ldap_syslog & level ) \
-                       syslog( ldap_syslog_level, fmt, connid, opid, arg1, \
-                           arg2, arg3 ); \
-       }
+       do { \
+               if ( ldap_debug & (level) ) \
+                       fprintf( stderr, (fmt), (connid), (opid), (arg1), (arg2), (arg3) );\
+               if ( ldap_syslog & (level) ) \
+                       syslog( ldap_syslog_level, (fmt), (connid), (opid), (arg1), \
+                               (arg2), (arg3) ); \
+       } while (0)
 #else
 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 )
 #endif