mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
Merge of REQ_DEBUGLEVEL messaging and debug_count fixes from HEAD.
(This used to be commit abb112ba2a
)
This commit is contained in:
parent
b61f89826f
commit
97027aa5ff
@ -467,26 +467,19 @@ void debug_message_send(pid_t pid, const char *params_str)
|
|||||||
False);
|
False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Return current debug level.
|
Return current debug level.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void debuglevel_message(int msg_type, pid_t src, void *buf, size_t len)
|
static void debuglevel_message(int msg_type, pid_t src, void *buf, size_t len)
|
||||||
{
|
{
|
||||||
char *debug_level_classes;
|
char *message = debug_list_class_names_and_levels();
|
||||||
DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n",(unsigned int)src));
|
|
||||||
|
|
||||||
if ((debug_level_classes = debug_list_class_names_and_levels())) {
|
DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n",(unsigned int)src));
|
||||||
/*{ debug_level_classes = "test:1000";*/
|
message_send_pid(src, MSG_DEBUGLEVEL, message, strlen(message) + 1, True);
|
||||||
message_send_pid(src, MSG_DEBUGLEVEL, debug_level_classes, strlen(debug_level_classes) + 1, True);
|
|
||||||
SAFE_FREE(debug_level_classes);
|
SAFE_FREE(message);
|
||||||
} else {
|
|
||||||
DEBUG(0, ("debuglevel_message: error retrieving class levels!\n"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Init debugging (one time stuff)
|
Init debugging (one time stuff)
|
||||||
@ -627,7 +620,7 @@ BOOL need_to_check_log_size( void )
|
|||||||
{
|
{
|
||||||
int maxlog;
|
int maxlog;
|
||||||
|
|
||||||
if( debug_count++ < 100 )
|
if( debug_count < 100 )
|
||||||
return( False );
|
return( False );
|
||||||
|
|
||||||
maxlog = lp_max_log_size() * 1024;
|
maxlog = lp_max_log_size() * 1024;
|
||||||
@ -712,6 +705,8 @@ void check_log_size( void )
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
int old_errno = errno;
|
int old_errno = errno;
|
||||||
|
|
||||||
|
debug_count++;
|
||||||
|
|
||||||
if( stdout_logging )
|
if( stdout_logging )
|
||||||
{
|
{
|
||||||
va_start( ap, format_str );
|
va_start( ap, format_str );
|
||||||
|
@ -90,16 +90,6 @@ static void ping_message(int msg_type, pid_t src, void *buf, size_t len)
|
|||||||
message_send_pid(src, MSG_PONG, buf, len, True);
|
message_send_pid(src, MSG_PONG, buf, len, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
Return current debug level.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
void debuglevel_message(int msg_type, pid_t src, void *buf, size_t len)
|
|
||||||
{
|
|
||||||
DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n",(unsigned int)src));
|
|
||||||
message_send_pid(src, MSG_DEBUGLEVEL, DEBUGLEVEL_CLASS, sizeof(DEBUGLEVEL_CLASS), True);
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Initialise the messaging functions.
|
Initialise the messaging functions.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -120,7 +110,6 @@ BOOL message_init(void)
|
|||||||
CatchSignal(SIGUSR1, SIGNAL_CAST sig_usr1);
|
CatchSignal(SIGUSR1, SIGNAL_CAST sig_usr1);
|
||||||
|
|
||||||
message_register(MSG_PING, ping_message);
|
message_register(MSG_PING, ping_message);
|
||||||
message_register(MSG_REQ_DEBUGLEVEL, debuglevel_message);
|
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user