{"thread":{"id":"3651","subject":"[PATCH] Fix broken slot reuse when fetching alternates","startedAt":"2006-03-15T16:59:52Z","lastAt":"2006-03-15T16:59:52Z","messageCount":1,"participants":["Nick Hengeveld"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"17566","messageId":"20060315165952.GK3997@reactrix.com","threadId":"3651","inReplyTo":null,"subject":"[PATCH] Fix broken slot reuse when fetching alternates","fromName":"Nick Hengeveld","fromEmail":"nickh@reactrix.com","sentAt":"2006-03-15T16:59:52Z","receivedAt":"2006-03-15T16:59:52Z","isPatch":true,"sender":{"key":"nickh@reactrix.com","avatar":null},"body":"When fetching alternates, http-fetch may reuse the slot to fetch non-http\nalternates if http-alternates does not exist.  When doing so, it now needs\nto update the slot's finished status so run_active_slot waits for the\nnon-http alternates request to finish.\n\nSigned-off-by: Nick Hengeveld <nickh@reactrix.com>\n\n\n---\n\n http-fetch.c |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ne0e27549c5cbc85639f7d329a8a900ca7243130c\ndiff --git a/http-fetch.c b/http-fetch.c\nindex 8fd9de0..7de818b 100644\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -468,9 +468,13 @@ static void process_alternates_response(\n \t\t\t\t\t alt_req->url);\n \t\t\tactive_requests++;\n \t\t\tslot->in_use = 1;\n+\t\t\tif (slot->finished != NULL)\n+\t\t\t\t(*slot->finished) = 0;\n \t\t\tif (!start_active_slot(slot)) {\n \t\t\t\tgot_alternates = -1;\n \t\t\t\tslot->in_use = 0;\n+\t\t\t\tif (slot->finished != NULL)\n+\t\t\t\t\t(*slot->finished) = 1;\n \t\t\t}\n \t\t\treturn;\n \t\t}\n-- \n1.2.4.gea75-dirty\n"}]}