See https://github.com/bitcoin/bitcoin/pull/1180/files#L2R624 for the discussion about this!
fix an incorrect if-clause in net.cpp #1225
pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:net_cpp_if_clause changing 1 files +1 −1-
Diapolo commented at 9:04 PM on May 8, 2012: none
-
laanwj commented at 9:06 PM on May 8, 2012: member
sub-optimal? just call it incorrect :)
(hSocketMax > (SOCKET) -1)is impossible to trigger. -
jgarzik commented at 9:08 PM on May 8, 2012: contributor
It still needs the (SOCKET) cast to be portable to all platforms without warnings, I think
-
laanwj commented at 9:10 PM on May 8, 2012: member
Yes, it still needs the (SOCKET) cast, otherwise you'll be comparing a signed against an unsigned value.
-
Diapolo commented at 9:13 PM on May 8, 2012: none
:-P² All good ends well?
-
laanwj commented at 6:51 AM on May 9, 2012: member
If you don't like the magic value make it compare against INVALID_SOCKET. After all, it is a socket number. SOCKET_ERROR is a signed error value and is meant for comparing against wsaGetError() output.
You wanted to compare against both INVALID_SOCKET and SOCKET_ERROR which is the part I disagreed with.
-
fix an incorrect if-clause in net.cpp 3b6ed2294b
-
Diapolo commented at 7:12 AM on May 9, 2012: none
Updated and rebased!
-
laanwj commented at 7:36 AM on May 9, 2012: member
ACK
- jgarzik referenced this in commit d54e6e8359 on May 9, 2012
- jgarzik merged this on May 9, 2012
- jgarzik closed this on May 9, 2012
- coblee referenced this in commit 09a4b16264 on Jul 17, 2012
- suprnurd referenced this in commit 34fd8daf5a on Dec 5, 2017
- lateminer referenced this in commit 5ca5fbde4c on Jan 22, 2019
- DrahtBot locked this on Sep 8, 2021