Commit 8ead8c5f authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Clean up debug messages.

parent ac0e7c1d
......@@ -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,
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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");
......
......@@ -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 );
......
......@@ -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 ] );
}
......
......@@ -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;
}
......
......@@ -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 );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment