diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-07-02 22:56:55 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-07-02 22:56:55 +0200 |
commit | 9e59606cd61a77bd82a45001aad241e13f09c971 (patch) | |
tree | 9f56ef11a649bc9019cf7de9496e16661d6d426c /lib/transfer.c | |
parent | 4fc6ebe18a607764194ee23e5aa898a027fe3c60 (diff) | |
download | curl-bagder/make-URL-stick.tar.gz |
url: make the original string get used on subsequent transfersbagder/make-URL-stick
... 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
Reported-by: Pavel Rochnyak
Diffstat (limited to 'lib/transfer.c')
-rw-r--r-- | lib/transfer.c | 7 |
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 |