Netty

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
DnsNameResolver should not bind locally. Fixes #5457 Motivation: Dns resolution failures happen when using the DnsNameResolver and the JVM is not authorized to bind datagram channels. The current DnsNameResolver binds locally a DatagramChannel which is not necessary (and not always permitted).

Modifications:

The DnsNameResolver Bootstrap does not bind anymore, instead it registers and use the channel directly. The localAddress has also been removed from the DnsAddressResolverGroup, DnsNameResolver and DnsNameResolverBuilder as it is not necessary anymore and the API is marked as @UnstableApi.

Result:

Dns resolution does not require anymore to bind locally.

Share code between ReadTimeoutHandler and IdleStateHandler

Motivation:

ReadTimeoutHandler and IdleStateHandler have duplicated code, we should share whatever possible.

Modifications:

Let ReadTimeoutHandler extend IdleStateHandler.

Result:

Remove code duplication.

Share code between ReadTimeoutHandler and IdleStateHandler

Motivation:

ReadTimeoutHandler and IdleStateHandler have duplicated code, we should share whatever possible.

Modifications:

Let ReadTimeoutHandler extend IdleStateHandler.

Result:

Remove code duplication.

Fix a bug of DnsNameResolver while working with NoopDnsCache.

Motivation:

If DnsNameResolver works with NoopDnsCache, IndexOutOfBoundsException will

be thrown.

Modifications:

Test if the result of DnsNameResolver.get(hostname) is empty before

accessing it's elements.

DefaultPromise make MAX_STACK_DEPTH configurable

Motivation:

Some Netty use cases may want to configure the max allowed stack depth for promise listener notification.

Modifications:

- Add a system property so that this value can be configured.

Result:

DefaultPromise's max stack depth is configurable.

DefaultPromise make MAX_STACK_DEPTH configurable

Motivation:

Some Netty use cases may want to configure the max allowed stack depth for promise listener notification.

Modifications:

- Add a system property so that this value can be configured.

Result:

DefaultPromise's max stack depth is configurable.

HTTP/2 Decoder validate that GOAWAY lastStreamId doesn't increase

Motivation:

The HTTP/2 RFC states in https://tools.ietf.org/html/rfc7540#section-6.8 that Endpoints MUST NOT increase the value they send in the last stream identifier however we don't enforce this when decoding GOAWAY frames.

Modifications:

- Throw a connection error if the peer attempts to increase the lastStreamId in a GOAWAY frame

Result:

RFC is more strictly enforced.

Fixes #5054: IpV4Subnet.contains() always returns true for single-address subnets.

Motivation:

See #5054 and to fix remaining issue stopping Netty 3.10.6.Final being released.

Modification:

Copied IpToInt from Netty 4 and contains() functions.

Result:

Now issue #5054 shown examples are doing what they are expected to do.

Update dependencies and plugins to latest possible versions.

Motivation:

It is good to have used dependencies and plugins up-to-date to fix any undiscovered bug fixed by the authors.

Modification:

Scanned dependencies and plugins and carefully updated one by one.

Result:

Dependencies and plugins are up-to-date.

Update dependencies and plugins to latest possible versions.

Motivation:

It is good to have used dependencies and plugins up-to-date to fix any undiscovered bug fixed by the authors.

Modification:

Scanned dependencies and plugins and carefully updated one by one.

Result:

Dependencies and plugins are up-to-date.

HPACK Encoder headerFields improvements

Motivation:

HPACK Encoder has a data structure which is similar to a previous version of DefaultHeaders. Some of the same improvements can be made.

Motivation:

- Enforce the restriction that the Encoder's headerFields length must be a power of two so we can use masking instead of modulo

- Use AsciiString.hashCode which already has optimizations instead of having yet another hash code algorithm in Encoder

Result:

Fixes https://github.com/netty/netty/issues/5357

http2: count pad length field toward flow control. Fixes #5434

Motivation:

The HTTP/2 specification requires the pad length field of DATA, HEADERS and PUSH_PROMISE frames to be counted towards the flow control window. The current implementation doesn't do so (See #5434).

Furthermore, it's currently not possible to add one byte padding, as this would add the one byte pad length field as well as append one padding byte to the end of the frame.

Modifications:

Include the one byte pad length field in the padding parameter of the API. Thereby extending the allowed value range by one byte to 256 (inclusive). On the wire, a one byte padding is encoded with a pad length field with value zero and a 256 byte padding is encoded with a pad length field with value 255 and 255 bytes append to the end of the frame.

Result:

More correct padding.

Remove unsafe char[] access in PlatformDependent

Motivation:

PlatformDependent attempts to use reflection to get the underlying char[] (or byte[]) from String objects. This is fragile as if the String implementation does not utilize the full array, and instead uses a subset of the array, this optimization is invalid. OpenJDK6 and some earlier versions of OpenJDK7 String have the capability to use a subsection of the underlying char[].

Modifications:

- PlatformDependent should not attempt to use the underlying array from String (or other data types) via reflection

Result:

PlatformDependent hash code generation for CharSequence does not depend upon specific JDK implementation details.

HpackUtil.equals performance improvement

Motivation:

PR #5355 modified interfaces to reduce GC related to the HPACK code. However this came with an anticipated performance regression related to HpackUtil.equals due to AsciiString's increase cost of charAt(..). We should mitigate this performance regression.

Modifications:

- Introduce an equals method in PlatformDependent which doesn't leak timing information and use this in HpcakUtil.equals

Result:

Fixes https://github.com/netty/netty/issues/5436

OpenSslEngine.getSupportedCipherSuites() must return java names as well.

