Netty

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
HTTP/2 Read Decompression Flow Control Fix

Motivation:

The current implementation of the HTTP/2 decompression does not integrate with flow control properly.

The decompression code is giving the post-decompression size to the flow control algorithm which

results in flow control errors at incorrect times.

Modifications:

-DecompressorHttp2FrameReader.java will need to change where it hooks into the HTTP/2 codec

-Enhance unit tests to test this condition

Result:

No more flow control errors because of decompression design flaw

Fixed FingerprintTrustManagerFactory constructor

Motivation:

When constructing a FingerprintTrustManagerFactory from an Iterable of Strings, the fingerprints were correctly parsed but never added to the result array. The constructed FingerprintTrustManagerFactory consequently fails to validate any certificate.

Modifications:

I added a line to add each converted SHA-1 certificate fingerprint to the result array which then gets passed on to the next constructor.

Result:

Certificate fingerprints passed to the constructor are now correctly added to the array of valid fingerprints. The resulting FingerprintTrustManagerFactory object correctly validates certificates against the list of specified fingerprints.

Fixed FingerprintTrustManagerFactory constructor

Motivation:

When constructing a FingerprintTrustManagerFactory from an Iterable of Strings, the fingerprints were correctly parsed but never added to the result array. The constructed FingerprintTrustManagerFactory consequently fails to validate any certificate.

Modifications:

I added a line to add each converted SHA-1 certificate fingerprint to the result array which then gets passed on to the next constructor.

Result:

Certificate fingerprints passed to the constructor are now correctly added to the array of valid fingerprints. The resulting FingerprintTrustManagerFactory object correctly validates certificates against the list of specified fingerprints.

Fixed FingerprintTrustManagerFactory constructor

Motivation:

When constructing a FingerprintTrustManagerFactory from an Iterable of Strings, the fingerprints were correctly parsed but never added to the result array. The constructed FingerprintTrustManagerFactory consequently fails to validate any certificate.

Modifications:

I added a line to add each converted SHA-1 certificate fingerprint to the result array which then gets passed on to the next constructor.

Result:

Certificate fingerprints passed to the constructor are now correctly added to the array of valid fingerprints. The resulting FingerprintTrustManagerFactory object correctly validates certificates against the list of specified fingerprints.

Add AbstractUnsafe.annotateConnectException()

Motivation:

JDK's exception messages triggered by a connection attempt failure do

not contain the related remote address in its message. We currently

append the remote address to ConnectException's message, but I found

that we need to cover more exception types such as SocketException.

Modifications:

- Add AbstractUnsafe.annotateConnectException() to de-duplicate the

code that appends the remote address

Result:

- Less duplication

- A transport implementor can annotate connection attempt failure

message more easily

Add AbstractUnsafe.annotateConnectException()

Motivation:

JDK's exception messages triggered by a connection attempt failure do

not contain the related remote address in its message. We currently

append the remote address to ConnectException's message, but I found

that we need to cover more exception types such as SocketException.

Modifications:

- Add AbstractUnsafe.annotateConnectException() to de-duplicate the

code that appends the remote address

Result:

- Less duplication

- A transport implementor can annotate connection attempt failure

message more easily

Add AbstractUnsafe.annotateConnectException()

Motivation:

JDK's exception messages triggered by a connection attempt failure do

not contain the related remote address in its message. We currently

append the remote address to ConnectException's message, but I found

that we need to cover more exception types such as SocketException.

Modifications:

- Add AbstractUnsafe.annotateConnectException() to de-duplicate the

code that appends the remote address

Result:

- Less duplication

- A transport implementor can annotate connection attempt failure

message more easily

Fix an incorrect use of ByteBuf.array() in Socks5CmdRequestDecoder

Motivation:

Socks5CmdRequestDecoder uses ByteBuf.array() naively assuming that the

array's base offset is always 0, which is not the case.

Modification:

- Allocate a new byte array and copy the content there instead

Result:

Another bug fixed

Fix an incorrect use of ByteBuf.array() in Socks5CmdRequestDecoder

Motivation:

Socks5CmdRequestDecoder uses ByteBuf.array() naively assuming that the

array's base offset is always 0, which is not the case.

Modification:

- Allocate a new byte array and copy the content there instead

Result:

Another bug fixed

Fix a bug in NetUtil.createByteArrayFromIpAddressString()

