]> git.sur5r.net Git - openldap/commitdiff
ITS#8142 drop client connection on remote failure
authorHoward Chu <hyc@openldap.org>
Tue, 19 May 2015 14:37:24 +0000 (15:37 +0100)
committerHoward Chu <hyc@openldap.org>
Tue, 19 May 2015 14:37:24 +0000 (15:37 +0100)
also cleanup of return-code handling

servers/slapd/back-ldap/bind.c
servers/slapd/back-ldap/delete.c
servers/slapd/back-ldap/modify.c
servers/slapd/back-ldap/modrdn.c
servers/slapd/back-ldap/search.c

index ccaefca207919a0b85386c939e28a5afbc5e7145..d336dbb723f33b9ff25f99c33d93729c038856e9 100644 (file)
@@ -1573,6 +1573,7 @@ retry:;
                        op->o_tag = o_tag;
                        rs->sr_text = "Proxy can't contact remote server";
                        send_ldap_result( op, rs );
+                       rs->sr_err = SLAPD_DISCONNECT;
                }
 
                rc = 0;
index be3053b59ea1c5b887870ba7a228d0499c3d9dad..06e39f51d5a96d8569ca5d231bd8f41980a01b2e 100644 (file)
@@ -53,7 +53,6 @@ retry:
        rc = ldap_back_controls_add( op, rs, lc, &ctrls );
        if ( rc != LDAP_SUCCESS ) {
                send_ldap_result( op, rs );
-               rc = rs->sr_err;
                goto cleanup;
        }
 
@@ -82,5 +81,5 @@ cleanup:
                ldap_back_release_conn( li, lc );
        }
 
-       return rc;
+       return rs->sr_err;
 }
index 50cc5ea8ec6732ee3571b5b2eb64bcae52d09b0c..d9de25054deebd03dab393d8f22d9a1e1fe7e16f 100644 (file)
@@ -98,7 +98,6 @@ retry:;
        rc = ldap_back_controls_add( op, rs, lc, &ctrls );
        if ( rc != LDAP_SUCCESS ) {
                send_ldap_result( op, rs );
-               rc = -1;
                goto cleanup;
        }
 
@@ -132,6 +131,6 @@ cleanup:;
                ldap_back_release_conn( li, lc );
        }
 
-       return rc;
+       return rs->sr_err;
 }
 
index ecbb6b8b8b8b2e283c2ce18f9fd64792586bb7e4..87f8a6847c5390978f2ab5a6b2c28395b134e332 100644 (file)
@@ -85,7 +85,6 @@ retry:
        rc = ldap_back_controls_add( op, rs, lc, &ctrls );
        if ( rc != LDAP_SUCCESS ) {
                send_ldap_result( op, rs );
-               rc = -1;
                goto cleanup;
        }
 
@@ -119,6 +118,6 @@ cleanup:
                ldap_back_release_conn( li, lc );
        }
 
-       return rc;
+       return rs->sr_err;
 }
 
index 41cb685e18744f171a6c09c55357cd60cecfbdad..3a08b96851c8ab5fdd0082b7b2034e0a956c8355 100644 (file)
@@ -645,6 +645,8 @@ finish:;
                ldap_back_release_conn( li, lc );
        }
 
+       if ( rs->sr_err == LDAP_UNAVAILABLE )
+               rs->sr_err = SLAPD_DISCONNECT;
        return rs->sr_err;
 }