mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-27 03:20:22 +08:00
handle errors
This commit is contained in:
parent
67f3fd8078
commit
40cabdc0bc
@ -129,13 +129,19 @@ monitor_subsys_thread_init(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LDAP_PVT_THREAD_POOL_PARAM_STATE:
|
case LDAP_PVT_THREAD_POOL_PARAM_STATE:
|
||||||
ldap_pvt_thread_pool_query( &connection_pool,
|
if ( ldap_pvt_thread_pool_query( &connection_pool,
|
||||||
mt[ i ].param, (void *)&state );
|
mt[ i ].param, (void *)&state ) == 0 )
|
||||||
ber_str2bv( state, 0, 0, &bv );
|
{
|
||||||
|
ber_str2bv( state, 0, 0, &bv );
|
||||||
|
|
||||||
|
} else {
|
||||||
|
BER_BVSTR( &bv, "unknown" );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ldap_pvt_thread_pool_query( &connection_pool,
|
/* NOTE: in case of error, it'll be set to -1 */
|
||||||
|
(void)ldap_pvt_thread_pool_query( &connection_pool,
|
||||||
mt[ i ].param, (void *)&count );
|
mt[ i ].param, (void *)&count );
|
||||||
bv.bv_val = buf;
|
bv.bv_val = buf;
|
||||||
bv.bv_len = snprintf( buf, sizeof( buf ), "%d", count );
|
bv.bv_len = snprintf( buf, sizeof( buf ), "%d", count );
|
||||||
@ -276,25 +282,27 @@ monitor_subsys_thread_update(
|
|||||||
if ( a == NULL ) {
|
if ( a == NULL ) {
|
||||||
return rs->sr_err = LDAP_OTHER;
|
return rs->sr_err = LDAP_OTHER;
|
||||||
}
|
}
|
||||||
ldap_pvt_thread_pool_query( &connection_pool,
|
if ( ldap_pvt_thread_pool_query( &connection_pool,
|
||||||
mt[ i ].param, (void *)&state );
|
mt[ i ].param, (void *)&state ) == 0 )
|
||||||
ber_str2bv( state, 0, 0, &bv );
|
{
|
||||||
ber_bvreplace( &a->a_vals[ 0 ], &bv );
|
ber_str2bv( state, 0, 0, &bv );
|
||||||
|
ber_bvreplace( &a->a_vals[ 0 ], &bv );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ( a == NULL ) {
|
if ( a == NULL ) {
|
||||||
return rs->sr_err = LDAP_OTHER;
|
return rs->sr_err = LDAP_OTHER;
|
||||||
}
|
}
|
||||||
ldap_pvt_thread_pool_query( &connection_pool,
|
if ( ldap_pvt_thread_pool_query( &connection_pool,
|
||||||
mt[ i ].param, (void *)&count );
|
mt[ i ].param, (void *)&count ) == 0 )
|
||||||
bv.bv_val = buf;
|
{
|
||||||
bv.bv_len = snprintf( buf, sizeof( buf ), "%d", count );
|
bv.bv_val = buf;
|
||||||
if ( bv.bv_len >= sizeof( buf ) ) {
|
bv.bv_len = snprintf( buf, sizeof( buf ), "%d", count );
|
||||||
/* FIXME? */
|
if ( bv.bv_len < sizeof( buf ) ) {
|
||||||
break;
|
ber_bvreplace( &a->a_vals[ 0 ], &bv );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ber_bvreplace( &a->a_vals[ 0 ], &bv );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user