]> git.sur5r.net Git - openldap/commitdiff
More use of SLAPI accessor macros
authorLuke Howard <lukeh@openldap.org>
Fri, 22 Jul 2005 05:33:47 +0000 (05:33 +0000)
committerLuke Howard <lukeh@openldap.org>
Fri, 22 Jul 2005 05:33:47 +0000 (05:33 +0000)
servers/slapd/slap.h
servers/slapd/slapi/slapi.h
servers/slapd/slapi/slapi_ext.c
servers/slapd/slapi/slapi_ops.c
servers/slapd/slapi/slapi_overlay.c

index c55b5c7d1287fa9f8117800a7a59c4419aacdf6a..76f22039ee94c3afe8c7017a592f72372c7ac079 100644 (file)
@@ -2317,11 +2317,6 @@ typedef struct slap_op {
 
 #define o_log_prefix o_hdr->oh_log_prefix
 
-#ifdef LDAP_SLAPI
-#define o_pb o_hdr->oh_pb
-#define o_extensions o_hdr->oh_extensions
-#endif
-
        ber_tag_t       o_tag;          /* tag of the request */
        time_t          o_time;         /* time op was initiated */
        int                     o_tincr;        /* counter for multiple ops with same o_time */
index b6061610fd22c6ffc364442d032afb50cb790118..baa14b605e8aa0caf8809c1619d024d20be5aa84 100644 (file)
@@ -55,9 +55,12 @@ typedef struct _Audit_record Audit_record;
 
 #define SLAPI_OVERLAY_NAME                     "slapi"
 
-#define SLAPI_OPERATION_PBLOCK(_op)            ((op)->o_pb)
-#define SLAPI_CONNECTION_PBLOCK(_conn)         ((conn)->c_pb);
-#define SLAPI_BACKEND_PBLOCK(_be)              ((be)->be_pb)
+#define SLAPI_OPERATION_PBLOCK(_op)            ((_op)->o_hdr->oh_pb)
+#define SLAPI_CONNECTION_PBLOCK(_conn)         ((_conn)->c_pb);
+#define SLAPI_BACKEND_PBLOCK(_be)              ((_be)->be_pb)
+
+#define SLAPI_OPERATION_EXTENSIONS(_op)                ((_op)->o_hdr->oh_extensions)
+#define SLAPI_CONNECTION_EXTENSIONS(_conn)     ((_conn)->c_extensions)
 
 #define SLAPI_CONTROL_MANAGEDSAIT_OID          LDAP_CONTROL_MANAGEDSAIT
 #define SLAPI_CONTROL_SORTEDSEARCH_OID         LDAP_CONTROL_SORTREQUEST
index 7fa826ff63033a89c31ea13106bbd9a1f30052e2..ec287f24da4d3b0eeca4a1b52a060809623e2f3a 100644 (file)
@@ -65,7 +65,7 @@ static int get_extension_block(int objecttype, void *object, struct slapi_extens
                *parent = NULL;
                break;  
        case SLAPI_X_EXT_OPERATION:
-               *eblock = ((Operation *)object)->o_extensions;
+               *eblock = ((Operation *)object)->o_hdr->oh_extensions;
                *parent = ((Operation *)object)->o_conn;
                break;  
        default:
@@ -247,7 +247,7 @@ int slapi_int_create_object_extensions(int objecttype, void *object)
                parent = NULL;
                break;  
        case SLAPI_X_EXT_OPERATION:
-               peblock = &(((Operation *)object)->o_extensions);
+               peblock = &(((Operation *)object)->o_hdr->oh_extensions);
                parent = ((Operation *)object)->o_conn;
                break;
        default:
@@ -300,7 +300,7 @@ int slapi_int_free_object_extensions(int objecttype, void *object)
                parent = NULL;
                break;  
        case SLAPI_X_EXT_OPERATION:
-               peblock = &(((Operation *)object)->o_extensions);
+               peblock = &(((Operation *)object)->o_hdr->oh_extensions);
                parent = ((Operation *)object)->o_conn;
                break;  
        default:
index 4e7e55b4c4408064ea26e48096cd7cb68da8ce35..b29d0d5327222dd64d0321536b24bbdd5aac18db 100644 (file)
@@ -309,9 +309,10 @@ slapi_int_init_connection( Slapi_PBlock *pb,
 
        op = (Operation *) slapi_ch_calloc( 1, OPERATION_BUFFER_SIZE );
        op->o_hdr = (Opheader *)(op + 1);
+       op->o_hdr->oh_pb = pb;
+       op->o_hdr->oh_extensions = NULL;
+
        op->o_controls = (void **)(op->o_hdr + 1);
-       op->o_pb = pb;
-       op->o_extensions = NULL;
 
        conn->c_pending_ops.stqh_first = op;
 
index 859dd006d71e7e793e04518e0f60a563e0153dc7..3d6fd51971c6b9649915ecad820f26339f7bd4d8 100644 (file)
@@ -657,7 +657,7 @@ slapi_op_func( Operation *op, SlapReply *rs )
         * We check for op->o_extensions to verify that we are not
         * processing a SLAPI internal operation. XXX
         */
-       if ( pb == NULL || op->o_extensions == NULL ) {
+       if ( pb == NULL || op->o_hdr->oh_extensions == NULL ) {
                return SLAP_CB_CONTINUE;
        }