Navigation


Changeset 938:4158151cc694 in freeDiameter


Ignore:
Timestamp:
Mar 12, 2013, 11:27:30 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Add counter for number of requests pending answers

Location:
libfdcore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/fdcore-internal.h

    r928 r938  
    126126        struct fd_list  srs; /* requests ordered by hop-by-hop id */
    127127        struct fd_list  exp; /* requests that have a timeout set, ordered by timeout */
     128        int             cnt; /* number of requests in the srs list */
    128129        pthread_mutex_t mtx; /* mutex to protect these lists */
    129130        pthread_cond_t  cnd; /* cond var used by the thread that handles timeouts */
  • libfdcore/p_sr.c

    r837 r938  
    226226        *req = NULL;
    227227        fd_list_insert_before(next, &sr->chain);
     228        srlist->cnt++;
    228229        srl_dump("Saved new request, ", &srlist->srs);
    229230       
     
    281282                /* Unlink */
    282283                fd_list_unlink(&sr->chain);
     284                srlist->cnt--;
    283285                fd_list_unlink(&sr->expire);
    284286                *req = sr->req;
     
    300302                struct sentreq * sr = (struct sentreq *)(srlist->srs.next);
    301303                fd_list_unlink(&sr->chain);
     304                srlist->cnt--;
    302305                fd_list_unlink(&sr->expire);
    303306                if (fd_msg_is_routable(sr->req)) {
Note: See TracChangeset for help on using the changeset viewer.