mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
esx: Bump minimal version of curl
According to meson.build the minimal version of curl needed is 7.18.0 which was released in January 2008. If the minimal version is bumped to 7.19.1 (released in November 2008) we can drop some workarounds because this newer version provides APIs we need. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
cf325da1f8
commit
1f8e6a6172
@ -1001,7 +1001,7 @@ if capng_dep.found()
|
|||||||
conf.set('WITH_CAPNG', 1)
|
conf.set('WITH_CAPNG', 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
curl_version = '7.18.0'
|
curl_version = '7.19.1'
|
||||||
curl_dep = dependency('libcurl', version: '>=' + curl_version, required: get_option('curl'))
|
curl_dep = dependency('libcurl', version: '>=' + curl_version, required: get_option('curl'))
|
||||||
if curl_dep.found()
|
if curl_dep.found()
|
||||||
# XXX as of libcurl-devel-7.20.1-3.fc13.x86_64, curl ships a version
|
# XXX as of libcurl-devel-7.20.1-3.fc13.x86_64, curl ships a version
|
||||||
|
@ -396,7 +396,6 @@ esxStreamOpen(virStreamPtr stream, esxPrivate *priv, const char *url,
|
|||||||
int result = -1;
|
int result = -1;
|
||||||
esxStreamPrivate *streamPriv;
|
esxStreamPrivate *streamPriv;
|
||||||
g_autofree char *range = NULL;
|
g_autofree char *range = NULL;
|
||||||
g_autofree char *userpwd = NULL;
|
|
||||||
esxVI_MultiCURL *multi = NULL;
|
esxVI_MultiCURL *multi = NULL;
|
||||||
|
|
||||||
/* FIXME: Although there is already some code in place to deal with
|
/* FIXME: Although there is already some code in place to deal with
|
||||||
@ -438,17 +437,10 @@ esxStreamOpen(virStreamPtr stream, esxPrivate *priv, const char *url,
|
|||||||
curl_easy_setopt(streamPriv->curl->handle, CURLOPT_URL, url);
|
curl_easy_setopt(streamPriv->curl->handle, CURLOPT_URL, url);
|
||||||
curl_easy_setopt(streamPriv->curl->handle, CURLOPT_RANGE, range);
|
curl_easy_setopt(streamPriv->curl->handle, CURLOPT_RANGE, range);
|
||||||
|
|
||||||
#if LIBCURL_VERSION_NUM >= 0x071301 /* 7.19.1 */
|
|
||||||
curl_easy_setopt(streamPriv->curl->handle, CURLOPT_USERNAME,
|
curl_easy_setopt(streamPriv->curl->handle, CURLOPT_USERNAME,
|
||||||
priv->primary->username);
|
priv->primary->username);
|
||||||
curl_easy_setopt(streamPriv->curl->handle, CURLOPT_PASSWORD,
|
curl_easy_setopt(streamPriv->curl->handle, CURLOPT_PASSWORD,
|
||||||
priv->primary->password);
|
priv->primary->password);
|
||||||
#else
|
|
||||||
userpwd = g_strdup_printf("%s:%s", priv->primary->username,
|
|
||||||
priv->primary->password);
|
|
||||||
|
|
||||||
curl_easy_setopt(streamPriv->curl->handle, CURLOPT_USERPWD, userpwd);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (esxVI_MultiCURL_Alloc(&multi) < 0 ||
|
if (esxVI_MultiCURL_Alloc(&multi) < 0 ||
|
||||||
esxVI_MultiCURL_Add(multi, streamPriv->curl) < 0)
|
esxVI_MultiCURL_Add(multi, streamPriv->curl) < 0)
|
||||||
|
@ -230,9 +230,7 @@ esxVI_CURL_Perform(esxVI_CURL *curl, const char *url)
|
|||||||
{
|
{
|
||||||
CURLcode errorCode;
|
CURLcode errorCode;
|
||||||
long responseCode = 0;
|
long responseCode = 0;
|
||||||
#if LIBCURL_VERSION_NUM >= 0x071202 /* 7.18.2 */
|
|
||||||
const char *redirectUrl = NULL;
|
const char *redirectUrl = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
errorCode = curl_easy_perform(curl->handle);
|
errorCode = curl_easy_perform(curl->handle);
|
||||||
|
|
||||||
@ -262,7 +260,6 @@ esxVI_CURL_Perform(esxVI_CURL *curl, const char *url)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (responseCode == 301) {
|
if (responseCode == 301) {
|
||||||
#if LIBCURL_VERSION_NUM >= 0x071202 /* 7.18.2 */
|
|
||||||
errorCode = curl_easy_getinfo(curl->handle, CURLINFO_REDIRECT_URL,
|
errorCode = curl_easy_getinfo(curl->handle, CURLINFO_REDIRECT_URL,
|
||||||
&redirectUrl);
|
&redirectUrl);
|
||||||
|
|
||||||
@ -277,10 +274,6 @@ esxVI_CURL_Perform(esxVI_CURL *curl, const char *url)
|
|||||||
_("The server redirects from '%s' to '%s'"), url,
|
_("The server redirects from '%s' to '%s'"), url,
|
||||||
redirectUrl);
|
redirectUrl);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("The server redirects from '%s'"), url);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user