Skip to content

Commit

Permalink
multi: remove two checks always true
Browse files Browse the repository at this point in the history
Detected by Codacy
Closes #5676
  • Loading branch information
bagder committed Jul 13, 2020
1 parent a88fe0f commit 61a0850
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

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.