Commit Graph

10435 Commits

Author SHA1 Message Date
Riley Park
ac3f823cce Migrate codec-http tests to JUnit 5 (#11316)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-27 09:19:33 +02:00
terrarier2111
b646a2670a
Some minor cleanups for TypeParameterMatcher (#11286)
Motivation:

The code in TypeParamterMatcher can be simplified and cleaned up.

Modification:

Cleanup

Result:

Cleanup
2021-05-27 09:02:29 +02:00
Riley Park
84826a4ea6 Migrate codec-redis tests to JUnit 5 (#11318)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-27 09:00:30 +02:00
Riley Park
3efd9642ca Migrate common tests to JUnit 5 (#11319)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-27 08:56:23 +02:00
wuare
a743b74bfb
Remove not needed null check (#11303)
Motivation:

throw exception if there is no method, it never is null, condition is always true

Modification:

remove unnecessary condition

Result:

cleanup
2021-05-26 15:11:27 +02:00
Riley Park
5e71336ffb Migrate codec tests to JUnit 5 (#11306)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 14:11:12 +02:00
Norman Maurer
f81149324f
Automatically use netty-tcnative-boringssl-static on windows (#11317)
Motivation:

We only release a static compiled version of netty-tcnative for windows so we need to ensure we use it when on windows and not try to use a dynamic build version.

Modifications:

Automatically renable the boringssl profile when on windows

Result:

Fixes https://github.com/netty/netty/issues/11302
2021-05-26 14:10:45 +02:00
Norman Maurer
0ff93519a4
Add builds for windows (#11284)
Motivation:

Let's also build on windows during PR validation

Modifications:

Add build on windows during PR

Result:

Validate that all also pass on windows
2021-05-26 12:12:11 +02:00
Idel Pivnitskiy
cb1b3517dc
Don't iterate through active h2-streams if lastStreamId is MAX_VALUE (#11304)
Motivation:

Incoming `Http2GoAwayFrame#lastStreamId()` tells what was the last
streamId that the remote peer takes for processing [1]. We fire a
userEvent for all streams above that value to let users know those are
safe to retry on another connection. There is no need to go through
`forEachActiveStream` if `lastStreamId == Integer.MAX_VALUE` because
none of the streams can have id greater that MAX_VALUE.

1. https://datatracker.ietf.org/doc/html/rfc7540#section-6.8

Modifications:

- Return fast from `onHttp2GoAwayFrame` in `Http2MultiplexCodec` and
`Http2MultiplexHandler` if `lastStreamId() == Integer.MAX_VALUE`;

Result:

No unnecessary iteration over active streams on GO_AWAY if
`lastStreamId() == Integer.MAX_VALUE`.
2021-05-26 12:05:57 +02:00
Riley Park
bfd2c5ac8a Migrate transport tests to JUnit 5 (#11315)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 12:03:58 +02:00
Riley Park
22faf32c25 Migrate codec-socks tests to JUnit 5 (#11314)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 10:45:22 +02:00
Riley Park
a63a4d99e0 Migrate handler-proxy tests to JUnit 5 (#11313)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in  handler-proxy  tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 10:37:18 +02:00
Riley Park
6ffb001caf Migrate codec-stomp tests to JUnit 5 (#11312)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in codec-stomp tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 10:35:05 +02:00
Riley Park
c6aaaffec2 Migrate codec-memcache tests to JUnit 5 (#11310)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in codec-memcache tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 10:16:02 +02:00
Riley Park
7be16c549b Migrate codec-dns tests to JUnit 5 (#11307)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in codec-dns tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 10:13:04 +02:00
Riley Park
28d4600aa6 Migrate codec-xml tests to JUnit 5 (#11311)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in codec-smtp tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 10:06:28 +02:00
Riley Park
187c6015b4 Migrate codec-haproxy tests to JUnit 5 (#11308)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in codec-smtp tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 10:05:10 +02:00
Riley Park
e9a8eaeb18 Migrate codec-smtp tests to JUnit 5 (#11309)
Motivation:

JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel.

Modifications:

Use JUnit5 in codec-smtp tests

Result:

Related to https://github.com/netty/netty/issues/10757
2021-05-26 09:48:56 +02:00
old driver
cfaed1219f
Add fast path in ByteBufUtil.compare and ByteBufUtil.equals methods (#11296)
Motivation:

When object-references are both same, the method should return 0 directly with no necessary go loop&compare the content of the ByteBuf.

Modification:

Added short circuit when both object-references are the same for equals and compare methods.

Result:

Added short circuit code.
2021-05-25 08:19:02 +02:00
old driver
7b064700a0
correct the doc of methods:io.netty.buffer.ByteBuf#setBytes(int, io.netty.buffer.ByteBuf) and io.netty.buffer.ByteBuf#setBytes(int, io.netty.buffer.ByteBuf, int) (#11290) 2021-05-24 10:48:56 +02:00
Roman Fedorov
bb800d6067
Delete obsolete javadoc warning about pendingTasks() method expensiveness (#11287)
Co-authored-by: Roman Fedorov <roman.fedorov@spikeapp.com>
2021-05-22 09:33:45 +02:00
old driver
9747739962
Change docs of method io.netty.util.internal.MathUtil#isOutOfBounds (#11281)
Motivation:

1. The docs about the 'retun value' of the method `io.netty.util.internal.MathUtil#isOutOfBounds` is not correct.
2. The capacity parameter should be checked for overflowed case.

Modification:

1. Changed the doc to:

>  @return {@code false} if the requested {@code index} and {@code length} will fit within {@code capacity}.
>  {@code true} if this would result in an index out of bounds exception.

2. Improved the bounder checking logic.

Result:
Fixes #11279 
Fixes #11280
2021-05-19 21:33:26 +02:00
Norman Maurer
bed04fc597 Don't include benchmarks and tests in the generated javadocs
Motivation:

We shouldn't include benchmarks and tests in the generated javadocs to keep things clean

Modifications:

Add some more excludes

Result:

Javadocs for benchmarks and tests are not published
2021-05-19 16:28:05 +02:00
Norman Maurer
09336b5a04 Checkout previous branch again after finish copy the docs 2021-05-19 15:16:56 +02:00
Netty Project Bot
02142a2510 [maven-release-plugin] prepare for next development iteration 2021-05-19 12:09:18 +00:00
Netty Project Bot
9e06241ddb [maven-release-plugin] prepare release netty-4.1.65.Final 2021-05-19 12:09:14 +00:00
Norman Maurer
eca0e160ed
Add license header to our scripts and workflows (#11282)
Motivation:

We should have license header whenever possible.

Modifications:

Add header to scripts and workflow config

Result:

More clear licensing
2021-05-19 14:06:42 +02:00
Norman Maurer
8be7c5b860 Delete tag if already exist locally 2021-05-19 11:43:06 +02:00
Norman Maurer
037eddd5a2
Fix netty-all artifact (#11274)
Motivation:

612ab58448 did change the way how netty-all was produced by unfortunally it messed up the dependency graph for our native artifacts. This commit reverts changes done by 612ab58448 and also clean up the profiles

Modifications:

netty-all is useable again

Result:

Fixes https://github.com/netty/netty/issues/11272
2021-05-19 11:12:52 +02:00
Norman Maurer
08dbd72758
Fail the build if we can't load the OpenSSL library (#11269)
Motivation:

We should better fail the build if we can't load the OpenSSL library to ensure we not introduce a regression at some point related to native library loading

Modifications:

Remove usages of assumeTrue and let the tests fail if we cant load the native lib

Result:

Ensure we not regress
2021-05-19 08:19:15 +02:00
Norman Maurer
1a67c1feb8
Correctly cleanup jars created during shading tests (#11276)
Motivation:

We need to ensure we correctly cleanup all the jars that are build for the integration tests that verify shading otherwise we may deploy these during release.

Modifications:

Correctly remove all the generated jars

Result:

Not deploy the jars by mistake
2021-05-18 18:54:34 +02:00
Stephan H. Wissel
7c955a19dc
Redirect Log4J 1.x to Log 2.x (#11264)
Removes flag by Whitesource vulnerability scanner

Motivation:

WhiteSource vulnerability scan flags the Log4J 1.x stream as vulnerable.

Modification:

Replaced reference to `log4j` with `log4j-1.2-api`
Ran `mvn test` (on a Mac) successfully

Result:

Fixes #11263
2021-05-18 12:42:48 +02:00
Norman Maurer
72db32a801
Don't include netty-examples as dependency for netty-all (#11273)
Motivation:

We shouldn't include netty-examples as dependency for netty-all as this will try to pull in all sorts of dependencies which are optional.

Modifications:

Remove dependency on netty-examples

Result:

Related to https://github.com/netty/netty/issues/11272
2021-05-18 11:44:30 +02:00
Trustin Lee
3972bacd60
Provide a way to pass through a certain HTTP upgrade request (#11267)
Motivation:

A user might want to handle a certain HTTP upgrade request differently
than what `HttpServerUpgradeHandler` does by default. For example, a
user could let `HttpServerUpgradeHandler` handle HTTP/2 upgrades but
not WebSocket upgrades.

Modifications:

- Added `HttpServerUpgradeHandler.isUpgrade(HttpRequest)` so a user can
  tell `HttpServerUpgradeHandler` to pass the request as it is to the
  next handler.

Result:

- A user can handle a certain upgrade request specially.
2021-05-18 11:42:38 +02:00
Norman Maurer
6f193193ea
Upgrade logback dependency due CVE (#11271)
Motivation:

Older version of logback are affected by [CVE-2017-5929]. While its an optional dependency we should upgrade

Modifications:

Upgrade to 1.2.3

Result:

No more reports about using affected logback version
2021-05-18 11:40:57 +02:00
Norman Maurer
cc28ec2b92
Remove usage of non-existing ci profile (#11270)
Motivation:

c443bc40fa removed the CI profile but we missed to adjust the docker-compose.yaml file

Modifications:

Remove -Pci as the profile doesn't exist anymore

Result:

No more warning during build
2021-05-18 11:40:27 +02:00
Norman Maurer
6e866317d2
Ensure we can load the native library or fail the build (#11262)
Motivation:

We used assumeTrue(...) in some places before to detect if we could load the native library but this could lead to the sitation that we not notice if we break native loading.

Modifications:

Always fail if we cant load the native library

Result:

Ensure we not cause any regression in the native loading code in the future
2021-05-18 08:14:32 +02:00
Norman Maurer
8a03a1db7d
Ensure we fail if native lib can not be loaded on macos (#11261)
Motivation:

ccca3959fd fixed a regression which caused the native resolver code to not be loaded but this was not reported by the tests.

Modifications:

Adjust tests to actually fail the build if we cant load the native lib

Result:

Ensure we don't introduce another regression in the future
2021-05-18 08:13:39 +02:00
Violeta Georgieva
ccca3959fd
Fix loading of the native library for DNS resolutions on MacOS (#11260)
Motivation:

Cannot load the native library for DNS resolutions on MacOS.
The exception below is observed:

18:02:43.453 [Test worker] ERROR i.n.r.d.DnsServerAddressStreamProviders - Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at io.netty.resolver.dns.DnsServerAddressStreamProviders.<clinit>(DnsServerAddressStreamProviders.java:64)
	at io.netty.resolver.dns.DnsNameResolverBuilder.<init>(DnsNameResolverBuilder.java:60)
	at reactor.netty.transport.NameResolverProvider.newNameResolverGroup(NameResolverProvider.java:432)
...
Caused by: java.lang.UnsatisfiedLinkError: io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider.resolvers()[Lio/netty/resolver/dns/macos/DnsResolver;
	at io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider.resolvers(Native Method)
	at io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider.retrieveCurrentMappings(MacOSDnsServerAddressStreamProvider.java:127)
	at io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider.<init>(MacOSDnsServerAddressStreamProvider.java:123)

This is a regression made with #11239

Modification:

When checking for OS, an exception must be thrown when the OS is not MacOS

Result:

The native library for DNS resolutions on MacOS can be loaded
2021-05-17 20:16:25 +02:00
Norman Maurer
a273c231fd
Add profile for generating javadocs and xref files (#11259)
Motivation:

When changing the netty-all artifact to not include any sources we also removed the ability to generate the javadocs / xref files for our website

Modifications:

- Add new profile which will generate the files
- Add script which generates all the files and copy these over to the netty-website

Result:

Easier to generate files for website
2021-05-17 20:11:22 +02:00
old driver
5178b2c7a5
make Slf4JLoggerFactory be singleton (#11253)
Motivation:

The current initialization of Slf4JLoggerFactory is not singleton.

Modification:

Use Slf4JLoggerFactory.INSTANCE to initialize Slf4JLoggerFactory.

Result:

The instance of Slf4JLoggerFactory became a singleton.
2021-05-17 09:10:15 +02:00
Netty Project Bot
d5c81d9a3e [maven-release-plugin] prepare for next development iteration 2021-05-17 07:04:14 +00:00
Netty Project Bot
67bedf0efe [maven-release-plugin] prepare release netty-4.1.64.Final 2021-05-17 07:04:08 +00:00
Norman Maurer
c22642629d Add script to copy apidocs and xref to netty-website
Motivation:

After the release was done we need to also copy the apidocs and xref to the netty-website

Modifications:

Add script that does the copy etc

Result:

Less manual steps to remember
2021-05-17 09:01:17 +02:00
Norman Maurer
060889da5d Fix another typo in the release workflow 2021-05-17 08:44:36 +02:00
Norman Maurer
9ca4e21ea0 Fix typo in release workflow 2021-05-14 15:34:33 +02:00
Norman Maurer
78050c59ab
Don't create a new ParserImpl on each parser() call (#11255)
Motivation:

ParserImpl is stateless and so we can use the same instance multiple times

Modifications:

- Make constructor private
- Return the same instance all the time

Result:

Less object creation
2021-05-14 15:19:04 +02:00
Wu Zhiguo
265b2ea9bc
Fix typo in DnsCodecUtil class (#11252)
Motivation:

There is a typo in the javadocs

Modification:

correct grammar mistakes

Result:

cleanup
2021-05-14 10:02:17 +02:00
Violeta Georgieva
fa8f7a3510
Add DefaultHostsFileEntriesResolver#addresses to provide all hosts file's entries for a hostname (#11246)
Motivation:
DefaultHostsFileEntriesResolver should provide all hosts file's entries for a hostname when
DnsNameResolver#resolveAll as opposed to the current implementation where only the first
entry is taken into consideration

Modification:
- Add DefaultHostsFileEntriesResolver#addresses to provide all hosts file's entries for a hostname
- Add HostsFileEntriesProvider to provide all hosts file's entries for a hostname and to keep
backwards compatibility for HostsFileEntries and HostsFileParser
- DnsNameResolver#resolveAll uses the new DefaultHostsFileEntriesResolver#addresses
- BlockHound configuration: replace HostsFileParser#parse with HostsFileEntriesProvider$ParserImpl#parse
as the latter does the parsing
- Add junit tests

Result:
Fixes #10834

* Address feedback
2021-05-14 09:50:42 +02:00
Aayush Atharva
11e6a77fba
Change asterisk to 'x' in FQDN of SelfSignedCertificate (#11245)
Motivation:

`SelfSignedCertificate` creates a certificate and private key files and store them in a temporary directory. However, if the certificate uses a wildcard hostname that uses asterisk *, e.g. `*.shieldblaze.com`, it'll throw an error because * is not a valid character in the file system.

Modification:
Replace the asterisk with 'x'

Result:
Fixes #11240
2021-05-12 19:32:31 +02:00