comparison libfdcore/p_sr.c @ 1240:0420ccc4671a

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
author Sebastien Decugis <sdecugis@freediameter.net>
date Thu, 10 Oct 2013 16:30:55 +0200
parents b059b9e8ef83
children c9a160b815ea
comparison
equal deleted inserted replaced
1239:b059b9e8ef83 1240:0420ccc4671a
161 *((uint32_t *)first->chain.o) = first->prevhbh; 161 *((uint32_t *)first->chain.o) = first->prevhbh;
162 162
163 /* Free the sentreq information */ 163 /* Free the sentreq information */
164 fd_list_unlink(&first->chain); 164 fd_list_unlink(&first->chain);
165 srlist->cnt--; 165 srlist->cnt--;
166 srlist->cnt_lost++; /* We are not waiting for this answer anymore, but the remote peer may still be processing it. */
166 fd_list_unlink(&first->expire); 167 fd_list_unlink(&first->expire);
167 free(first); 168 free(first);
168 169
169 no_error = 1; 170 no_error = 1;
170 unlock: 171 unlock:
277 sr = (struct sentreq *)find_or_next(&srlist->srs, hbh, &match); 278 sr = (struct sentreq *)find_or_next(&srlist->srs, hbh, &match);
278 if (!match) { 279 if (!match) {
279 TRACE_DEBUG(INFO, "There is no saved request with this hop-by-hop id (%x)", hbh); 280 TRACE_DEBUG(INFO, "There is no saved request with this hop-by-hop id (%x)", hbh);
280 srl_dump("Current list of SR: ", &srlist->srs); 281 srl_dump("Current list of SR: ", &srlist->srs);
281 *req = NULL; 282 *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 */
282 } else { 286 } else {
283 /* Restore hop-by-hop id */ 287 /* Restore hop-by-hop id */
284 *((uint32_t *)sr->chain.o) = sr->prevhbh; 288 *((uint32_t *)sr->chain.o) = sr->prevhbh;
285 /* Unlink */ 289 /* Unlink */
286 fd_list_unlink(&sr->chain); 290 fd_list_unlink(&sr->chain);
"Welcome to our mercurial repository"