Some internal functions always return CURLE_OK.
- Curl_http_proxy_get_destination() does that from
bb4032a, (2 years
ago) And the original inline code does not need to check the status.
- Curl_wildcard_init() does that from
e60fe20. (8 years ago)
- Curl_initinfo() does that from a very beginning.
- Curl_pgrsSetDownloadCounter() did not have a return before
914e49b,
ad051e1 recovered its content (2 years ago) but did not completely
recovered the changes related to it.
- auth_digest_get_qop_values() does that from
676de7f.
This directly changes their type to void and cleaned the remaining
checks for their return value.
Closes #19386
const char *hostname;
int port;
bool ipv6_ip;
- CURLcode result;
ts->state = H2_TUNNEL_INIT;
ts->stream_id = -1;
BUFQ_OPT_SOFT_LIMIT);
Curl_bufq_init(&ts->sendbuf, PROXY_H2_CHUNK_SIZE, H2_TUNNEL_SEND_CHUNKS);
- result = Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip);
- if(result)
- return result;
+ Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip);
/* host:port with IPv6 support */
ts->authority = curl_maprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname,
Curl_fileinfo_cleanup(element);
}
-CURLcode Curl_wildcard_init(struct WildcardData *wc)
+void Curl_wildcard_init(struct WildcardData *wc)
{
Curl_llist_init(&wc->filelist, fileinfo_dtor);
wc->state = CURLWC_INIT;
-
- return CURLE_OK;
}
void Curl_wildcard_dtor(struct WildcardData **wcp)
unsigned char state; /* wildcard_states */
};
-CURLcode Curl_wildcard_init(struct WildcardData *wc);
+void Curl_wildcard_init(struct WildcardData *wc);
void Curl_wildcard_dtor(struct WildcardData **wcp);
struct Curl_easy;
* beginning of a perform session. It must reset the session-info variables,
* in particular all variables in struct PureInfo.
*/
-CURLcode Curl_initinfo(struct Curl_easy *data)
+void Curl_initinfo(struct Curl_easy *data)
{
struct Progress *pro = &data->progress;
struct PureInfo *info = &data->info;
#ifdef USE_SSL
Curl_ssl_free_certinfo(data);
#endif
- return CURLE_OK;
}
static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info,
*
***************************************************************************/
CURLcode Curl_getinfo(struct Curl_easy *data, CURLINFO info, ...);
-CURLcode Curl_initinfo(struct Curl_easy *data);
+void Curl_initinfo(struct Curl_easy *data);
#endif /* HEADER_CURL_GETINFO_H */
return CURLE_OK;
}
-CURLcode Curl_http_proxy_get_destination(struct Curl_cfilter *cf,
- const char **phostname,
- int *pport, bool *pipv6_ip)
+void Curl_http_proxy_get_destination(struct Curl_cfilter *cf,
+ const char **phostname,
+ int *pport, bool *pipv6_ip)
{
DEBUGASSERT(cf);
DEBUGASSERT(cf->conn);
*pipv6_ip = (strchr(*phostname, ':') != NULL);
else
*pipv6_ip = cf->conn->bits.ipv6_ip;
-
- return CURLE_OK;
}
struct cf_proxy_ctx {
CURLcode result;
struct httpreq *req = NULL;
- result = Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip);
- if(result)
- goto out;
+ Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip);
authority = curl_maprintf("%s%s%s:%d", ipv6_ip ? "[" : "", hostname,
ipv6_ip ?"]" : "", port);
HEADER_CONNECT /* sending CONNECT to a proxy */
};
-CURLcode Curl_http_proxy_get_destination(struct Curl_cfilter *cf,
- const char **phostname,
- int *pport, bool *pipv6_ip);
+void Curl_http_proxy_get_destination(struct Curl_cfilter *cf,
+ const char **phostname,
+ int *pport, bool *pipv6_ip);
CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq,
struct Curl_cfilter *cf,
/*
* Set the number of downloaded bytes so far.
*/
-CURLcode Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size)
+void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size)
{
data->progress.dl.cur_size = size;
- return CURLE_OK;
}
/*
void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size);
void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size);
-/* It is fine to not check the return code if 'size' is set to 0 */
-CURLcode Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size);
-
+void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size);
void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size);
void Curl_ratelimit(struct Curl_easy *data, struct curltime now);
int Curl_pgrsUpdate(struct Curl_easy *data);
}
/* Update stats, write and report progress */
data->req.bytecount += nwrite;
- result = Curl_pgrsSetDownloadCounter(data, data->req.bytecount);
- if(result)
- return result;
+ Curl_pgrsSetDownloadCounter(data, data->req.bytecount);
if(excess_len) {
if(!data->req.ignorebody) {
}
total_dl += nread;
- result = Curl_pgrsSetDownloadCounter(data, total_dl);
- if(!result)
- result = telrcv(data, tn, (unsigned char *)buffer, nread);
+ Curl_pgrsSetDownloadCounter(data, total_dl);
+ result = telrcv(data, tn, (unsigned char *)buffer, nread);
if(result) {
keepon = FALSE;
break;
wc->dtor(wc->ftpwc);
Curl_safefree(wc->pattern);
Curl_safefree(wc->path);
- result = Curl_wildcard_init(wc); /* init wildcard structures */
- if(result)
- return CURLE_OUT_OF_MEMORY;
+ Curl_wildcard_init(wc); /* init wildcard structures */
}
}
#endif
return FALSE;
}
-static CURLcode auth_digest_get_qop_values(const char *options, int *value)
+static void auth_digest_get_qop_values(const char *options, int *value)
{
struct Curl_str out;
/* Initialise the output */
if(curlx_str_single(&options, ','))
break;
}
-
- return CURLE_OK;
}
/*
return CURLE_BAD_CONTENT_ENCODING;
/* Get the qop-values from the qop-options */
- result = auth_digest_get_qop_values(qop_options, &qop_values);
- if(result)
- return result;
+ auth_digest_get_qop_values(qop_options, &qop_values);
/* We only support auth quality-of-protection */
if(!(qop_values & DIGEST_QOP_VALUE_AUTH))