Skip to content
Snippets Groups Projects
Commit 48d1046a authored by Luke Howard's avatar Luke Howard
Browse files

Make slapi_pblock directly overlaid on operation/connection/slapreply

structures

This removes a lot of copying. It's still a bit tricky where the internal
slapd data types are different to those exposed via SLAPI (eg. modifications)
or the internal values are not allocated on the heap (eg. controls). Some
copying is necessary in these cases.
parent 7fade0d5
Branches
Tags
No related merge requests found
......@@ -26,11 +26,10 @@
LDAP_BEGIN_DECL
/* slapi_utils.c */
LDAP_SLAPI_F (int) slapi_int_pblock_set_operation LDAP_P(( Slapi_PBlock *pb, Operation *op ));
LDAP_SLAPI_F (LDAPMod **) slapi_int_modifications2ldapmods LDAP_P((Modifications **));
LDAP_SLAPI_F (Modifications *) slapi_int_ldapmods2modifications LDAP_P((LDAPMod **));
LDAP_SLAPI_F (void) slapi_int_free_ldapmods LDAP_P((LDAPMod **));
LDAP_SLAPI_F (LDAPMod **) slapi_int_modifications2ldapmods LDAP_P(( Modifications **, void *ctx ));
LDAP_SLAPI_F (Modifications *) slapi_int_ldapmods2modifications LDAP_P(( LDAPMod **, void *ctx ));
LDAP_SLAPI_F (void) slapi_int_free_ldapmods LDAP_P(( LDAPMod ** ));
LDAP_SLAPI_F (int) slapi_int_count_controls LDAP_P(( LDAPControl **ctrls ));
LDAP_SLAPI_F (int) slapi_int_access_allowed LDAP_P((Operation *op,
Entry *entry,
......@@ -42,18 +41,32 @@ LDAP_SLAPI_F (int) slapi_int_access_allowed LDAP_P((Operation *op,
LDAP_SLAPI_F (char **) slapi_get_supported_extended_ops LDAP_P((void));
/* slapi_ops.c */
LDAP_SLAPI_F (int) slapi_int_connection_init LDAP_P((Slapi_PBlock *pb, int OpType, Connection **pConn));
LDAP_SLAPI_F (void) slapi_int_connection_destroy LDAP_P(( Connection **pConn ));
LDAP_SLAPI_F (int) slapi_int_response LDAP_P(( Slapi_Operation *op, SlapReply *rs ));
LDAP_SLAPI_F (void) slapi_int_connection_init_pb LDAP_P(( Slapi_PBlock *pb, ber_tag_t OpType ));
LDAP_SLAPI_F (void) slapi_int_connection_done_pb LDAP_P(( Slapi_PBlock *pb ));
/* slapi_pblock.c */
LDAP_SLAPI_F (void) slapi_pblock_check_params LDAP_P(( Slapi_PBlock *pb, int flag ));
LDAP_SLAPI_F (int) slapi_pblock_delete_param LDAP_P(( Slapi_PBlock *p, int param ));
LDAP_SLAPI_F (void) slapi_pblock_clear LDAP_P(( Slapi_PBlock *pb ));
LDAP_SLAPI_F (void) slapi_int_mods_free( Modifications *ml );
LDAP_SLAPI_F (int) slapi_int_pblock_get_first LDAP_P(( Backend *be, Slapi_PBlock **pb ));
LDAP_SLAPI_F (int) slapi_int_pblock_get_next LDAP_P(( Slapi_PBlock **pb ));
#define PBLOCK_ASSERT_OP( _pb, _tag ) do { \
assert( (_pb) != NULL ); \
assert( (_pb)->pop != NULL ); \
assert( (_pb)->pconn != NULL ); \
if ( _tag != 0 ) \
assert( (_pb)->pop->o_tag == (_tag)); \
} while (0)
#define PBLOCK_ASSERT_INTOP( _pb, _tag ) do { \
PBLOCK_ASSERT_OP( _pb, _tag ); \
assert( (_pb)->internal_op ); \
assert( pb->pop == (Operation *)pb->pconn->c_pending_ops.stqh_first ); \
} while (0)
/* plugin.c */
LDAP_SLAPI_F (int) slapi_int_register_plugin LDAP_P((Backend *be, Slapi_PBlock *pPB));
LDAP_SLAPI_F (int) slapi_int_call_plugins LDAP_P((Backend *be, int funcType, Slapi_PBlock * pPB));
......
......@@ -112,6 +112,12 @@ struct slapi_pblock {
int numParams;
int curParams[PBLOCK_MAX_PARAMS];
void *curVals[PBLOCK_MAX_PARAMS];
/* native types */
Connection *pconn;
Operation *pop;
SlapReply rs;
int internal_op;
char textbuf[ SLAP_TEXT_BUFLEN ];
};
#endif /* !NO_PBLOCK_CLASS */
......@@ -122,14 +128,6 @@ struct slapi_pblock {
#define SLAPI_PLUGIN_IS_POST_FN(x) ((x) >= SLAPI_PLUGIN_POST_BIND_FN && (x) <= SLAPI_PLUGIN_BE_POST_DELETE_FN)
/* really private stuff */
#define SLAPI_X_CONFIG_ARGV 1400
#define SLAPI_X_INTOP_FLAGS 1401
#define SLAPI_X_INTOP_RESULT_CALLBACK 1402
#define SLAPI_X_INTOP_SEARCH_ENTRY_CALLBACK 1403
#define SLAPI_X_INTOP_REFERRAL_ENTRY_CALLBACK 1404
#define SLAPI_X_INTOP_CALLBACK_DATA 1405
#define SLAPI_OPERATION_PARAMETERS 138
#define SLAPI_PLUGIN_DB_TEST_FN 227
......@@ -170,6 +168,15 @@ struct slapi_pblock {
#define SLAPI_DBSIZE 199
/* really private stuff */
#define SLAPI_X_CONFIG_ARGV 1400
#define SLAPI_X_INTOP_FLAGS 1401
#define SLAPI_X_INTOP_RESULT_CALLBACK 1402
#define SLAPI_X_INTOP_SEARCH_ENTRY_CALLBACK 1403
#define SLAPI_X_INTOP_REFERRAL_ENTRY_CALLBACK 1404
#define SLAPI_X_INTOP_CALLBACK_DATA 1405
#define SLAPI_X_OLD_RESCONTROLS 1406
#define SLAPI_IBM_PBLOCK -3
LDAP_SLAPI_V (ldap_pvt_thread_mutex_t) slapi_hn_mutex;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment