From 8f19f2ec7f272444451ad39df770d55d76227213 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Tue, 23 Jun 2020 14:49:08 +0200 Subject: [PATCH] Skip dead requests. --- source/tristanable/manager.d | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/source/tristanable/manager.d b/source/tristanable/manager.d index 044b420..887d076 100644 --- a/source/tristanable/manager.d +++ b/source/tristanable/manager.d @@ -88,7 +88,15 @@ public final class Manager { for(ulong i = 0; i < requestQueue.length; i++) { - if(requestQueue[i].tag == tag) + /* Get the request */ + Request request = requestQueue[i]; + + /** + * Only if the tag is found then return true + * and if it is the fresh tagged request (not + * ones that are dead using the) same tag. + */ + if(request.isDead == false && request.tag == tag) { return true; } @@ -100,7 +108,16 @@ public final class Manager { for(ulong i = 0; i < requestQueue.length; i++) { - if(requestQueue[i].tag == tag) + /* Get the request */ + Request request = requestQueue[i]; + + /** + * Only if the tag is found then return its + * posistion and if it is the fresh tagged + * request (not ones that are dead using the) + * same tag. + */ + if(request.isDead == false && request.tag == tag) { return i; }