lib: name the main CURLMcode variable 'mresult'

To make it distinctly different from 'result' and keep consistency
betwen functions.

Closes #19997
This commit is contained in:
Daniel Stenberg 2025-12-16 13:06:20 +01:00
parent 1b205078bd
commit 0a26e3a660
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 131 additions and 131 deletions

View file

@ -600,7 +600,7 @@ static CURLcode poll_fds(struct events *ev,
static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
{
bool done = FALSE;
CURLMcode mcode = CURLM_OK;
CURLMcode mresult = CURLM_OK;
CURLcode result = CURLE_OK;
while(!done) {
@ -623,8 +623,8 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
/* timeout! */
ev->ms = 0;
/* curl_mfprintf(stderr, "call curl_multi_socket_action(TIMEOUT)\n"); */
mcode = curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0,
&ev->running_handles);
mresult = curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0,
&ev->running_handles);
}
else {
/* here pollrc is > 0 */
@ -638,8 +638,8 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
/* sending infof "randomly" to the first easy handle */
infof(multi->admin, "call curl_multi_socket_action(socket "
"%" FMT_SOCKET_T ")", (curl_socket_t)fds[i].fd);
mcode = curl_multi_socket_action(multi, fds[i].fd, act,
&ev->running_handles);
mresult = curl_multi_socket_action(multi, fds[i].fd, act,
&ev->running_handles);
}
}
@ -662,7 +662,7 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
}
}
if(mcode)
if(mresult)
return CURLE_URL_MALFORMAT;
/* we do not really care about the "msgs_in_queue" value returned in the
@ -700,19 +700,19 @@ static CURLcode easy_events(struct Curl_multi *multi)
static CURLcode easy_transfer(struct Curl_multi *multi)
{
bool done = FALSE;
CURLMcode mcode = CURLM_OK;
CURLMcode mresult = CURLM_OK;
CURLcode result = CURLE_OK;
while(!done && !mcode) {
while(!done && !mresult) {
int still_running = 0;
mcode = curl_multi_poll(multi, NULL, 0, 1000, NULL);
mresult = curl_multi_poll(multi, NULL, 0, 1000, NULL);
if(!mcode)
mcode = curl_multi_perform(multi, &still_running);
if(!mresult)
mresult = curl_multi_perform(multi, &still_running);
/* only read 'still_running' if curl_multi_perform() return OK */
if(!mcode && !still_running) {
if(!mresult && !still_running) {
int rc;
CURLMsg *msg = curl_multi_info_read(multi, &rc);
if(msg) {
@ -723,8 +723,8 @@ static CURLcode easy_transfer(struct Curl_multi *multi)
}
/* Make sure to return some kind of error if there was a multi problem */
if(mcode) {
result = (mcode == CURLM_OUT_OF_MEMORY) ? CURLE_OUT_OF_MEMORY :
if(mresult) {
result = (mresult == CURLM_OUT_OF_MEMORY) ? CURLE_OUT_OF_MEMORY :
/* The other multi errors should never happen, so return
something suitably generic */
CURLE_BAD_FUNCTION_ARGUMENT;
@ -753,7 +753,7 @@ static CURLcode easy_transfer(struct Curl_multi *multi)
static CURLcode easy_perform(struct Curl_easy *data, bool events)
{
struct Curl_multi *multi;
CURLMcode mcode;
CURLMcode mresult;
CURLcode result = CURLE_OK;
SIGPIPE_VARIABLE(pipe_st);
@ -801,10 +801,10 @@ static CURLcode easy_perform(struct Curl_easy *data, bool events)
curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, (long)data->set.maxconnects);
data->multi_easy = NULL; /* pretend it does not exist */
mcode = curl_multi_add_handle(multi, data);
if(mcode) {
mresult = curl_multi_add_handle(multi, data);
if(mresult) {
curl_multi_cleanup(multi);
if(mcode == CURLM_OUT_OF_MEMORY)
if(mresult == CURLM_OUT_OF_MEMORY)
return CURLE_OUT_OF_MEMORY;
return CURLE_FAILED_INIT;
}