aboutsummaryrefslogtreecommitdiff
path: root/src/tool_getparam.c
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-06-30 21:17:44 +0900
committerYang Tse <yangsita@gmail.com>2012-07-02 16:28:01 +0200
commit89b431f60fd4d0a91ac120fbb78641f887671606 (patch)
tree02614ff44f8e3dc4cb3a9f67c7beb8606472810f /src/tool_getparam.c
parent4e3320a679d3051d17048c50330f4b4cbe229855 (diff)
curl: Added runtime version check for libmetalink
Diffstat (limited to 'src/tool_getparam.c')
-rw-r--r--src/tool_getparam.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 4bdf0a59d..c9c6198ff 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -824,7 +824,21 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
case 'J': /* --metalink */
{
#ifdef USE_METALINK
- config->use_metalink = toggle;
+ int major, minor, patch;
+ metalink_get_version(&major, &minor, &patch);
+ if((major*10000)+(minor*100)+patch < CURL_REQ_LIBMETALINK_VERS) {
+ warnf(config,
+ "--metalink option cannot be used because the version of "
+ "the linked libmetalink library is too old. "
+ "Required: %d.%d.%d, found %d.%d.%d\n",
+ CURL_REQ_LIBMETALINK_MAJOR,
+ CURL_REQ_LIBMETALINK_MINOR,
+ CURL_REQ_LIBMETALINK_PATCH,
+ major, minor, patch);
+ return PARAM_BAD_USE;
+ }
+ else
+ config->use_metalink = toggle;
#else
warnf(config, "--metalink option is ignored because the binary is "
"built without the Metalink support.\n");