From 8ead8c5fd90633bee024fd05980434523e4fe089 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 19 Aug 1999 00:40:18 +0000 Subject: [PATCH] Clean up debug messages. --- servers/slapd/abandon.c | 2 +- servers/slapd/back-ldbm/dbcache.c | 2 +- servers/slapd/bind.c | 15 ++++++++------- servers/slapd/connection.c | 22 +++++++++++----------- servers/slapd/daemon.c | 18 +++++++++--------- servers/slapd/result.c | 2 +- servers/slapd/tools/edb2ldif.c | 2 +- servers/slapd/tools/ldbmtest.c | 10 +++++----- servers/slapd/tools/slapadd.c | 2 +- 9 files changed, 38 insertions(+), 37 deletions(-) diff --git a/servers/slapd/abandon.c b/servers/slapd/abandon.c index ec95e10a4e..0d31209148 100644 --- a/servers/slapd/abandon.c +++ b/servers/slapd/abandon.c @@ -54,7 +54,7 @@ do_abandon( return rc; } - Debug( LDAP_DEBUG_ARGS, "do_abandon: id %d\n", id, 0 ,0 ); + Debug( LDAP_DEBUG_ARGS, "do_abandon: id=%ld\n", (long) id, 0 ,0 ); if( id <= 0 ) { Debug( LDAP_DEBUG_ANY, diff --git a/servers/slapd/back-ldbm/dbcache.c b/servers/slapd/back-ldbm/dbcache.c index 3a0287122e..ff795cd062 100644 --- a/servers/slapd/back-ldbm/dbcache.c +++ b/servers/slapd/back-ldbm/dbcache.c @@ -99,7 +99,7 @@ ldbm_cache_open( li->li_dbcachesize )) == NULL ) { int err = errno; Debug( LDAP_DEBUG_TRACE, - "<= ldbm_cache_open NULL \"%s\" errno %d reason \"%s\")\n", + "<= ldbm_cache_open NULL \"%s\" errno=%d reason=\"%s\")\n", buf, err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown" ); ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex ); diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 262dd3c4b8..196fa67cf3 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -155,15 +155,16 @@ do_bind( Debug( LDAP_DEBUG_TRACE, "do_sasl_bind: dn (%s) mech %s\n", dn, mech, NULL ); } else { - Debug( LDAP_DEBUG_TRACE, "do_bind: version %d dn (%s) method %d\n", - version, dn, method ); + Debug( LDAP_DEBUG_TRACE, "do_bind: version=%ld dn=\"%s\" method=%ld\n", + (unsigned long) version, dn, (unsigned long) method ); } Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d BIND dn=\"%s\" method=%ld\n", op->o_connid, op->o_opid, ndn, (unsigned long) method, 0 ); if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) { - Debug( LDAP_DEBUG_ANY, "unknown version %d\n", version, 0, 0 ); + Debug( LDAP_DEBUG_ANY, "do_bind: unknown version=%ld\n", + (unsigned long) version, 0, 0 ); send_ldap_result( conn, op, rc = LDAP_PROTOCOL_ERROR, NULL, "version not supported", NULL, NULL ); goto cleanup; @@ -171,8 +172,8 @@ do_bind( if ( method == LDAP_AUTH_SASL ) { if ( version < LDAP_VERSION3 ) { - Debug( LDAP_DEBUG_ANY, "do_bind: sasl with LDAPv%d\n", - version, 0, 0 ); + Debug( LDAP_DEBUG_ANY, "do_bind: sasl with LDAPv%ld\n", + (unsigned long) version, 0, 0 ); send_ldap_disconnect( conn, op, LDAP_PROTOCOL_ERROR, "sasl bind requires LDAPv3" ); rc = -1; @@ -182,7 +183,7 @@ do_bind( if( mech == NULL || *mech == '\0' ) { Debug( LDAP_DEBUG_ANY, "do_bind: no sasl mechanism provided\n", - version, 0, 0 ); + 0, 0, 0 ); send_ldap_result( conn, op, rc = LDAP_AUTH_METHOD_NOT_SUPPORTED, NULL, "no sasl mechanism provided", NULL, NULL ); goto cleanup; @@ -190,7 +191,7 @@ do_bind( if( !charray_inlist( supportedSASLMechanisms, mech ) ) { Debug( LDAP_DEBUG_ANY, - "do_bind: sasl mechanism \"%s\" not supported.\n", + "do_bind: sasl mechanism=\"%s\" not supported.\n", mech, 0, 0 ); send_ldap_result( conn, op, rc = LDAP_AUTH_METHOD_NOT_SUPPORTED, NULL, "sasl mechanism not supported", NULL, NULL ); diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 91633073fb..a1ed6defb7 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -82,7 +82,7 @@ int connections_init(void) if( connections == NULL ) { Debug( LDAP_DEBUG_ANY, - "connections_init: allocation (%d*%ld) of connection array failed.\n", + "connections_init: allocation (%d*%ld) of connection array failed\n", dtblsize, (long) sizeof(Connection), 0 ); return -1; } @@ -246,8 +246,8 @@ static Connection* connection_get( ber_socket_t s ) assert( !ber_pvt_sb_in_use( c->c_sb ) ); Debug( LDAP_DEBUG_TRACE, - "connection_get(%d): connection not used.\n", - s, c->c_connid, 0 ); + "connection_get(%d): connection not used\n", + s, 0, 0 ); ldap_pvt_thread_mutex_unlock( &c->c_mutex ); return NULL; @@ -338,7 +338,7 @@ long connection_init( if( c == NULL ) { Debug( LDAP_DEBUG_ANY, - "connection_init(%d): connection table full (%d/%d).\n", + "connection_init(%d): connection table full (%d/%d)\n", s, i, dtblsize); ldap_pvt_thread_mutex_unlock( &connections_mutex ); return -1; @@ -508,7 +508,7 @@ connection_destroy( Connection *c ) ber_pvt_sb_close( c->c_sb ); Statslog( LDAP_DEBUG_STATS, - "conn=%ld fd=%d closed.\n", + "conn=%ld fd=%d closed\n", c->c_connid, sd, 0, 0, 0 ); } @@ -566,7 +566,7 @@ void connection_closing( Connection *c ) if( c->c_conn_state != SLAP_C_CLOSING ) { Debug( LDAP_DEBUG_TRACE, - "connection_closing: readying conn=%ld sd=%d for close.\n", + "connection_closing: readying conn=%ld sd=%d for close\n", c->c_connid, ber_pvt_sb_get_desc( c->c_sb ), 0 ); /* update state to closing */ @@ -597,13 +597,13 @@ static void connection_close( Connection *c ) if( c->c_ops != NULL ) { Debug( LDAP_DEBUG_TRACE, - "connection_close: deferring conn=%ld sd=%d.\n", + "connection_close: deferring conn=%ld sd=%d\n", c->c_connid, ber_pvt_sb_get_desc( c->c_sb ), 0 ); return; } - Debug( LDAP_DEBUG_TRACE, "connection_close: conn=%ld sd=%d.\n", + Debug( LDAP_DEBUG_TRACE, "connection_close: conn=%ld sd=%d\n", c->c_connid, ber_pvt_sb_get_desc( c->c_sb ), 0 ); connection_destroy( c ); @@ -843,7 +843,7 @@ int connection_read(ber_socket_t s) rc = ldap_pvt_tls_accept( c->c_sb, NULL ); if ( rc < 0 ) { Debug( LDAP_DEBUG_TRACE, - "connection_read(%d): TLS accept error error=%d id=%ld, closing.\n", + "connection_read(%d): TLS accept error error=%d id=%ld, closing\n", s, rc, c->c_connid ); c->c_needs_tls_accept = 0; @@ -914,7 +914,7 @@ connection_input( int err = errno; Debug( LDAP_DEBUG_TRACE, - "ber_get_next on fd %d failed errno %d (%s)\n", + "ber_get_next on fd %d failed errno=%d (%s)\n", ber_pvt_sb_get_desc( conn->c_sb ), err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown" ); Debug( LDAP_DEBUG_TRACE, @@ -989,7 +989,7 @@ connection_resched( Connection *conn ) if( conn->c_conn_state == SLAP_C_CLOSING ) { Debug( LDAP_DEBUG_TRACE, - "connection_resched: attempting closing conn=%ld sd=%d.\n", + "connection_resched: attempting closing conn=%ld sd=%d\n", conn->c_connid, ber_pvt_sb_get_desc( conn->c_sb ), 0 ); connection_close( conn ); diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 43ec5b288e..7341b83680 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -277,12 +277,12 @@ open_listener( #ifndef HAVE_WINSOCK int err = errno; Debug( LDAP_DEBUG_ANY, - "daemon: socket() failed errno %d (%s)\n", err, + "daemon: socket() failed errno=%d (%s)\n", err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown", 0 ); #else Debug( LDAP_DEBUG_ANY, - "daemon: socket() failed errno %d (%s)\n", + "daemon: socket() failed errno=%d (%s)\n", WSAGetLastError(), WSAGetLastErrorString(), 0 ); #endif @@ -307,7 +307,7 @@ open_listener( { int err = errno; Debug( LDAP_DEBUG_ANY, - "slapd(%ld): setsockopt(SO_REUSEADDR) failed errno %d (%s)\n", + "slapd(%ld): setsockopt(SO_REUSEADDR) failed errno=%d (%s)\n", (long) l.sl_sd, err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown" ); @@ -321,7 +321,7 @@ open_listener( { int err = errno; Debug( LDAP_DEBUG_ANY, - "slapd(%ld): setsockopt(SO_KEEPALIVE) failed errno %d (%s)\n", + "slapd(%ld): setsockopt(SO_KEEPALIVE) failed errno=%d (%s)\n", (long) l.sl_sd, err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown" ); @@ -335,7 +335,7 @@ open_listener( { int err = errno; Debug( LDAP_DEBUG_ANY, - "slapd(%ld): setsockopt(TCP_NODELAY) failed errno %d (%s)\n", + "slapd(%ld): setsockopt(TCP_NODELAY) failed errno=%d (%s)\n", (long) l.sl_sd, err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown" ); @@ -344,7 +344,7 @@ open_listener( if ( bind( l.sl_sd, (struct sockaddr *) &l.sl_addr, sizeof(l.sl_addr) ) == -1 ) { int err = errno; - Debug( LDAP_DEBUG_ANY, "daemon: bind(%ld) failed errno %d (%s)\n", + Debug( LDAP_DEBUG_ANY, "daemon: bind(%ld) failed errno=%d (%s)\n", (long) l.sl_sd, err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown" ); @@ -442,7 +442,7 @@ int slapd_daemon_init(char *urls, int port, int tls_port ) } slap_listeners[i] = NULL; - Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners opened.\n", + Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners opened\n", i, 0, 0 ); charray_free( u ); @@ -476,7 +476,7 @@ slapd_daemon_task( if ( listen( slap_listeners[l]->sl_sd, 5 ) == -1 ) { int err = errno; Debug( LDAP_DEBUG_ANY, - "daemon: listen(%s, 5) failed errno %d (%s)\n", + "daemon: listen(%s, 5) failed errno=%d (%s)\n", (long) slap_listeners[l]->sl_url, err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown" ); @@ -649,7 +649,7 @@ slapd_daemon_task( { int err = errno; Debug( LDAP_DEBUG_ANY, - "daemon: accept(%ld) failed errno %d (%s)\n", err, + "daemon: accept(%ld) failed errno=%d (%s)\n", err, (long) slap_listeners[l]->sl_sd, err >= 0 && err < sys_nerr ? sys_errlist[err] : "unknown"); diff --git a/servers/slapd/result.c b/servers/slapd/result.c index cf572e81cd..6f3434276d 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -184,7 +184,7 @@ static long send_ldap_ber( * it's a hard error and return. */ - Debug( LDAP_DEBUG_CONNS, "ber_flush failed errno %d msg (%s)\n", + Debug( LDAP_DEBUG_CONNS, "ber_flush failed errno=%d reason=\"%s\"\n", err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown", 0 ); diff --git a/servers/slapd/tools/edb2ldif.c b/servers/slapd/tools/edb2ldif.c index 345a5e8938..8fe0ac64c9 100644 --- a/servers/slapd/tools/edb2ldif.c +++ b/servers/slapd/tools/edb2ldif.c @@ -863,7 +863,7 @@ print_err( char *msg ) #endif if ( errno > sys_nerr ) { - fprintf( stderr, "%s: %s: error %d\n", progname, msg, errno ); + fprintf( stderr, "%s: %s: errno=%d\n", progname, msg, errno ); } else { fprintf( stderr, "%s: %s: %s\n", progname, msg, sys_errlist[ errno ] ); } diff --git a/servers/slapd/tools/ldbmtest.c b/servers/slapd/tools/ldbmtest.c index b0a6766b2c..ad666a9ddb 100644 --- a/servers/slapd/tools/ldbmtest.c +++ b/servers/slapd/tools/ldbmtest.c @@ -196,7 +196,7 @@ main( int argc, char **argv ) if ( ldbm_errno( dbc->dbc_db ) == 0 ) { perror( "ldbm_delete" ); } else { - fprintf( stderr, "db_errno %d", + fprintf( stderr, "db_errno=%d", ldbm_errno( dbc->dbc_db ) ); } } @@ -219,7 +219,7 @@ main( int argc, char **argv ) if ( ldbm_errno( dbc->dbc_db ) == 0 ) { perror( "ldbm_fetch" ); } else { - fprintf( stderr, "db_errno %d\n", + fprintf( stderr, "db_errno=%d\n", ldbm_errno( dbc->dbc_db ) ); } free_and_close( dbc, key, data ); @@ -237,7 +237,7 @@ main( int argc, char **argv ) if ( ldbm_errno( dbc->dbc_db ) == 0 ) { perror( "ldbm_store" ); } else { - fprintf( stderr, "db_errno %d\n", + fprintf( stderr, "db_errno=%d\n", ldbm_errno( dbc->dbc_db ) ); } } @@ -259,7 +259,7 @@ main( int argc, char **argv ) if ( ldbm_errno( dbc->dbc_db ) == 0 ) { perror( "ldbm_store" ); } else { - fprintf( stderr, "db_errno %d\n", + fprintf( stderr, "db_errno=%d\n", ldbm_errno( dbc->dbc_db ) ); } } @@ -647,7 +647,7 @@ print_entry( if ( ldbm_errno( dbp ) == 0 ) perror( msg ); else - fprintf( stderr, "%s: db_errno %d\n", msg, + fprintf( stderr, "%s: db_errno=%d\n", msg, ldbm_errno( dbp ) ); return; } diff --git a/servers/slapd/tools/slapadd.c b/servers/slapd/tools/slapadd.c index 8816cbeaa8..d815e444cb 100644 --- a/servers/slapd/tools/slapadd.c +++ b/servers/slapd/tools/slapadd.c @@ -99,7 +99,7 @@ main( int argc, char **argv ) break; } else if ( verbose ) { - fprintf( stderr, "added: \"%s\" (%08ld)\n", + fprintf( stderr, "added: \"%s\" (%08lx)\n", e->e_dn, (long) id ); } -- 2.39.5