curl: Added runtime version check for libmetalink
This commit is contained in:
committed by
Yang Tse
parent
4e3320a679
commit
89b431f60f
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user