]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/re.c
fix small issues with dynacl and ACI in general
[openldap] / servers / slurpd / re.c
index 4e806abc8f7bd542f6b110243e48ed16c675d945..7a709487834f9d410c4c6b059079f59a42427a36 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -94,14 +94,9 @@ Re_free(
        return 0;
     }
     if ( re->re_refcnt > 0 ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, WARNING, "Re_free: "
-               "Warning: freeing re (dn: %s) with nonzero refcnt\n", re->re_dn, 0, 0 );
-#else
        Debug( LDAP_DEBUG_ANY,
                "Warning: freeing re (dn: %s) with nonzero refcnt\n",
                re->re_dn, 0, 0 );
-#endif
     }
 
     ldap_pvt_thread_mutex_destroy( &re->re_mutex );
@@ -153,19 +148,11 @@ Re_parse(
     int                        nreplicas;
 
     if ( re == NULL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, ERR, "Re_parse: Error: re is NULL\n", 0, 0, 0 );
-#else
        Debug( LDAP_DEBUG_ANY, "Re_parse: error: re is NULL\n", 0, 0, 0 );
-#endif
        return -1;
     }
     if ( replbuf == NULL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, ERR, "Re_parse: Error: replbuf is NULL\n", 0, 0, 0 );
-#else
        Debug( LDAP_DEBUG_ANY, "Re_parse: error: replbuf is NULL\n", 0, 0, 0 );
-#endif
        return -1;
     }
 
@@ -190,14 +177,9 @@ Re_parse(
        }
        buflen = strlen( buf );
        if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG ( SLURPD, ERR, 
-                       "Re_parse: Error: malformed replog file\n", 0, 0, 0 );
-#else
            Debug( LDAP_DEBUG_ANY,
                    "Error: Re_parse: malformed replog file\n",
                    0, 0, 0 );
-#endif
            return -1;
        }
        switch ( gettype( type )) {
@@ -224,14 +206,9 @@ Re_parse(
            break;
        default:
            if ( !( state == GOT_ALL )) {
-#ifdef NEW_LOGGING
-               LDAP_LOG ( SLURPD, ERR, 
-                       "Re_parse: Error: bad type <%s>\n", type, 0, 0 );
-#else
                Debug( LDAP_DEBUG_ANY,
                        "Error: Re_parse: bad type <%s>\n",
                        type, 0, 0 );
-#endif
                free( type );
                free( value );
                return -1;
@@ -242,14 +219,9 @@ Re_parse(
     }
 
     if ( state != GOT_ALL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, ERR, 
-               "Re_parse: Error: malformed replog file\n", 0, 0, 0 );
-#else
        Debug( LDAP_DEBUG_ANY,
                "Error: Re_parse: malformed replog file\n",
                0, 0, 0 );
-#endif
        return -1;
     }
 
@@ -265,14 +237,9 @@ Re_parse(
            value = NULL;
        } else {
            if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG ( SLURPD, ERR, 
-                       "Re_parse: Error: malformed replog line \"%s\"\n", buf, 0, 0 );
-#else
                Debug( LDAP_DEBUG_ANY,
                        "Error: malformed replog line \"%s\"\n",
                        buf, 0, 0 );
-#endif
                return -1;
            }
        }
@@ -383,13 +350,8 @@ get_repl_hosts(
 
        rh = (Rh *) ch_realloc((char *) rh, ( nreplicas + 2 ) * sizeof( Rh ));
        if ( rh == NULL ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG ( SLURPD, ERR, 
-                       "get_repl_hosts: Out of memory\n", 0, 0, 0 );
-#else
            Debug( LDAP_DEBUG_ANY, "Out of memory in get_repl_hosts\n",
                    0, 0, 0 );
-#endif
            return NULL;
        }
        rh[ nreplicas ].rh_hostname = strdup( value );
@@ -461,6 +423,7 @@ getchangetype(
 
 
 
+#if 0
 /*
  * Find the first line which is not a "replica:" line in buf.
  * Returns a pointer to the line.  Returns NULL if there are
@@ -486,6 +449,7 @@ skip_replica_lines(
        }
     }
 }
+#endif /* 0 */
 
 
 
@@ -504,11 +468,7 @@ Re_dump(
     Mi *mi;
 
     if ( re == NULL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, ERR, "Re_dump: re is NULL\n", 0, 0, 0 );
-#else
        Debug( LDAP_DEBUG_TRACE, "Re_dump: re is NULL\n", 0, 0, 0 );
-#endif
        return;
     }
     fprintf( fp, "Re_dump: ******\n" );
@@ -574,13 +534,8 @@ Re_write(
     int                rc = 0;
 
     if ( re == NULL || fp == NULL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, ERR, 
-               "Re_write: Internal error: NULL argument\n", 0, 0, 0 );
-#else
        Debug( LDAP_DEBUG_ANY, "Internal error: Re_write: NULL argument\n",
                0, 0, 0 );
-#endif
        return -1;
     }
 
@@ -668,13 +623,8 @@ Re_write(
     }
 bad:
     if ( rc != 0 ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, ERR, 
-               "Re_write: Error while writing: %s\n", sys_errlist[ errno ], 0, 0 );
-#else
        Debug( LDAP_DEBUG_ANY, "Error while writing: %s\n",
                sys_errlist[ errno ], 0, 0 );
-#endif
     }
     return rc;
 }
@@ -811,15 +761,9 @@ warn_unknown_replica(
        }
     }
     if ( !found ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, WARNING, "warn_unknown_replica: "
-               "Warning: unknown replica %s:%d found in replication log\n",
-               host, port, 0 );
-#else
        Debug( LDAP_DEBUG_ANY,
                "Warning: unknown replica %s:%d found in replication log\n",
                host, port, 0 );
-#endif
        nur++;
        ur = (Rh *) ch_realloc( (char *) ur, ( nur * sizeof( Rh )));
        ur[ nur - 1 ].rh_hostname = strdup( host );