diff options
Diffstat (limited to 'source3/lib/messages.c')
-rw-r--r-- | source3/lib/messages.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 5e11dd4e25..2fcdc24179 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -95,36 +95,29 @@ struct msg_all { Send one of the messages for the broadcast. ****************************************************************************/ -static int traverse_fn(struct db_record *rec, - const struct connections_key *ckey, - const struct connections_data *crec, - void *state) +static int traverse_fn(struct db_record *rec, const struct server_id *id, + uint32_t msg_flags, void *state) { struct msg_all *msg_all = (struct msg_all *)state; NTSTATUS status; - if (crec->cnum != -1) - return 0; - /* Don't send if the receiver hasn't registered an interest. */ - if(!(crec->bcast_msg_flags & msg_all->msg_flag)) + if((msg_flags & msg_all->msg_flag) == 0) { return 0; + } /* If the msg send fails because the pid was not found (i.e. smbd died), * the msg has already been deleted from the messages.tdb.*/ - status = messaging_send_buf(msg_all->msg_ctx, - crec->pid, msg_all->msg_type, + status = messaging_send_buf(msg_all->msg_ctx, *id, msg_all->msg_type, (uint8 *)msg_all->buf, msg_all->len); if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) { /* If the pid was not found delete the entry from connections.tdb */ - DEBUG(2,("pid %s doesn't exist - deleting connections %d [%s]\n", - procid_str_static(&crec->pid), crec->cnum, - crec->servicename)); + DEBUG(2, ("pid %s doesn't exist\n", procid_str_static(id))); rec->delete_rec(rec); } @@ -172,7 +165,7 @@ bool message_send_all(struct messaging_context *msg_ctx, msg_all.n_sent = 0; msg_all.msg_ctx = msg_ctx; - connections_forall(traverse_fn, &msg_all); + serverid_traverse(traverse_fn, &msg_all); if (n_sent) *n_sent = msg_all.n_sent; return True; |