Navigation


Changeset 1201:d2608e47db28 in freeDiameter for libfdcore


Ignore:
Timestamp:
Jun 14, 2013, 1:19:32 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Fix issue that can trigger an assert when failover occurs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/peers.c

    r1188 r1201  
    242242        /* Requeue all messages in the "out" queue */
    243243        while ( fd_fifo_tryget(peer->p_tosend, &m) == 0 ) {
    244                 fd_hook_call(HOOK_MESSAGE_FAILOVER, m, peer, NULL, fd_msg_pmdl_get(m));
    245                 CHECK_FCT_DO(fd_fifo_post_noblock(fd_g_outgoing, (void *)&m),
    246                         {
    247                                 /* fallback: destroy the message */
    248                                 fd_hook_call(HOOK_MESSAGE_DROPPED, m, NULL, "Internal error: unable to requeue this message during failover process", fd_msg_pmdl_get(m));
    249                                 CHECK_FCT_DO(fd_msg_free(m), /* What can we do more? */)
    250                         } );
     244                /* but only if they are routable */
     245                if (fd_msg_is_routable(m)) {
     246                        fd_hook_call(HOOK_MESSAGE_FAILOVER, m, peer, NULL, fd_msg_pmdl_get(m));
     247                        CHECK_FCT_DO(fd_fifo_post_noblock(fd_g_outgoing, (void *)&m),
     248                                {
     249                                        /* fallback: destroy the message */
     250                                        fd_hook_call(HOOK_MESSAGE_DROPPED, m, NULL, "Internal error: unable to requeue this message during failover process", fd_msg_pmdl_get(m));
     251                                        CHECK_FCT_DO(fd_msg_free(m), /* What can we do more? */)
     252                                } );
     253                } else {
     254                        /* Just free it */
     255                        /* fd_hook_call(HOOK_MESSAGE_DROPPED, m, NULL, "Non-routable message freed during handover", fd_msg_pmdl_get(m)); */
     256                        CHECK_FCT_DO(fd_msg_free(m), /* What can we do more? */)
     257                }
    251258        }
    252259       
Note: See TracChangeset for help on using the changeset viewer.