summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens2026-05-31 15:25:08 +0000
committerHauke Mehrtens2026-06-07 11:24:28 +0000
commit0ba47f319b09d02d101b234c2d7c53419b929a7a (patch)
tree7d5919b54a29eac21ebeab727d68b8e767f1a53b
parentba1f4311b099969ad70dad93fe493ad9b2180b38 (diff)
downloaduclient-0ba47f319b09d02d101b234c2d7c53419b929a7a.tar.gz
uclient-fetch: advance to the next URL between requests
request_done() decremented n_urls but never advanced the urls pointer, so it always re-read *urls (the first of the remaining URLs). When more than two URLs were given on the command line, the second URL was fetched repeatedly and the third and later URLs were never downloaded. Advance urls alongside the n_urls decrement so each URL is fetched once. Assisted-by: Claude:claude-opus-4-8 Link: https://github.com/openwrt/uclient/pull/16 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--uclient-fetch.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/uclient-fetch.c b/uclient-fetch.c
index efb9b88..b2f61f9 100644
--- a/uclient-fetch.c
+++ b/uclient-fetch.c
@@ -430,6 +430,7 @@ static void request_done(struct uclient *cl)
uclient_set_url(cl, *urls, auth_str);
}
n_urls--;
+ urls++;
cur_resume = resume;
error_ret = init_request(cl);
if (error_ret == 0)