Fix typo in KQueueChannelConfig by thobe · Pull Request #12537 · netty/netty (original) (raw)
Buffer allocation should be based on the length of the option, not on its level. This fixes a test failure (KQueueChannelConfigTest.testRawOption) on MacOS.
raidyue pushed a commit to raidyue/netty that referenced this pull request
Motivation:
KQueueChannelConfigTest.testRawOption() fails on MacOS due to the buffer for the RawUnixChannelOption being over-allocated when retrieving the option value. Since the limit is not explicitly set (the buffer is just flipped), the limit of the buffer will be based on its size, causing the test to fail.
Modification:
Changes the buffer allocation for getOption of RawUnixChannelOption in KQueueChannelConfig to be based on the length of the option instead of the level. The use of level is likely a typo. The corresponding code in EpollChannelConfig allocates the buffer based on length rather than level.
Result:
One less test failure when building on MacOS (Intel) with JDK 1.8.
franz1981 pushed a commit to franz1981/netty that referenced this pull request
Motivation:
KQueueChannelConfigTest.testRawOption() fails on MacOS due to the buffer for the RawUnixChannelOption being over-allocated when retrieving the option value. Since the limit is not explicitly set (the buffer is just flipped), the limit of the buffer will be based on its size, causing the test to fail.
Modification:
Changes the buffer allocation for getOption of RawUnixChannelOption in KQueueChannelConfig to be based on the length of the option instead of the level. The use of level is likely a typo. The corresponding code in EpollChannelConfig allocates the buffer based on length rather than level.
Result:
One less test failure when building on MacOS (Intel) with JDK 1.8.
thobe deleted the fix-KQueueChannelConfig branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})