From 6535b9303df83eb3f1e95fded0d778e51d9aa50c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 22 Oct 2018 00:09:49 +0200 Subject: Curl_follow: return better errors on URL problems ... by making the converter function global and accessible. Closes #3153 --- lib/transfer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/transfer.c') diff --git a/lib/transfer.c b/lib/transfer.c index e6d98cfa4..c7f4ef9f3 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -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 -- cgit v1.2.3