]> git.sur5r.net Git - openldap/commitdiff
more slapi cleanup
authorLuke Howard <lukeh@openldap.org>
Sat, 23 Jul 2005 13:21:28 +0000 (13:21 +0000)
committerLuke Howard <lukeh@openldap.org>
Sat, 23 Jul 2005 13:21:28 +0000 (13:21 +0000)
servers/slapd/slapi/proto-slapi.h
servers/slapd/slapi/slapi_ops.c
servers/slapd/slapi/slapi_utils.c

index 83583ea8b93fa7a43d47fdb864d183b2aed5ca81..937374ca04912a1fea5b2883f8f2b5724e7071d4 100644 (file)
@@ -42,7 +42,7 @@ 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, SlapReply *rs, int OpType, Connection **pConn));
+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 ));
 
index b9c34195220a04c44df217432d242e08cbe5ebe5..5358064c48c49c287235d90e4ae63103d1ca8c03 100644 (file)
@@ -176,10 +176,11 @@ slapi_int_response( Slapi_Operation *op, SlapReply *rs )
 }
 
 static int
-slapi_int_get_ctrls( Operation *op, SlapReply *rs, LDAPControl **controls )
+slapi_int_get_ctrls( Operation *op, LDAPControl **controls )
 {
        LDAPControl             **c;
        int                     rc;
+       SlapReply               rs = { REP_RESULT };
 
        op->o_ctrls = controls;
        if ( op->o_ctrls == NULL ) {
@@ -187,7 +188,7 @@ slapi_int_get_ctrls( Operation *op, SlapReply *rs, LDAPControl **controls )
        }
 
        for ( c = op->o_ctrls; *c != NULL; c++ ) {
-               rc = slap_parse_ctrl( op, rs, *c, &rs->sr_text );
+               rc = slap_parse_ctrl( op, &rs, *c, &rs.sr_text );
                if ( rc != LDAP_SUCCESS )
                        break;
        }
@@ -259,7 +260,7 @@ slapi_int_pblock_get_connection( Slapi_PBlock *pb, Operation *op )
 }
 
 static int
-slapi_int_pblock_get_operation( Slapi_PBlock *pb, Operation *op, SlapReply *rs )
+slapi_int_pblock_get_operation( Slapi_PBlock *pb, Operation *op )
 {
        int                     isRoot = 0;
        int                     isUpdateDn = 0;
@@ -311,9 +312,9 @@ slapi_int_pblock_get_operation( Slapi_PBlock *pb, Operation *op, SlapReply *rs )
        }
 
        slapi_pblock_get( pb, SLAPI_REQCONTROLS, (void **)&controls );
-       rc = slapi_int_get_ctrls( op, rs, controls );
+       rc = slapi_int_get_ctrls( op, controls );
        if ( rc != LDAP_SUCCESS ) {
-               return rs->sr_err;
+               return rc;
        }
 
        return LDAP_SUCCESS;
@@ -321,7 +322,6 @@ slapi_int_pblock_get_operation( Slapi_PBlock *pb, Operation *op, SlapReply *rs )
 
 int
 slapi_int_connection_init( Slapi_PBlock *pb,
-       SlapReply *rs,
        int OpType,
        Connection **pConn )
 {
@@ -423,7 +423,7 @@ slapi_int_connection_init( Slapi_PBlock *pb,
        op->o_conn = conn;
        op->o_connid = conn->c_connid;
 
-       rc = slapi_int_pblock_get_operation( pb, op, rs );
+       rc = slapi_int_pblock_get_operation( pb, op );
 
        slapi_pblock_set( pb, SLAPI_OPERATION, op );
        slapi_pblock_set( pb, SLAPI_CONNECTION, conn );
@@ -483,7 +483,7 @@ slapi_delete_internal_pb( Slapi_PBlock *pb )
                return -1;
        }
 
-       rs.sr_err = slapi_int_connection_init( pb, &rs, LDAP_REQ_DELETE, &conn );
+       rs.sr_err = slapi_int_connection_init( pb, LDAP_REQ_DELETE, &conn );
        if ( rs.sr_err != LDAP_SUCCESS ) {
                slapi_pblock_set( pb, SLAPI_PLUGIN_INTOP_RESULT, (void *)rs.sr_err );
                return 0;
@@ -535,7 +535,7 @@ slapi_add_internal_pb( Slapi_PBlock *pb )
                goto cleanup;
        }
 
-       rs.sr_err = slapi_int_connection_init( pb, &rs, LDAP_REQ_ADD, &conn );
+       rs.sr_err = slapi_int_connection_init( pb, LDAP_REQ_ADD, &conn );
        if ( rs.sr_err != LDAP_SUCCESS ) {
                goto cleanup;
        }
@@ -625,7 +625,7 @@ slapi_modrdn_internal_pb( Slapi_PBlock *pb )
        slapi_pblock_get( pb, SLAPI_MODRDN_NEWSUPERIOR, (void **)&newsuperior );
        slapi_pblock_get( pb, SLAPI_MODRDN_DELOLDRDN,   (void **)&deloldrdn );
 
-       rs.sr_err = slapi_int_connection_init( pb, &rs, LDAP_REQ_MODRDN, &conn );
+       rs.sr_err = slapi_int_connection_init( pb, LDAP_REQ_MODRDN, &conn );
        if ( rs.sr_err != LDAP_SUCCESS ) {
                goto cleanup;
        }
@@ -707,7 +707,7 @@ slapi_modify_internal_pb( Slapi_PBlock *pb )
                goto cleanup;
        }
 
-       rs.sr_err = slapi_int_connection_init( pb, &rs, LDAP_REQ_MODIFY, &conn );
+       rs.sr_err = slapi_int_connection_init( pb, LDAP_REQ_MODIFY, &conn );
        if ( rs.sr_err != LDAP_SUCCESS ) {
                goto cleanup;
        }
@@ -832,7 +832,7 @@ slapi_search_internal_callback_pb( Slapi_PBlock *pb,
        slapi_pblock_get( pb, SLAPI_SEARCH_ATTRS,     (void **)&attrs );
        slapi_pblock_get( pb, SLAPI_SEARCH_ATTRSONLY, (void **)&attrsonly );
 
-       rs.sr_err = slapi_int_connection_init( pb, &rs, LDAP_REQ_SEARCH, &conn );
+       rs.sr_err = slapi_int_connection_init( pb, LDAP_REQ_SEARCH, &conn );
        if ( rs.sr_err != LDAP_SUCCESS ) {
                goto cleanup;
        }
index 40972a83fb087a14fee16e8b051c3ba1edd81720..0a32cafe17c031df806c1ff5e43709c4b8424b27 100644 (file)
@@ -538,13 +538,12 @@ slapi_entry_has_children(const Slapi_Entry *e)
        int hasSubordinates = 0;
        int rc;
        Slapi_PBlock *pb;
-       SlapReply rs = { REP_RESULT };
 
        pb = slapi_pblock_new();
 
        slapi_pblock_set( pb, SLAPI_TARGET_DN, slapi_entry_get_dn( (Entry *)e ) );
 
-       rc = slapi_int_connection_init( pb, &rs, LDAP_REQ_SEARCH, &conn );
+       rc = slapi_int_connection_init( pb, LDAP_REQ_SEARCH, &conn );
        if ( rc != LDAP_SUCCESS ) {
                slapi_pblock_destroy( pb );
                return 0;