Curl_follow: return better errors on URL problems

... by making the converter function global and accessible.

Closes #3153
This commit is contained in:
Daniel Stenberg 2018-10-22 00:09:49 +02:00
parent ca10fae6fc
commit 6535b9303d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 12 additions and 13 deletions

View file

@ -1516,13 +1516,11 @@ CURLcode Curl_follow(struct Curl_easy *data,
DEBUGASSERT(data->state.uh);
uc = curl_url_set(data->state.uh, CURLUPART_URL, newurl, 0);
if(uc)
/* TODO: consider an error code remap here */
return CURLE_URL_MALFORMAT;
return Curl_uc_to_curlcode(uc);
uc = curl_url_get(data->state.uh, CURLUPART_URL, &newurl, 0);
if(uc)
/* TODO: consider an error code remap here */
return CURLE_OUT_OF_MEMORY;
return Curl_uc_to_curlcode(uc);
if(type == FOLLOW_FAKE) {
/* we're only figuring out the new url if we would've followed locations