Mercurial > hg > freeDiameter
diff libfdcore/p_sr.c @ 938:4158151cc694
Add counter for number of requests pending answers
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Tue, 12 Mar 2013 15:27:30 +0100 |
parents | 1d2721778c7a |
children | 2091bf698fb1 |
line wrap: on
line diff
--- a/libfdcore/p_sr.c Sun Mar 10 04:24:36 2013 +0100 +++ b/libfdcore/p_sr.c Tue Mar 12 15:27:30 2013 +0100 @@ -225,6 +225,7 @@ /* Save in the list */ *req = NULL; fd_list_insert_before(next, &sr->chain); + srlist->cnt++; srl_dump("Saved new request, ", &srlist->srs); /* In case of request with a timeout, also store in the timeout list */ @@ -280,6 +281,7 @@ *((uint32_t *)sr->chain.o) = sr->prevhbh; /* Unlink */ fd_list_unlink(&sr->chain); + srlist->cnt--; fd_list_unlink(&sr->expire); *req = sr->req; free(sr); @@ -299,6 +301,7 @@ while (!FD_IS_LIST_EMPTY(&srlist->srs)) { struct sentreq * sr = (struct sentreq *)(srlist->srs.next); fd_list_unlink(&sr->chain); + srlist->cnt--; fd_list_unlink(&sr->expire); if (fd_msg_is_routable(sr->req)) { struct msg_hdr * hdr = NULL;