Motivation:

An IPv6 string can have a zone index which is followed by the '%' sign.

When a user passes an IPv6 string with a zone index,

NetUtil.createByteArrayFromIpAddressString() returns an incorrect value.

Modification:

- Strip the zone index before conversion

Result:

An IPv6 string with a zone index is decoded correctly.

Fix a bug in NetUtil.createByteArrayFromIpAddressString()

Motivation:

An IPv6 string can have a zone index which is followed by the '%' sign.

When a user passes an IPv6 string with a zone index,

NetUtil.createByteArrayFromIpAddressString() returns an incorrect value.

Modification:

- Strip the zone index before conversion

Result:

An IPv6 string with a zone index is decoded correctly.

Fix a bug in NetUtil.createByteArrayFromIpAddressString()

Motivation:

An IPv6 string can have a zone index which is followed by the '%' sign.

When a user passes an IPv6 string with a zone index,

NetUtil.createByteArrayFromIpAddressString() returns an incorrect value.

Modification:

- Strip the zone index before conversion

Result:

An IPv6 string with a zone index is decoded correctly.

Auto-generate the handler name when null is specified as a name

Motivation:

There's no way to generate the name of a handler being newly added

automatically and reliably.

For example, let's say you have a routine that adds a set of handlers to

a pipeline using addBefore() or addAfter(). Because addBefore() and

addAfter() always require non-conflicting non-null handler name, making

the multiple invocation of the routine on the same pipeline is

non-trivial.

Modifications:

- If a user specifies null as the name of the new handler,

DefaultChannelPipeline generates one.

- Update the documentation of ChannelPipeline to match the new behavior

Result:

A user doesn't need to worry about name conflicts anymore.

Auto-generate the handler name when null is specified as a name

Motivation:

There's no way to generate the name of a handler being newly added

automatically and reliably.

For example, let's say you have a routine that adds a set of handlers to

a pipeline using addBefore() or addAfter(). Because addBefore() and

addAfter() always require non-conflicting non-null handler name, making

the multiple invocation of the routine on the same pipeline is

non-trivial.

Modifications:

- If a user specifies null as the name of the new handler,

DefaultChannelPipeline generates one.

- Update the documentation of ChannelPipeline to match the new behavior

Result:

A user doesn't need to worry about name conflicts anymore.

Add the encoder/decoder getter methods to HttpClientCodec

Motivation:

There's no way for a user to get the encoder and the decoder of an

HttpClientCodec. The lack of such getter methods makes it impossible to

remove the codec handlers from the pipeline correctly.

For example, a user could add more than one HttpClientCodec to the

pipeline, and then the user cannot easily decide which encoder and

decoder to remove.

Modifications:

- Add encoder() and decoder() method to HttpClientCodec which returns

HttpRequestEncoder and HttpResponseDecoder respectively

- Also made the same changes to HttpServerCodec

Result:

A user can distinguish the handlers added by multiple HttpClientCodecs

easily.

Add the encoder/decoder getter methods to HttpClientCodec

Motivation:

There's no way for a user to get the encoder and the decoder of an

HttpClientCodec. The lack of such getter methods makes it impossible to

remove the codec handlers from the pipeline correctly.

For example, a user could add more than one HttpClientCodec to the

pipeline, and then the user cannot easily decide which encoder and

decoder to remove.

Modifications:

- Add encoder() and decoder() method to HttpClientCodec which returns

HttpRequestEncoder and HttpResponseDecoder respectively

- Also made the same changes to HttpServerCodec

Result:

A user can distinguish the handlers added by multiple HttpClientCodecs

easily.

HTTP/2 Unit Tests EventLoopGroup cleanup

Motivation:

The HTTP/2 unit tests are suffering from OOME on the master branch.

These unit tests allocating a large number of threads (~706 peak live) which may

be related to this memory pressure.

Modifications:

Each EventLoopGroup shutdown operation will have a `sync()` call.

Result:

Lower peek live thread count and less associated memory pressure.

Fixed typo in LzmaFrameEncoder constructor

Motivation:

A discovered typo in LzmaFrameEncoder constructor when we check `lc + lp` for better compatibility.

Modifications:

Changed `lc + pb` to `lc + lp`.

Result:

Correct check of `lc + lp` value.

Fixed typo in LzmaFrameEncoder constructor

Motivation:

