]> git.sur5r.net Git - openldap/commitdiff
ITS#5376, #5378 delta-sync should fallback in other cases too
authorHoward Chu <hyc@openldap.org>
Wed, 9 Apr 2008 12:01:11 +0000 (12:01 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 9 Apr 2008 12:01:11 +0000 (12:01 +0000)
servers/slapd/syncrepl.c

index 5be4424468907e776cbc7958bf53d2ae602ca742..93ff10fc9bdfe333829b04aa287427106b34b905 100644 (file)
@@ -834,10 +834,17 @@ do_syncrep2(
                                        syncCookie.ctxcsn )
                                {
                                        rc = syncrepl_updateCookie( si, op, psub, &syncCookie );
-                               } else if ( rc == LDAP_NO_SUCH_OBJECT ) {
-                                       rc = LDAP_SYNC_REFRESH_REQUIRED;
-                                       si->si_logstate = SYNCLOG_FALLBACK;
-                                       ldap_abandon_ext( si->si_ld, si->si_msgid, NULL, NULL );
+                               } else switch ( rc ) {
+                                       case LDAP_ALREADY_EXISTS:
+                                       case LDAP_NO_SUCH_OBJECT:
+                                       case LDAP_NO_SUCH_ATTRIBUTE:
+                                       case LDAP_TYPE_OR_VALUE_EXISTS:
+                                               rc = LDAP_SYNC_REFRESH_REQUIRED;
+                                               si->si_logstate = SYNCLOG_FALLBACK;
+                                               ldap_abandon_ext( si->si_ld, si->si_msgid, NULL, NULL );
+                                               break;
+                                       default:
+                                               break;
                                }
                        } else if ( ( rc = syncrepl_message_to_entry( si, op, msg,
                                &modlist, &entry, syncstate ) ) == LDAP_SUCCESS )