[PATCH] Fix broken slot reuse when fetching alternates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When fetching alternates, http-fetch may reuse the slot to fetch non-http
alternates if http-alternates does not exist.  When doing so, it now needs
to update the slot's finished status so run_active_slot waits for the
non-http alternates request to finish.

Signed-off-by: Nick Hengeveld <nickh@xxxxxxxxxxxx>


---

 http-fetch.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

e0e27549c5cbc85639f7d329a8a900ca7243130c
diff --git a/http-fetch.c b/http-fetch.c
index 8fd9de0..7de818b 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -468,9 +468,13 @@ static void process_alternates_response(
 					 alt_req->url);
 			active_requests++;
 			slot->in_use = 1;
+			if (slot->finished != NULL)
+				(*slot->finished) = 0;
 			if (!start_active_slot(slot)) {
 				got_alternates = -1;
 				slot->in_use = 0;
+				if (slot->finished != NULL)
+					(*slot->finished) = 1;
 			}
 			return;
 		}
-- 
1.2.4.gea75-dirty

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]