]> git.sur5r.net Git - openldap/commitdiff
syncrepl retry code fix for correct timing
authorJong Hyuk Choi <jongchoi@openldap.org>
Mon, 21 Jun 2004 07:03:49 +0000 (07:03 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Mon, 21 Jun 2004 07:03:49 +0000 (07:03 +0000)
libraries/libldap_r/rq.c
servers/slapd/daemon.c
servers/slapd/proto-slap.h
servers/slapd/syncrepl.c

index 194d16db8eda17e77969da03b883bbc064771bde..35df5c7b4ab6fd20387188b0c0bcc693a074eac7 100644 (file)
@@ -66,9 +66,9 @@ ldap_pvt_runqueue_remove(
                        break;
        }
 
-       if ( e == entry ) {
-               LDAP_STAILQ_REMOVE( &rq->task_list, entry, re_s, tnext );
-       }
+       assert( e == entry );
+
+       LDAP_STAILQ_REMOVE( &rq->task_list, entry, re_s, tnext );
 
        LDAP_FREE( entry );
 }
index 7e05ee928c7f651a7d0af6ec4d4c797b9464cd2a..5b8deba052dcdef663d6ad4388195352e1d144a1 100644 (file)
@@ -2147,3 +2147,8 @@ void slapd_add_internal(ber_socket_t s, int isactive) {
 Listener ** slapd_get_listeners(void) {
        return slap_listeners;
 }
+
+void slap_wake_listener()
+{
+       WAKE_LISTENER(1);
+}
index 2c8a865e1f775ff0ae8443d74b3926b0d1b64a71..34a51910fb9b5a1c9512e0d2a35410de832b0825 100644 (file)
@@ -422,6 +422,7 @@ LDAP_SLAPD_F (void) slapd_remove LDAP_P((ber_socket_t s, int wasactive, int wake
 
 LDAP_SLAPD_F (RETSIGTYPE) slap_sig_shutdown LDAP_P((int sig));
 LDAP_SLAPD_F (RETSIGTYPE) slap_sig_wake LDAP_P((int sig));
+LDAP_SLAPD_F (void) slap_wake_listener LDAP_P((void));
 
 LDAP_SLAPD_F (void) slapd_set_write LDAP_P((ber_socket_t s, int wake));
 LDAP_SLAPD_F (void) slapd_clr_write LDAP_P((ber_socket_t s, int wake));
index 723bf05f77fac8f333dbaa345a9f2dfba49a1dc5..bcc4b4f346af65bf56d5543c51a208f378c22979 100644 (file)
@@ -907,10 +907,11 @@ do_syncrepl(
                ldap_pvt_runqueue_stoptask( &syncrepl_rq, rtask );
        }
 
+       if ( dostop ) {
+               connection_client_stop( s );
+       }
+
        if ( rc == LDAP_SUCCESS ) {
-               if ( dostop ) {
-                       connection_client_stop( s );
-               }
                if ( si->si_type == LDAP_SYNC_REFRESH_ONLY ) {
                        defer = 0;
                }
@@ -929,15 +930,13 @@ do_syncrepl(
                }
 
                if ( !si->si_retrynum || si->si_retrynum[i] == -2 ) {
-                       if ( dostop ) {
-                               connection_client_stop( s );
-                       }
                        ldap_pvt_runqueue_remove( &syncrepl_rq, rtask );
                } else if ( si->si_retrynum[i] >= -1 ) {
                        if ( si->si_retrynum[i] > 0 )
                                si->si_retrynum[i]--;
                        rtask->interval.tv_sec = si->si_retryinterval[i];
                        ldap_pvt_runqueue_resched( &syncrepl_rq, rtask, 0 );
+                       slap_wake_listener();
                }
        }