From 44bb9464360ae859c5ec10772081eb111e5b87e7 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Fri, 22 Jul 2005 05:33:47 +0000 Subject: [PATCH] More use of SLAPI accessor macros --- servers/slapd/slap.h | 5 ----- servers/slapd/slapi/slapi.h | 9 ++++++--- servers/slapd/slapi/slapi_ext.c | 6 +++--- servers/slapd/slapi/slapi_ops.c | 5 +++-- servers/slapd/slapi/slapi_overlay.c | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index c55b5c7d12..76f22039ee 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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 */ diff --git a/servers/slapd/slapi/slapi.h b/servers/slapd/slapi/slapi.h index b6061610fd..baa14b605e 100644 --- a/servers/slapd/slapi/slapi.h +++ b/servers/slapd/slapi/slapi.h @@ -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 diff --git a/servers/slapd/slapi/slapi_ext.c b/servers/slapd/slapi/slapi_ext.c index 7fa826ff63..ec287f24da 100644 --- a/servers/slapd/slapi/slapi_ext.c +++ b/servers/slapd/slapi/slapi_ext.c @@ -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: diff --git a/servers/slapd/slapi/slapi_ops.c b/servers/slapd/slapi/slapi_ops.c index 4e7e55b4c4..b29d0d5327 100644 --- a/servers/slapd/slapi/slapi_ops.c +++ b/servers/slapd/slapi/slapi_ops.c @@ -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; diff --git a/servers/slapd/slapi/slapi_overlay.c b/servers/slapd/slapi/slapi_overlay.c index 859dd006d7..3d6fd51971 100644 --- a/servers/slapd/slapi/slapi_overlay.c +++ b/servers/slapd/slapi/slapi_overlay.c @@ -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; }