]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/ldap_op.c
add uptime monitoring (in seconds)
[openldap] / servers / slurpd / ldap_op.c
index b33a74a49a7dce79310d88a7ab29a08e4d14a8c4..dc06b2d310e215eb600257e9e56855cbd35e418c 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * Portions Copyright 2003 Mark Benson.
  * All rights reserved.
  *
@@ -61,7 +61,9 @@ static LDAPMod *alloc_ldapmod LDAP_P(( void ));
 static void free_ldapmod LDAP_P(( LDAPMod * ));
 static void free_ldmarr LDAP_P(( LDAPMod ** ));
 static int getmodtype LDAP_P(( char * ));
+#ifdef SLAPD_UNUSED
 static void dump_ldm_array LDAP_P(( LDAPMod ** ));
+#endif
 static int do_bind LDAP_P(( Ri *, int * ));
 static int do_unbind LDAP_P(( Ri * ));
 
@@ -213,8 +215,8 @@ op_ldap_add(
                ri->ri_hostname, ri->ri_port, re->re_dn );
        rc = ldap_add_s( ri->ri_ldp, re->re_dn, ldmarr );
 
-       ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_NUMBER, &lderr);
-       ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
+       ldap_get_option( ri->ri_ldp, LDAP_OPT_RESULT_CODE, &lderr);
+       ldap_get_option( ri->ri_ldp, LDAP_OPT_DIAGNOSTIC_MESSAGE, errmsg);
        *errfree = 1;
 
     } else {
@@ -351,7 +353,7 @@ op_ldap_modify(
        Debug( LDAP_DEBUG_ARGS, "replica %s:%d - modify dn \"%s\"\n",
                ri->ri_hostname, ri->ri_port, re->re_dn );
        rc = ldap_modify_s( ri->ri_ldp, re->re_dn, ldmarr );
-       ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
+       ldap_get_option( ri->ri_ldp, LDAP_OPT_DIAGNOSTIC_MESSAGE, errmsg);
        *errfree = 1;
     }
     free_ldmarr( ldmarr );
@@ -377,7 +379,7 @@ op_ldap_delete(
     Debug( LDAP_DEBUG_ARGS, "replica %s:%d - delete dn \"%s\"\n",
            ri->ri_hostname, ri->ri_port, re->re_dn );
     rc = ldap_delete_s( ri->ri_ldp, re->re_dn );
-    ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
+    ldap_get_option( ri->ri_ldp, LDAP_OPT_DIAGNOSTIC_MESSAGE, errmsg);
     *errfree = 1;
 
     return( rc );
@@ -510,8 +512,8 @@ op_ldap_modrdn(
     /* Do the modrdn */
     rc = ldap_rename2_s( ri->ri_ldp, re->re_dn, newrdn, newsup, drdnflag );
 
-       ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_NUMBER, &lderr);
-       ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
+       ldap_get_option( ri->ri_ldp, LDAP_OPT_RESULT_CODE, &lderr);
+       ldap_get_option( ri->ri_ldp, LDAP_OPT_DIAGNOSTIC_MESSAGE, errmsg);
        *errfree = 1;
     return( lderr );
 }
@@ -667,7 +669,7 @@ do_bind(
 )
 {
     int                ldrc;
-    int                do_tls = ri->ri_tls;
+    int                do_tls;
 
     *lderr = 0;
 
@@ -676,6 +678,8 @@ do_bind(
        return( BIND_ERR_BADRI );
     }
 
+    do_tls = ri->ri_tls;
+
 retry:
     if ( ri->ri_ldp != NULL ) {
        ldrc = ldap_unbind( ri->ri_ldp );
@@ -877,6 +881,7 @@ retry:
 /*
  * For debugging.  Print the contents of an ldmarr array.
  */
+#ifdef SLAPD_UNUSED
 static void
 dump_ldm_array(
     LDAPMod **ldmarr
@@ -910,3 +915,4 @@ dump_ldm_array(
        }
     }
 }
+#endif