Allow finding which mirror was used to fetch a file.

This makes it a bit easier to debug situations in which mirrors serve
bad files with HTTP 200.

Signed-off-by: Vladimir Panteleev <[email protected]>
---
 lib/libalpm/dload.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 4322318b..022bc7fd 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -427,6 +427,9 @@ static int curl_retry_next_server(CURLM *curlm, CURL *curl, 
struct dload_payload
        len = strlen(server) + strlen(payload->filepath) + 2;
        MALLOC(payload->fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
        snprintf(payload->fileurl, len, "%s/%s", server, payload->filepath);
+       _alpm_log(handle, ALPM_LOG_DEBUG,
+                       "%s: retrying from %s\n",
+                       payload->remote_name, payload->fileurl);
 
 
        fflush(payload->localf);
-- 
2.33.0

Reply via email to