aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-07-03 23:52:10 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-07-03 23:52:10 +0200
commitb3786f61dc53adba67dd489e404dc68a4b26575e (patch)
tree3c13b7b8b4bd9b591052b35a9acb60feed648755 /lib
parentc0cdc68c7eacaa4fda3e2324f8618b6bbe038983 (diff)
url: make the original string get used on subsequent transfers
... since CURLOPT_URL should follow the same rules as other options: they remain set until changed or cleared. Added test 1551 to verify. Fixes #1631 Closes #1632 Reported-by: Pavel Rochnyak
Diffstat (limited to 'lib')
-rw-r--r--lib/transfer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 43e8f64aa..81c056e0e 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1288,6 +1288,13 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
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;
+ }
+ 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
after the *_setopt() calls (that could specify the size of the cache) but