A discovered typo in LzmaFrameEncoder constructor when we check `lc + lp` for better compatibility.

Modifications:

Changed `lc + pb` to `lc + lp`.

Result:

Correct check of `lc + lp` value.

Implemented LZMA frame encoder

Motivation:

LZMA compression algorithm has a very good compression ratio.

Modifications:

- Added `lzma-java` library which implements LZMA algorithm.

- Implemented LzmaFrameEncoder which extends MessageToByteEncoder and provides compression of outgoing messages.

- Added tests to verify the LzmaFrameEncoder and how it can compress data for the next uncompression using the original library.

Result:

LZMA encoder which can compress data using LZMA algorithm.

    • -0
    • +202
    /license/lzma-java.txt
Implemented LZMA frame encoder

Motivation:

LZMA compression algorithm has a very good compression ratio.

Modifications:

- Added `lzma-java` library which implements LZMA algorithm.

- Implemented LzmaFrameEncoder which extends MessageToByteEncoder and provides compression of outgoing messages.

- Added tests to verify the LzmaFrameEncoder and how it can compress data for the next uncompression using the original library.

Result:

LZMA encoder which can compress data using LZMA algorithm.

    • -0
    • +202
    /license/lzma-java.txt
Improve error reporting in SingleThreadEventLoopTest. Fixes #2894

Motivation:

When an assertTrue(condition) statement fails we usually don't know

why, as the parameters of the condition are not logged.

Modifications:

Include relevant parameters in the assertion error message.

Result:

Easier to debug and understand test failures.

HTTP/2 Unit Test Leak Fixes

Motivation:

The HTTP/2 tests do not always clean up ByteBuf resources reliably. There are issues with the refCnt, over allocating buffers, and potentially not waiting long enough to reclaim resources for stress tests.

Modifications:

Scrub the HTTP/2 unit tests for ByteBuf leaks.

Result:

Less leaks (hopefully none) in the HTTP/2 unit tests. No OOME from HTTP/2 unit tests.

Adding support for HTTP/2 binary headers

Motivation:

The HTTP/2 spec does not restrict headers to being String. The current

implementation of the HTTP/2 codec uses Strings as header keys and

values. We should change this so that header keys and values allow

binary values.

Modifications:

Making Http2Headers based on AsciiString, which is a wrapper around a

byte[].

Various changes throughout the HTTP/2 codec to use the new interface.

Result:

HTTP/2 codec no longer requires string headers.

  1. … 18 more files in changeset.
Fix Native EPOLL Build Failure

Motiviation:

If sendmmsg is already defined then the native epoll module failed to build because of conflicting definitions.

The mmsghdr type was also redefined on systems that already supported this structure.

Modifications:

Provide a way so that systems which already define sendmmsg and mmsghdr can build

Provide a way so that systems which don't define sendmmsg and mmsghdr can build

Result:

The native EPOLL module can build in more environments

    • -6
    • +8
    /transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c
Fix Native EPOLL Build Failure

Motiviation:

If sendmmsg is already defined then the native epoll module failed to build because of conflicting definitions.

The mmsghdr type was also redefined on systems that already supported this structure.

Modifications:

Provide a way so that systems which already define sendmmsg and mmsghdr can build

Provide a way so that systems which don't define sendmmsg and mmsghdr can build

Result:

The native EPOLL module can build in more environments

    • -6
    • +8
    /transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c
Fix Native EPOLL Build Failure

Motiviation:

If sendmmsg is already defined then the native epoll module failed to build because of conflicting definitions.

The mmsghdr type was also redefined on systems that already supported this structure.

Modifications:

Provide a way so that systems which already define sendmmsg and mmsghdr can build

Provide a way so that systems which don't define sendmmsg and mmsghdr can build

Result:

The native EPOLL module can build in more environments

    • -6
    • +8
    /transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c
[maven-release-plugin] prepare for next development iteration

[maven-release-plugin] prepare release netty-3.6.10.Final

Correcting HttpDecoder SuppressWarnings parameter

Motiviation:

The HttpContentDecoder.getTargetContentEncoding has a SuppressWarnings(unused) on its parameter.

This should be SuppressWarnings(UnusedParameters).

Modifications:

SuppressWarnings(unused) -> SuppressWarnings(UnusedParameters)

Result:

Correctly suppressing warnings due to HttpContentDecoder.getTargetContentEncoding