aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2012-09-12 00:09:23 +0200
committerMarc Hoersken <info@marc-hoersken.de>2012-09-12 00:09:23 +0200
commita34197ef77cb9fcc754a84d2f58c006766bb150c (patch)
treeb9bef7c771bfb0df69390e0a3ba16c4bec51c2c4 /src
parent7f7e2ea72f2471a20060024d6a2d8377d21bcba9 (diff)
tool_metalink.c: Added name of validation hash to messages
This makes it easier to debug broken hashes or hash functions.
Diffstat (limited to 'src')
-rw-r--r--src/tool_metalink.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tool_metalink.c b/src/tool_metalink.c
index 279a626cb..316392781 100644
--- a/src/tool_metalink.c
+++ b/src/tool_metalink.c
@@ -442,8 +442,8 @@ static int check_hash(const char *filename,
fd = open(filename, flags);
if(fd == -1) {
- fprintf(error, "Metalink: validating (%s) FAILED (%s)\n", filename,
- strerror(errno));
+ fprintf(error, "Metalink: validating (%s) [%s] FAILED (%s)\n", filename,
+ digest_def->hash_name, strerror(errno));
return -1;
}
dctx = Curl_digest_init(digest_def->dparams);
@@ -455,8 +455,8 @@ static int check_hash(const char *filename,
break;
}
else if(len == -1) {
- fprintf(error, "Metalink: validating (%s) FAILED (%s)\n", filename,
- strerror(errno));
+ fprintf(error, "Metalink: validating (%s) [%s] FAILED (%s)\n", filename,
+ digest_def->hash_name, strerror(errno));
Curl_digest_final(dctx, result);
close(fd);
return -1;
@@ -468,10 +468,11 @@ static int check_hash(const char *filename,
digest_def->dparams->digest_resultlen) == 0;
/* sha*sum style verdict output */
if(check_ok)
- fprintf(error, "Metalink: validating (%s) OK\n", filename);
+ fprintf(error, "Metalink: validating (%s) [%s] OK\n", filename,
+ digest_def->hash_name);
else
- fprintf(error, "Metalink: validating (%s) FAILED (digest mismatch)\n",
- filename);
+ fprintf(error, "Metalink: validating (%s) [%s] FAILED (digest mismatch)\n",
+ filename, digest_def->hash_name);
free(result);
close(fd);