/* $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.
)
{
Rq *rq = sglob->rq;
- Re *re, *new_re;
+ Re *re = NULL, *new_re = NULL;
int rc ;
char *errmsg;
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 );
}
Ri **ri
)
{
- (*ri) = ( Ri * ) malloc( sizeof( Ri ));
+ (*ri) = ( Ri * ) calloc( 1, sizeof( Ri ));
if ( *ri == NULL ) {
return -1;
}
/* Initialize private data */
(*ri)->ri_hostname = NULL;
- (*ri)->ri_port = 0;
(*ri)->ri_ldp = NULL;
- (*ri)->ri_bind_method = 0;
(*ri)->ri_bind_dn = NULL;
(*ri)->ri_password = NULL;
- (*ri)->ri_principal = NULL;
+ (*ri)->ri_authcId = NULL;
(*ri)->ri_srvtab = NULL;
(*ri)->ri_curr = NULL;
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;