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
}
-static CURLcode uc_to_curlcode(CURLUcode uc)
+CURLcode Curl_uc_to_curlcode(CURLUcode uc)
{
switch(uc) {
default:
CURLU_DISALLOW_USER : 0) |
(data->set.path_as_is ? CURLU_PATH_AS_IS : 0));
if(uc)
- return uc_to_curlcode(uc);
+ return Curl_uc_to_curlcode(uc);
uc = curl_url_get(uh, CURLUPART_SCHEME, &data->state.up.scheme, 0);
if(uc)
- return uc_to_curlcode(uc);
+ return Curl_uc_to_curlcode(uc);
result = findprotocol(data, conn, data->state.up.scheme);
if(result)
conn->bits.user_passwd = TRUE;
}
else if(uc != CURLUE_NO_USER)
- return uc_to_curlcode(uc);
+ return Curl_uc_to_curlcode(uc);
uc = curl_url_get(uh, CURLUPART_PASSWORD, &data->state.up.password,
CURLU_URLDECODE);
conn->bits.user_passwd = TRUE;
}
else if(uc != CURLUE_NO_PASSWORD)
- return uc_to_curlcode(uc);
+ return Curl_uc_to_curlcode(uc);
uc = curl_url_get(uh, CURLUPART_OPTIONS, &data->state.up.options,
CURLU_URLDECODE);
return CURLE_OUT_OF_MEMORY;
}
else if(uc != CURLUE_NO_OPTIONS)
- return uc_to_curlcode(uc);
+ return Curl_uc_to_curlcode(uc);
uc = curl_url_get(uh, CURLUPART_HOST, &data->state.up.hostname, 0);
if(uc) {
uc = curl_url_get(uh, CURLUPART_PATH, &data->state.up.path, 0);
if(uc)
- return uc_to_curlcode(uc);
+ return Curl_uc_to_curlcode(uc);
uc = curl_url_get(uh, CURLUPART_PORT, &data->state.up.port,
CURLU_DEFAULT_PORT);
if(user_changed) {
uc = curl_url_set(data->state.uh, CURLUPART_USER, *userp, 0);
if(uc)
- return uc_to_curlcode(uc);
+ return Curl_uc_to_curlcode(uc);
}
if(passwd_changed) {
uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD, *passwdp, 0);
if(uc)
- return uc_to_curlcode(uc);
+ return Curl_uc_to_curlcode(uc);
}
return CURLE_OK;
}
void Curl_freeset(struct Curl_easy * data);
/* free the URL pieces */
void Curl_up_free(struct Curl_easy *data);
+CURLcode Curl_uc_to_curlcode(CURLUcode uc);
CURLcode Curl_close(struct Curl_easy *data); /* opposite of curl_open() */
CURLcode Curl_connect(struct Curl_easy *, struct connectdata **,
bool *async, bool *protocol_connect);