Ignore:
Timestamp:
May 27, 2009, 11:39:15 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/lib/messages.c

    r133 r233  
    279279
    280280        for (cb = msg_ctx->callbacks; cb != NULL; cb = cb->next) {
    281                 if (cb->msg_type == msg_type) {
     281                /* we allow a second registration of the same message
     282                   type if it has a different private pointer. This is
     283                   needed in, for example, the internal notify code,
     284                   which creates a new notify context for each tree
     285                   connect, and expects to receive messages to each of
     286                   them. */
     287                if (cb->msg_type == msg_type && private_data == cb->private_data) {
     288                        DEBUG(5,("Overriding messaging pointer for type %u - private_data=%p\n",
     289                                  (unsigned)msg_type, private_data));
    282290                        cb->fn = fn;
    283291                        cb->private_data = private_data;
     
    310318                if ((cb->msg_type == msg_type)
    311319                    && (cb->private_data == private_data)) {
     320                        DEBUG(5,("Deregistering messaging pointer for type %u - private_data=%p\n",
     321                                  (unsigned)msg_type, private_data));
    312322                        DLIST_REMOVE(ctx->callbacks, cb);
    313323                        TALLOC_FREE(cb);
     
    355365                        cb->fn(msg_ctx, cb->private_data, rec->msg_type,
    356366                               rec->src, &rec->buf);
    357                         return;
     367                        /* we continue looking for matching messages
     368                           after finding one. This matters for
     369                           subsystems like the internal notify code
     370                           which register more than one handler for
     371                           the same message type */
    358372                }
    359373        }
Note: See TracChangeset for help on using the changeset viewer.