]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/ri.c
A few changes to the handling of operational attributes.
[openldap] / servers / slurpd / ri.c
index 9ea1a2217420c1c489f24e0c388def41bdb39905..aa12a79c0f24b078ba63e4e76fef4db2f7ed621b 100644 (file)
@@ -1,4 +1,8 @@
 /* $OpenLDAP$ */
+/*
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 /*
  * Copyright (c) 1996 Regents of the University of Michigan.
  * All rights reserved.
@@ -62,7 +66,13 @@ Ri_process(
     rq->rq_lock( rq );
     while ( !sglob->slurpd_shutdown &&
            (( re = rq->rq_gethead( rq )) == NULL )) {
-       /* No work - wait on condition variable */
+       /* No work */
+       if ( sglob->one_shot_mode ) {
+           /* give up if in one shot mode */
+           rq->rq_unlock( rq );
+           return 0;
+       }
+       /* wait on condition variable */
        ldap_pvt_thread_cond_wait( &rq->rq_more, &rq->rq_mutex );
     }
 
@@ -228,12 +238,12 @@ isnew(
     Re *re
 )
 {
-    int        x;
+    long x;
     int        ret;
 
     /* Lock the St struct to avoid a race */
     sglob->st->st_lock( sglob->st );
-    x = strcmp( re->re_timestamp, ri->ri_stel->last );
+    x = re->re_timestamp - ri->ri_stel->last;
     if ( x > 0 ) {
        /* re timestamp is newer */
        ret = 1;