Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (12 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified vendor/current/source3/lib/messages.c

    r414 r740  
    4747
    4848#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"
    5152
    5253struct messaging_callback {
     
    9697****************************************************************************/
    9798
    98 static int traverse_fn(struct db_record *rec,
    99                        const struct connections_key *ckey,
    100                        const struct connections_data *crec,
    101                        void *state)
     99static int traverse_fn(struct db_record *rec, const struct server_id *id,
     100                       uint32_t msg_flags, void *state)
    102101{
    103102        struct msg_all *msg_all = (struct msg_all *)state;
    104103        NTSTATUS status;
    105104
    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) {
    107108                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        }
    113110
    114111        /* If the msg send fails because the pid was not found (i.e. smbd died),
    115112         * the msg has already been deleted from the messages.tdb.*/
    116113
    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,
    119115                                    (uint8 *)msg_all->buf, msg_all->len);
    120116
     
    123119                /* If the pid was not found delete the entry from connections.tdb */
    124120
    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)));
    128122
    129123                rec->delete_rec(rec);
     
    173167        msg_all.msg_ctx = msg_ctx;
    174168
    175         connections_forall(traverse_fn, &msg_all);
     169        serverid_traverse(traverse_fn, &msg_all);
    176170        if (n_sent)
    177171                *n_sent = msg_all.n_sent;
     
    201195
    202196        if (!NT_STATUS_IS_OK(status)) {
    203                 DEBUG(0, ("messaging_tdb_init failed: %s\n",
     197                DEBUG(2, ("messaging_tdb_init failed: %s\n",
    204198                          nt_errstr(status)));
    205199                TALLOC_FREE(ctx);
     
    212206
    213207                if (!NT_STATUS_IS_OK(status)) {
    214                         DEBUG(1, ("messaging_ctdb_init failed: %s\n",
     208                        DEBUG(2, ("messaging_ctdb_init failed: %s\n",
    215209                                  nt_errstr(status)));
    216210                        TALLOC_FREE(ctx);
     
    218212                }
    219213        }
     214        ctx->id.vnn = get_my_vnn();
    220215#endif
    221216
     
    231226}
    232227
     228struct server_id messaging_server_id(const struct messaging_context *msg_ctx)
     229{
     230        return msg_ctx->id;
     231}
     232
    233233/*
    234234 * re-init after a fork
    235235 */
    236 NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
     236NTSTATUS messaging_reinit(struct messaging_context *msg_ctx,
     237                          struct server_id id)
    237238{
    238239        NTSTATUS status;
    239240
    240241        TALLOC_FREE(msg_ctx->local);
     242
     243        msg_ctx->id = id;
    241244
    242245        status = messaging_tdb_init(msg_ctx, msg_ctx, &msg_ctx->local);
     
    361364
    362365/*
    363   Dispatch one messsaging_rec
     366  Dispatch one messaging_rec
    364367*/
    365368void messaging_dispatch_rec(struct messaging_context *msg_ctx,
Note: See TracChangeset for help on using the changeset viewer.