mirror of
https://github.com/curl/curl.git
synced 2026-08-25 20:13:35 +03:00
setopt: add CURLOPT_CURLU
Allows an application to pass in a pre-parsed URL via a URL handle. Closes #3227
This commit is contained in:
parent
073332b525
commit
5c4fe0d826
16 changed files with 310 additions and 9 deletions
|
|
@ -1353,17 +1353,30 @@ void Curl_init_CONNECT(struct Curl_easy *data)
|
|||
CURLcode Curl_pretransfer(struct Curl_easy *data)
|
||||
{
|
||||
CURLcode result;
|
||||
if(!data->change.url) {
|
||||
|
||||
if(!data->change.url && !data->set.uh) {
|
||||
/* we can't do anything without URL */
|
||||
failf(data, "No URL set!");
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
|
||||
/* since the URL may have been redirected in a previous use of this handle */
|
||||
if(data->change.url_alloc) {
|
||||
/* the already set URL is allocated, free it first! */
|
||||
Curl_safefree(data->change.url);
|
||||
data->change.url_alloc = FALSE;
|
||||
}
|
||||
|
||||
if(!data->change.url && data->set.uh) {
|
||||
CURLUcode uc;
|
||||
uc = curl_url_get(data->set.uh,
|
||||
CURLUPART_URL, &data->set.str[STRING_SET_URL], 0);
|
||||
if(uc) {
|
||||
failf(data, "No URL set!");
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
}
|
||||
|
||||
data->change.url = data->set.str[STRING_SET_URL];
|
||||
|
||||
/* Init the SSL session ID cache here. We do it here since we want to do it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue