]> git.sur5r.net Git - openldap/commitdiff
ITS#2888 fix back-ldap to check result of send_search_entry.
authorHoward Chu <hyc@openldap.org>
Fri, 13 Feb 2004 02:44:13 +0000 (02:44 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 13 Feb 2004 02:44:13 +0000 (02:44 +0000)
Make sure sizelimit errors are propagated.

servers/slapd/back-ldap/search.c
servers/slapd/backglue.c

index 4dd6d8ccde5f8a9ca833d93a5f38a1480a10cb6d..5c8ec754e94978ef6344bbcb164c10a07b018fa0 100644 (file)
@@ -218,12 +218,13 @@ fail:;
                } else if (rc == LDAP_RES_SEARCH_ENTRY) {
                        Entry ent = {0};
                        struct berval bdn;
+                       int abort = 0;
                        e = ldap_first_entry(lc->ld,res);
-                       if ( ldap_build_entry(op, e, &ent, &bdn,
-                                               LDAP_BUILD_ENTRY_PRIVATE) == LDAP_SUCCESS ) {
+                       if ( ( rc = ldap_build_entry(op, e, &ent, &bdn,
+                                               LDAP_BUILD_ENTRY_PRIVATE)) == LDAP_SUCCESS ) {
                                rs->sr_entry = &ent;
                                rs->sr_attrs = op->oq_search.rs_attrs;
-                               send_search_entry( op, rs );
+                               abort = send_search_entry( op, rs );
                                while (ent.e_attrs) {
                                        Attribute *a;
                                        BerVarray v;
@@ -245,6 +246,10 @@ fail:;
                                        free( ent.e_ndn );
                        }
                        ldap_msgfree(res);
+                       if ( abort ) {
+                               ldap_abandon(lc->ld, msgid);
+                               goto finish;
+                       }
 
                } else if ( rc == LDAP_RES_SEARCH_REFERENCE ) {
                        char            **references = NULL;
index c75bd2eb25d55842c62917bff9a3c72215059e42..669f8525f1c92a219b32476b8bf7453e3a86bc11 100644 (file)
@@ -194,7 +194,7 @@ glue_back_response ( Operation *op, SlapReply *rs )
        switch(rs->sr_type) {
        case REP_SEARCH:
                if ( gs->slimit && rs->sr_nentries >= gs->slimit ) {
-                       gs->err = LDAP_SIZELIMIT_EXCEEDED;
+                       rs->sr_err = gs->err = LDAP_SIZELIMIT_EXCEEDED;
                        return -1;
                }
                /* fallthru */