Navigation


Changeset 1010:357c2f892d24 in freeDiameter for libfdcore/fdcore-internal.h


Ignore:
Timestamp:
Mar 26, 2013, 12:39:32 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Implement a new counter on pending answers to send back to a peer.
Function fd_peer_get_load_pending updated to retrieve this counter as well.
When a peer has answers pending, the connection is not immediately teared down
upon DPR/DPA exchange, but a GRACE_TIMEOUT delay (default 1 sec) is granted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/fdcore-internal.h

    r938 r1010  
    7171#endif /* DPR_TIMEOUT */
    7272
     73/* Delai where the connection is maintained opened to allow exchanging remaining pending answers after DPR/DPA */
     74#ifndef GRACE_TIMEOUT
     75#define GRACE_TIMEOUT   1       /* in seconds */
     76#endif /* GRACE_TIMEOUT */
     77
    7378/* The Vendor-Id to advertise in CER/CEA */
    7479#ifndef MY_VENDOR_ID
     
    126131        struct fd_list  srs; /* requests ordered by hop-by-hop id */
    127132        struct fd_list  exp; /* requests that have a timeout set, ordered by timeout */
    128         int             cnt; /* number of requests in the srs list */
     133        long            cnt; /* number of requests in the srs list */
    129134        pthread_mutex_t mtx; /* mutex to protect these lists */
    130135        pthread_cond_t  cnd; /* cond var used by the thread that handles timeouts */
     
    181186        /* Sent requests (for fallback), list of struct sentreq ordered by hbh */
    182187        struct sr_list   p_sr;
     188       
     189        /* Pending received requests not yet answered (count only) */
     190        long             p_reqin_count; /* We use p_state_mtx to protect this value */
    183191       
    184192        /* Data for transitional states before the peer is in OPEN state */
Note: See TracChangeset for help on using the changeset viewer.