Skip to content
Permalink
Browse files
multi: remove two checks always true
Detected by Codacy
Closes #5676
  • Loading branch information
bagder committed Jul 13, 2020
1 parent a88fe0f commit 61a08508f6a458fe21bbb18cd2a9bac2f039452b
Showing 1 changed file with 2 additions and 2 deletions.
@@ -1808,7 +1808,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
multistate(data, CURLM_STATE_SENDPROTOCONNECT);
}
}
else if(result)
else
stream_error = TRUE;
break;
#endif
@@ -1858,7 +1858,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
multistate(data, CURLM_STATE_DO);
rc = CURLM_CALL_MULTI_PERFORM;
}
else if(result) {
else {
/* failure detected */
Curl_posttransfer(data);
multi_done(data, result, TRUE);

2 comments on commit 61a0850

@gvanem
Copy link
Contributor

@gvanem gvanem commented on 61a0850 Jul 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a case of always false. Using clang-cl on this file gives:

multi.c(2966,18): warning: result of comparison 'long' > 2147483647 is always false [-Wtautological-type-limit-compare]
        (streams > (long)INITIAL_MAX_CONCURRENT_STREAMS)?
         ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Maybe it should fail if anyone needs more than that?

@bagder
Copy link
Member Author

@bagder bagder commented on 61a0850 Jul 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes thanks, it is indeed always true for systems with 32 bit long. We should fix that. I'll submit a PR in a sec...

Please sign in to comment.