]> git.sur5r.net Git - openldap/commitdiff
fix previous commit (ITS#3871)
authorPierangelo Masarati <ando@openldap.org>
Tue, 19 Jul 2005 14:25:10 +0000 (14:25 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 19 Jul 2005 14:25:10 +0000 (14:25 +0000)
servers/slapd/back-meta/add.c
servers/slapd/back-meta/delete.c
servers/slapd/back-meta/modify.c
servers/slapd/back-meta/modrdn.c

index 3cc3431d73df2106e20b6d78a19deb89256eec8e..9628cdd6ecd4739c1c0c11be478178764f38b8fb 100644 (file)
@@ -175,6 +175,7 @@ retry:;
        } else if ( rs->sr_err == LDAP_SUCCESS ) {
                struct timeval  tv, *tvp = NULL;
                LDAPMessage     *res = NULL;
+               int             rc;
 
                if ( mi->mi_targets[ candidate ].mt_timeout[ META_OP_ADD ] != 0 ) {
                        tv.tv_sec = mi->mi_targets[ candidate ].mt_timeout[ META_OP_ADD ];
@@ -182,11 +183,11 @@ retry:;
                        tvp = &tv;
                }
 
-               rs->sr_err = ldap_result( mc->mc_conns[ candidate ].msc_ld,
+               rs->sr_err = LDAP_OTHER;
+               rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
                        msgid, LDAP_MSG_ONE, tvp, &res );
-               switch ( rs->sr_err ) {
+               switch ( rc ) {
                case -1:
-                       rs->sr_err = LDAP_OTHER;
                        send_ldap_result( op, rs );
                        goto cleanup;
 
@@ -198,6 +199,14 @@ retry:;
                        send_ldap_result( op, rs );
                        goto cleanup;
 
+               case LDAP_RES_ADD:
+                       rc = ldap_parse_result( mc->mc_conns[ candidate ].msc_ld,
+                               res, &rs->sr_err, NULL, NULL, NULL, NULL, 1 );
+                       if ( rc != LDAP_SUCCESS ) {
+                               rs->sr_err = rc;
+                       }
+                       break;
+
                default:
                        ldap_msgfree( res );
                        break;
index 36a89cdadcdb77283e2f56fea19ab2399f804893..7c1463d60faf910fa4c6658310252e5520133f6b 100644 (file)
@@ -74,6 +74,7 @@ retry:;
        } else if ( rs->sr_err == LDAP_SUCCESS ) {
                struct timeval  tv, *tvp = NULL;
                LDAPMessage     *res = NULL;
+               int             rc;
 
                if ( mi->mi_targets[ candidate ].mt_timeout[ META_OP_DELETE ] != 0 ) {
                        tv.tv_sec = mi->mi_targets[ candidate ].mt_timeout[ META_OP_DELETE ];
@@ -81,9 +82,10 @@ retry:;
                        tvp = &tv;
                }
 
-               rs->sr_err = ldap_result( mc->mc_conns[ candidate ].msc_ld,
+               rs->sr_err = LDAP_OTHER;
+               rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
                        msgid, LDAP_MSG_ONE, tvp, &res );
-               switch ( rs->sr_err ) {
+               switch ( rc ) {
                case -1:
                        rs->sr_err = LDAP_OTHER;
                        send_ldap_result( op, rs );
@@ -97,6 +99,14 @@ retry:;
                        send_ldap_result( op, rs );
                        goto cleanup;
 
+               case LDAP_RES_DELETE:
+                       rc = ldap_parse_result( mc->mc_conns[ candidate ].msc_ld,
+                               res, &rs->sr_err, NULL, NULL, NULL, NULL, 1 );
+                       if ( rc != LDAP_SUCCESS ) {
+                               rs->sr_err = rc;
+                       }
+                       break;
+
                default:
                        ldap_msgfree( res );
                        break;
index 379a1e03ec780f26ce9bf8066613d76001abe438..f2b40d24a409d32e08c1b13eb1160affd41373fd 100644 (file)
@@ -191,11 +191,11 @@ retry:;
                        tvp = &tv;
                }
 
-               rs->sr_err = ldap_result( mc->mc_conns[ candidate ].msc_ld,
+               rs->sr_err = LDAP_OTHER;
+               rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
                        msgid, LDAP_MSG_ONE, tvp, &res );
-               switch ( rs->sr_err ) {
+               switch ( rc ) {
                case -1:
-                       rs->sr_err = LDAP_OTHER;
                        rc = -1;
                        break;
 
@@ -207,7 +207,17 @@ retry:;
                        rc = -1;
                        break;
 
+               case LDAP_RES_MODIFY:
+                       rc = ldap_parse_result( mc->mc_conns[ candidate ].msc_ld,
+                               res, &rs->sr_err, NULL, NULL, NULL, NULL, 1 );
+                       if ( rc != LDAP_SUCCESS ) {
+                               rs->sr_err = rc;
+                       }
+                       rc = 0;
+                       break;
+
                default:
+                       rc = -1;
                        ldap_msgfree( res );
                        break;
                }
index 90b151761ee6dfa8acbc7e7e04165ca1c597118d..741571c32d66cd930bb548dd92135e8434fd1cb6 100644 (file)
@@ -115,6 +115,7 @@ retry:;
        } else if ( rs->sr_err == LDAP_SUCCESS ) {
                struct timeval  tv, *tvp = NULL;
                LDAPMessage     *res = NULL;
+               int             rc;
 
                if ( mi->mi_targets[ candidate ].mt_timeout[ META_OP_MODRDN ] != 0 ) {
                        tv.tv_sec = mi->mi_targets[ candidate ].mt_timeout[ META_OP_MODRDN ];
@@ -122,11 +123,11 @@ retry:;
                        tvp = &tv;
                }
 
-               rs->sr_err = ldap_result( mc->mc_conns[ candidate ].msc_ld,
+               rs->sr_err = LDAP_OTHER;
+               rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
                        msgid, LDAP_MSG_ONE, tvp, &res );
-               switch ( rs->sr_err ) {
+               switch ( rc ) {
                case -1:
-                       rs->sr_err = LDAP_OTHER;
                        break;
 
                case 0:
@@ -136,6 +137,14 @@ retry:;
                                LDAP_ADMINLIMIT_EXCEEDED : LDAP_OPERATIONS_ERROR;
                        break;
 
+               case LDAP_RES_RENAME:
+                       rc = ldap_parse_result( mc->mc_conns[ candidate ].msc_ld,
+                               res, &rs->sr_err, NULL, NULL, NULL, NULL, 1 );
+                       if ( rc != LDAP_SUCCESS ) {
+                               rs->sr_err = rc;
+                       }
+                       break;
+
                default:
                        ldap_msgfree( res );
                        break;
@@ -157,10 +166,10 @@ cleanup:;
 
        if ( rs->sr_err == LDAP_SUCCESS ) {
                meta_back_op_result( mc, op, rs, candidate );
+       } else {
+               send_ldap_result( op, rs );
        }
 
-       send_ldap_result( op, rs );
-
        meta_back_release_conn( op, mc );
 
        return rs->sr_err;