diff --git a/btpd/peer.c b/btpd/peer.c index d73b79c..f40e3c1 100644 --- a/btpd/peer.c +++ b/btpd/peer.c @@ -92,6 +92,7 @@ again: net_send_cancel(p, req); BTPDQ_REMOVE(&p->my_reqs, req, entry); free(req); + p->nreqs_out--; goto again; } } diff --git a/btpd/policy_subr.c b/btpd/policy_subr.c index 598f541..269d238 100644 --- a/btpd/policy_subr.c +++ b/btpd/policy_subr.c @@ -443,6 +443,7 @@ cm_unassign_requests(struct peer *p) } assert(BTPDQ_EMPTY(&p->my_reqs)); + p->nreqs_out = 0; }