Changeset 740 for vendor/current/source3/lib/messages.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified vendor/current/source3/lib/messages.c ¶
r414 r740 47 47 48 48 #include "includes.h" 49 #include "librpc/gen_ndr/messaging.h" 50 #include "librpc/gen_ndr/ndr_messaging.h" 49 #include "dbwrap.h" 50 #include "serverid.h" 51 #include "messages.h" 51 52 52 53 struct messaging_callback { … … 96 97 ****************************************************************************/ 97 98 98 static int traverse_fn(struct db_record *rec, 99 const struct connections_key *ckey, 100 const struct connections_data *crec, 101 void *state) 99 static int traverse_fn(struct db_record *rec, const struct server_id *id, 100 uint32_t msg_flags, void *state) 102 101 { 103 102 struct msg_all *msg_all = (struct msg_all *)state; 104 103 NTSTATUS status; 105 104 106 if (crec->cnum != -1) 105 /* Don't send if the receiver hasn't registered an interest. */ 106 107 if((msg_flags & msg_all->msg_flag) == 0) { 107 108 return 0; 108 109 /* Don't send if the receiver hasn't registered an interest. */ 110 111 if(!(crec->bcast_msg_flags & msg_all->msg_flag)) 112 return 0; 109 } 113 110 114 111 /* If the msg send fails because the pid was not found (i.e. smbd died), 115 112 * the msg has already been deleted from the messages.tdb.*/ 116 113 117 status = messaging_send_buf(msg_all->msg_ctx, 118 crec->pid, msg_all->msg_type, 114 status = messaging_send_buf(msg_all->msg_ctx, *id, msg_all->msg_type, 119 115 (uint8 *)msg_all->buf, msg_all->len); 120 116 … … 123 119 /* If the pid was not found delete the entry from connections.tdb */ 124 120 125 DEBUG(2,("pid %s doesn't exist - deleting connections %d [%s]\n", 126 procid_str_static(&crec->pid), crec->cnum, 127 crec->servicename)); 121 DEBUG(2, ("pid %s doesn't exist\n", procid_str_static(id))); 128 122 129 123 rec->delete_rec(rec); … … 173 167 msg_all.msg_ctx = msg_ctx; 174 168 175 connections_forall(traverse_fn, &msg_all);169 serverid_traverse(traverse_fn, &msg_all); 176 170 if (n_sent) 177 171 *n_sent = msg_all.n_sent; … … 201 195 202 196 if (!NT_STATUS_IS_OK(status)) { 203 DEBUG( 0, ("messaging_tdb_init failed: %s\n",197 DEBUG(2, ("messaging_tdb_init failed: %s\n", 204 198 nt_errstr(status))); 205 199 TALLOC_FREE(ctx); … … 212 206 213 207 if (!NT_STATUS_IS_OK(status)) { 214 DEBUG( 1, ("messaging_ctdb_init failed: %s\n",208 DEBUG(2, ("messaging_ctdb_init failed: %s\n", 215 209 nt_errstr(status))); 216 210 TALLOC_FREE(ctx); … … 218 212 } 219 213 } 214 ctx->id.vnn = get_my_vnn(); 220 215 #endif 221 216 … … 231 226 } 232 227 228 struct server_id messaging_server_id(const struct messaging_context *msg_ctx) 229 { 230 return msg_ctx->id; 231 } 232 233 233 /* 234 234 * re-init after a fork 235 235 */ 236 NTSTATUS messaging_reinit(struct messaging_context *msg_ctx) 236 NTSTATUS messaging_reinit(struct messaging_context *msg_ctx, 237 struct server_id id) 237 238 { 238 239 NTSTATUS status; 239 240 240 241 TALLOC_FREE(msg_ctx->local); 242 243 msg_ctx->id = id; 241 244 242 245 status = messaging_tdb_init(msg_ctx, msg_ctx, &msg_ctx->local); … … 361 364 362 365 /* 363 Dispatch one mess saging_rec366 Dispatch one messaging_rec 364 367 */ 365 368 void messaging_dispatch_rec(struct messaging_context *msg_ctx,
Note:
See TracChangeset
for help on using the changeset viewer.