Diff for /servers/slapd/overlays/syncprov.c between versions 1.61 and 1.62

version 1.61, 2005/01/11 04:00:59 version 1.62, 2005/01/12 00:49:00
Line 1 Line 1
 /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.60 2005/01/08 08:59:53 ando Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.61 2005/01/11 04:00:59 hyc Exp $ */
 /* syncprov.c - syncrepl provider */  /* syncprov.c - syncrepl provider */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
Line 84  typedef struct sync_control { Line 84  typedef struct sync_control {
 #define SLAP_SYNC_REFRESH_AND_PERSIST   (LDAP_SYNC_REFRESH_AND_PERSIST<<SLAP_CONTROL_SHIFT)  #define SLAP_SYNC_REFRESH_AND_PERSIST   (LDAP_SYNC_REFRESH_AND_PERSIST<<SLAP_CONTROL_SHIFT)
   
 #define PS_IS_REFRESHING        0x01  #define PS_IS_REFRESHING        0x01
   #define PS_IS_DETACHED          0x02
   
 /* Record of which searches matched at premodify step */  /* Record of which searches matched at premodify step */
 typedef struct syncmatches {  typedef struct syncmatches {
Line 828  syncprov_free_syncop( syncops *so ) Line 829  syncprov_free_syncop( syncops *so )
                 return;                  return;
         }          }
         ldap_pvt_thread_mutex_unlock( &so->s_mutex );          ldap_pvt_thread_mutex_unlock( &so->s_mutex );
         filter_free( so->s_op->ors_filter );          if ( so->s_flags & PS_IS_DETACHED ) {
         for ( ga = so->s_op->o_groups; ga; ga=gnext ) {                  filter_free( so->s_op->ors_filter );
                 gnext = ga->ga_next;                  for ( ga = so->s_op->o_groups; ga; ga=gnext ) {
                 ch_free( ga );                          gnext = ga->ga_next;
                           ch_free( ga );
                   }
                   ch_free( so->s_op );
         }          }
         ch_free( so->s_op );  
         ch_free( so->s_base.bv_val );          ch_free( so->s_base.bv_val );
         for ( sr=so->s_res; sr; sr=srnext ) {          for ( sr=so->s_res; sr; sr=srnext ) {
                 srnext = sr->s_next;                  srnext = sr->s_next;
Line 846  syncprov_free_syncop( syncops *so ) Line 849  syncprov_free_syncop( syncops *so )
 static int  static int
 syncprov_drop_psearch( syncops *so, int lock )  syncprov_drop_psearch( syncops *so, int lock )
 {  {
         if ( lock )          if ( so->s_flags & PS_IS_DETACHED ) {
                 ldap_pvt_thread_mutex_lock( &so->s_op->o_conn->c_mutex );                  if ( lock )
         so->s_op->o_conn->c_n_ops_executing--;                          ldap_pvt_thread_mutex_lock( &so->s_op->o_conn->c_mutex );
         so->s_op->o_conn->c_n_ops_completed++;                  so->s_op->o_conn->c_n_ops_executing--;
         LDAP_STAILQ_REMOVE( &so->s_op->o_conn->c_ops, so->s_op, slap_op,                  so->s_op->o_conn->c_n_ops_completed++;
                 o_next );                  LDAP_STAILQ_REMOVE( &so->s_op->o_conn->c_ops, so->s_op, slap_op,
         if ( lock )                          o_next );
                 ldap_pvt_thread_mutex_unlock( &so->s_op->o_conn->c_mutex );                  if ( lock )
                           ldap_pvt_thread_mutex_unlock( &so->s_op->o_conn->c_mutex );
           }
         syncprov_free_syncop( so );          syncprov_free_syncop( so );
 }  }
   
Line 1584  syncprov_detach_op( Operation *op, synco Line 1589  syncprov_detach_op( Operation *op, synco
         op->o_conn->c_n_ops_executing++;          op->o_conn->c_n_ops_executing++;
         op->o_conn->c_n_ops_completed--;          op->o_conn->c_n_ops_completed--;
         LDAP_STAILQ_INSERT_TAIL( &op->o_conn->c_ops, op2, o_next );          LDAP_STAILQ_INSERT_TAIL( &op->o_conn->c_ops, op2, o_next );
           so->s_flags |= PS_IS_DETACHED;
         ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );          ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
 }  }
   

Removed from v.1.61  
changed lines
  Added in v.1.62


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org