diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-05-15 15:41:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:22:07 -0500 |
commit | 6669aa051e6e2e3cb79cb4e4b97c2dcd4e31d02b (patch) | |
tree | df32aeffcef5816f8ab08a8d0a79132961b7649c /source3/lib/debug.c | |
parent | 84758bd1f8633d3efe30e293887596db6bfd5e5b (diff) | |
download | samba-6669aa051e6e2e3cb79cb4e4b97c2dcd4e31d02b.tar.gz samba-6669aa051e6e2e3cb79cb4e4b97c2dcd4e31d02b.tar.bz2 samba-6669aa051e6e2e3cb79cb4e4b97c2dcd4e31d02b.zip |
r22910: Make message_send_pid static to messages.c
(This used to be commit 27224922cf964cc70aad7cf529ab6c03fb277a89)
Diffstat (limited to 'source3/lib/debug.c')
-rw-r--r-- | source3/lib/debug.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c index 5ef07f806b..049ef5cfa4 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -471,13 +471,16 @@ BOOL debug_parse_levels(const char *params_str) Receive a "set debug level" message. ****************************************************************************/ -static void debug_message(int msg_type, struct server_id src, - void *buf, size_t len, void *private_data) +static void debug_message(struct messaging_context *msg_ctx, + void *private_data, + uint32_t msg_type, + struct server_id src, + DATA_BLOB *data) { - const char *params_str = (const char *)buf; + const char *params_str = (const char *)data->data; /* Check, it's a proper string! */ - if (params_str[len-1] != '\0') { + if (params_str[(data->length)-1] != '\0') { DEBUG(1, ("Invalid debug message from pid %u to pid %u\n", (unsigned int)procid_to_pid(&src), (unsigned int)getpid())); @@ -495,8 +498,11 @@ static void debug_message(int msg_type, struct server_id src, Return current debug level. ****************************************************************************/ -static void debuglevel_message(int msg_type, struct server_id src, - void *buf, size_t len, void *private_data) +static void debuglevel_message(struct messaging_context *msg_ctx, + void *private_data, + uint32_t msg_type, + struct server_id src, + DATA_BLOB *data) { char *message = debug_list_class_names_and_levels(); @@ -505,9 +511,10 @@ static void debuglevel_message(int msg_type, struct server_id src, return; } - DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n", - (unsigned int)procid_to_pid(&src))); - message_send_pid(src, MSG_DEBUGLEVEL, message, strlen(message) + 1, True); + DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %s\n", + procid_str_static(&src))); + messaging_send_buf(msg_ctx, src, MSG_DEBUGLEVEL, + (uint8 *)message, strlen(message) + 1); SAFE_FREE(message); } @@ -531,10 +538,11 @@ void debug_init(void) } } -void debug_register_msgs(void) +void debug_register_msgs(struct messaging_context *msg_ctx) { - message_register(MSG_DEBUG, debug_message, NULL); - message_register(MSG_REQ_DEBUGLEVEL, debuglevel_message, NULL); + messaging_register(msg_ctx, NULL, MSG_DEBUG, debug_message); + messaging_register(msg_ctx, NULL, MSG_REQ_DEBUGLEVEL, + debuglevel_message); } /*************************************************************************** |