Navigation


Changeset 706:4ffbc9f1e922 in freeDiameter for libfdcore/p_sr.c


Ignore:
Timestamp:
Feb 9, 2011, 3:26:58 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Large UNTESTED commit with the following changes:

  • Improved DiameterIdentity? handling (esp. interationalization issues), and improve efficiency of some string operations in peers, sessions, and dictionary modules (closes #7)
  • Cleanup in the session module to free only unreferenced sessions (#16)
  • Removed fd_cpu_flush_cache(), replaced by more robust alternatives.
  • Improved peer state machine algorithm to counter SCTP multistream race condition.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/p_sr.c

    r691 r706  
    3636#include "fdcore-internal.h"
    3737
    38 #ifndef SR_DEBUG_LVL
    39 #define SR_DEBUG_LVL ANNOYING
    40 #endif /* SR_DEBUG_LVL */
    41 
    4238/* Structure to store a sent request */
    4339struct sentreq {
     
    6965        struct fd_list * li;
    7066        struct timespec now;
    71         if (!TRACE_BOOL(SR_DEBUG_LVL))
     67       
     68        if (!TRACE_BOOL(ANNOYING))
    7269                return;
     70       
     71        fd_log_debug("%sSentReq list @%p:\n", text, srlist);
     72       
    7373        CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), );
    74         fd_log_debug("%sSentReq list @%p:\n", text, srlist);
     74       
    7575        for (li = srlist->next; li != srlist; li = li->next) {
    7676                struct sentreq * sr = (struct sentreq *)li;
    7777                uint32_t * nexthbh = li->o;
    78                 fd_log_debug(" - Next req (%x): [since %ld.%06ld sec]\n", *nexthbh,
     78               
     79                fd_log_debug(" - Next req (hbh:%x): [since %ld.%06ld sec]\n", *nexthbh,
    7980                        (now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_sec - sr->added_on.tv_sec) : (now.tv_sec - sr->added_on.tv_sec - 1),
    8081                        (now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_nsec - sr->added_on.tv_nsec) / 1000 : (now.tv_nsec - sr->added_on.tv_nsec + 1000000000) / 1000);
    81                 fd_msg_dump_one(SR_DEBUG_LVL + 1, sr->req);
     82               
     83                fd_msg_dump_one(ANNOYING + 1, sr->req);
    8284        }
    8385}
     
    117119}
    118120
    119 /* thread that handles messages expiring. The thread is started / cancelled only when needed */
     121/* thread that handles messages expiring. The thread is started only when needed */
    120122static void * sr_expiry_th(void * arg) {
    121123        struct sr_list * srlist = arg;
     
    129131        {
    130132                char buf[48];
    131                 sprintf(buf, "ReqExp/%.*s", (int)sizeof(buf) - 8, ((struct fd_peer *)(srlist->exp.o))->p_hdr.info.pi_diamid);
     133                snprintf(buf, sizeof(buf), "ReqExp/%s", ((struct fd_peer *)(srlist->exp.o))->p_hdr.info.pi_diamid);
    132134                fd_log_threadname ( buf );
    133135        }
     
    313315                } else {
    314316                        /* Just free the request. */
    315                         fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, "Local message discarded during failover" );
     317                        fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, "Sent & unanswered local message discarded during failover." );
    316318                        CHECK_FCT_DO(fd_msg_free(sr->req), /* Ignore */);
    317319                }
Note: See TracChangeset for help on using the changeset viewer.