Motivation:

At the moment OpenSslEngine.getSupportedCipherSuites() only return the original openssl cipher names and not the java names. We need also include the java names.

Modifications:

Correctly return the java names as well.

Result:

Correct implementation of OpenSslEngine.getSupportedCipherSuites()

OpenSslEngine.getSupportedCipherSuites() must return java names as well.

Motivation:

At the moment OpenSslEngine.getSupportedCipherSuites() only return the original openssl cipher names and not the java names. We need also include the java names.

Modifications:

Correctly return the java names as well.

Result:

Correct implementation of OpenSslEngine.getSupportedCipherSuites()

Allow to wrap another SslContext implementation and do extra init steps on the SSLEngine.

Motivation:

Sometimes its needed to customize the SSLEngine (like setting protocols etc). For this it would be useful if the user could wrap an SslContext and do init steps on the SSLEngine.

Modifications:

Add new SslContext implementation which can wrap another one and allow to customize the SSLEngine

Result:

More flexible usage of SslContext.

Allow to wrap another SslContext implementation and do extra init steps on the SSLEngine.

Motivation:

Sometimes its needed to customize the SSLEngine (like setting protocols etc). For this it would be useful if the user could wrap an SslContext and do init steps on the SSLEngine.

Modifications:

Add new SslContext implementation which can wrap another one and allow to customize the SSLEngine

Result:

More flexible usage of SslContext.

Fix HTTP version and Host header in HttpProxyHandler

Motivation:

The current implementation does not comply with RFC2817 on two points:

- The HTTP version required to support the CONNECT method is 1.1,

but the current implementation specifies 1.0.

- The HOST header should hold the name or address of the Target Host,

but the current implementation uses the proxy address instead.

Modifications:

- Specify HTTP version 1.1,

- The HOST header is now set using the Target Host's name (or address,

if it is resolved).

Result:

The CONNECT request is RFC2817-compliant.

Correctly implement SSLSession.getLastAccessedTime() for OpenSSLEngine

Motivation:

We need to return a correct time for SSLSession.getLastAccessedTime() so it reflect when the handshake was done when the session was reused.

Modifications:

Correctly reflect handshake time in getLastAccessedTime().

Result:

More conform SSLSession implementation.

Correctly implement SSLSession.getLastAccessedTime() for OpenSSLEngine

Motivation:

We need to return a correct time for SSLSession.getLastAccessedTime() so it reflect when the handshake was done when the session was reused.

Modifications:

Correctly reflect handshake time in getLastAccessedTime().

Result:

More conform SSLSession implementation.

Allow to inject RejectedExecutionHandler for different EventLoops and EventExecutors

Motiviation:

Sometimes it is useful to allow to specify a custom strategy to handle rejected tasks. For example if someone tries to add tasks from outside the eventloop it may make sense to try to backoff and retries and so give the executor time to recover.

Modification:

Add RejectedEventExecutor interface and implementations and allow to inject it.

Result:

More flexible handling of executor overload.

Allow to inject RejectedExecutionHandler for different EventLoops and EventExecutors

Motiviation:

Sometimes it is useful to allow to specify a custom strategy to handle rejected tasks. For example if someone tries to add tasks from outside the eventloop it may make sense to try to backoff and retries and so give the executor time to recover.

Modification:

Add RejectedEventExecutor interface and implementations and allow to inject it.

Result:

More flexible handling of executor overload.

Allow to set max capacity for task queue for EventExecutors and EventLoops

Motivation:

To restrict the memory usage of a system it is sometimes needed to adjust the number of max pending tasks in the tasks queue.

Modifications:

- Add new constructors to modify the number of allowed pending tasks.

- Add system properties to configure the default values.

Result:

More flexible configuration.

Allow to set max capacity for task queue for EventExecutors and EventLoops

Motivation:

To restrict the memory usage of a system it is sometimes needed to adjust the number of max pending tasks in the tasks queue.

Modifications:

- Add new constructors to modify the number of allowed pending tasks.

- Add system properties to configure the default values.

Result:

More flexible configuration.

Remove usages of deprecated methods group() and childGroup().

Motivation:

These methods were recently deprecated. However, they remained in use in several locations in Netty's codebase.

Modifications:

Netty's code will now access the bootstrap config to get the group or child group.

Result:

No impact on functionality.

Add support for KeyManagerFactory when using SslProvider.OpenSsl.

Motivation:

To be able to use SslProvider.OpenSsl with existing java apps that use the JDK SSL API we need to also provide a way to use it with an existing KeyManagerFactory.

Modification:

Make use of new tcnative apis and so hook in KeyManagerFactory.

Result:

SslProvider.OpenSsl can be used with KeyManagerFactory as well.

Add support for KeyManagerFactory when using SslProvider.OpenSsl.

Motivation:

To be able to use SslProvider.OpenSsl with existing java apps that use the JDK SSL API we need to also provide a way to use it with an existing KeyManagerFactory.

Modification:

Make use of new tcnative apis and so hook in KeyManagerFactory.

Result:

SslProvider.OpenSsl can be used with KeyManagerFactory as well.

Merge ThrowableUtils into ThrowableUtil.

Motivation:

We should merge ThrowableUtils into ThrowableUtil as this name is more consistent with the naming of utility classes in netty.

Modifications:

Merge classes.

Result:

More consistent naming

Merge ThrowableUtils into ThrowableUtil.

Motivation:

We should merge ThrowableUtils into ThrowableUtil as this name is more consistent with the naming of utility classes in netty.

Modifications:

Merge classes.

Result:

More consistent naming