Navigation


Changeset 1240:0420ccc4671a in freeDiameter for libfdcore


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

Add a counter for the sent requests for which we did not wait for an answer. It might be relevant this value contributes to the load estimate of the remote peer, but it is not very reliable

Location:
libfdcore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/fdcore-internal.h

    r1238 r1240  
    130130        struct fd_list  exp; /* requests that have a timeout set, ordered by timeout */
    131131        long            cnt; /* number of requests in the srs list */
     132        long            cnt_lost; /* number of requests that have not been answered in time.
     133                                     It is decremented when an unexpected answer is received, so this may not be accurate. */
    132134        pthread_mutex_t mtx; /* mutex to protect these lists */
    133135        pthread_cond_t  cnd; /* cond var used by the thread that handles timeouts */
  • libfdcore/p_sr.c

    r1239 r1240  
    164164                fd_list_unlink(&first->chain);
    165165                srlist->cnt--;
     166                srlist->cnt_lost++; /* We are not waiting for this answer anymore, but the remote peer may still be processing it. */
    166167                fd_list_unlink(&first->expire);
    167168                free(first);
     
    280281                srl_dump("Current list of SR: ", &srlist->srs);
    281282                *req = NULL;
     283                if (srlist->cnt_lost > 0) {
     284                        srlist->cnt_lost--; /* This is probably an answer for a request we already timedout. */
     285                } /* else, probably a bug in the remote peer */
    282286        } else {
    283287                /* Restore hop-by-hop id */
Note: See TracChangeset for help on using the changeset viewer.