Netty

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Minor corrections to Http2 example javadocs.

Motivation:

There are a few very minor issues in the Http2 examples javadoc and

since I don't think that these javadocs are published this is very much

optional to include.

Modifications:

Updated the @see according to [1] to avoid warning when generating

javadocs.

Result:

No warning when generating javadocs.

[1] http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#@see

Add proper Openssl.SSLSession.getId() implementation

Motivation:

The current implementation not returns the real session as byte[] representation.

Modifications:

Create a proper Openssl.SSLSession.get() implementation which returns the real session as byte[].

Result:

More correct implementation

Add proper Openssl.SSLSession.getId() implementation

Motivation:

The current implementation not returns the real session as byte[] representation.

Modifications:

Create a proper Openssl.SSLSession.get() implementation which returns the real session as byte[].

Result:

More correct implementation

Add proper Openssl.SSLSession.getId() implementation

Motivation:

The current implementation not returns the real session as byte[] representation.

Modifications:

Create a proper Openssl.SSLSession.get() implementation which returns the real session as byte[].

Result:

More correct implementation

HTTP/2 Data Compressor

Motivation:

The HTTP/2 codec currently does not provide an interface to compress data. There is an analogous case to this in the HTTP codec and it is expected to be used commonly enough that it will be beneficial to have the feature in the http2-codec.

Modifications:

- Add a class which extends DefaultHttp2ConnectionEncoder and provides hooks to an EmbeddedChannel

- Add a compressor element to the Http2Stream interface

- Update unit tests to utilize the new feature

Result:

HTTP/2 codec supports data compression.

Ensure buffer is not released when call array() / memoryAddress()

Motivation:

Before we missed to check if a buffer was released before we return the backing byte array or memoryaddress. This could lead to JVM crashes when someone tried various bulk operations on the Unsafe*ByteBuf implementations.

Modifications:

Always check if the buffer is released before all to return the byte array and memoryaddress.

Result:

No more JVM crashes because of released buffers when doing bulk operations on Unsafe*ByteBuf implementations.

Ensure buffer is not released when call array() / memoryAddress()

Motivation:

Before we missed to check if a buffer was released before we return the backing byte array or memoryaddress. This could lead to JVM crashes when someone tried various bulk operations on the Unsafe*ByteBuf implementations.

Modifications:

Always check if the buffer is released before all to return the byte array and memoryaddress.

Result:

No more JVM crashes because of released buffers when doing bulk operations on Unsafe*ByteBuf implementations.

Ensure buffer is not released when call array() / memoryAddress()

Motivation:

Before we missed to check if a buffer was released before we return the backing byte array or memoryaddress. This could lead to JVM crashes when someone tried various bulk operations on the Unsafe*ByteBuf implementations.

Modifications:

Always check if the buffer is released before all to return the byte array and memoryaddress.

Result:

No more JVM crashes because of released buffers when doing bulk operations on Unsafe*ByteBuf implementations.

Rewrite HttpObjectDecoder to make use of proper state machine

Motivation:

HttpObjectDecoder extended ReplayDecoder which is slightly slower then ByteToMessageDecoder.

Modifications:

- Changed super class of HttpObjectDecoder from ReplayDecoder to ByteToMessageDecoder.

- Rewrote decode() method of HttpObjectDecoder to use proper state machine.

- Changed private methods HeaderParser.parse(ByteBuf), readHeaders(ByteBuf) and readTrailingHeaders(ByteBuf), skipControlCharacters(ByteBuf) to consider available bytes.

- Set HeaderParser and LineParser as static inner classes.

- Replaced not safe actualReadableBytes() with buffer.readableBytes().

Result:

Improved performance of HttpObjectDecoder by approximately 177%.

Rewrite HttpObjectDecoder to make use of proper state machine

Motivation:

HttpObjectDecoder extended ReplayDecoder which is slightly slower then ByteToMessageDecoder.

Modifications:

- Changed super class of HttpObjectDecoder from ReplayDecoder to ByteToMessageDecoder.

- Rewrote decode() method of HttpObjectDecoder to use proper state machine.

- Changed private methods HeaderParser.parse(ByteBuf), readHeaders(ByteBuf) and readTrailingHeaders(ByteBuf), skipControlCharacters(ByteBuf) to consider available bytes.

- Set HeaderParser and LineParser as static inner classes.

- Replaced not safe actualReadableBytes() with buffer.readableBytes().

Result:

Improved performance of HttpObjectDecoder by approximately 177%.

Rewrite HttpObjectDecoder to make use of proper state machine

Motivation:

HttpObjectDecoder extended ReplayDecoder which is slightly slower then ByteToMessageDecoder.

Modifications:

- Changed super class of HttpObjectDecoder from ReplayDecoder to ByteToMessageDecoder.

- Rewrote decode() method of HttpObjectDecoder to use proper state machine.

- Changed private methods HeaderParser.parse(ByteBuf), readHeaders(ByteBuf) and readTrailingHeaders(ByteBuf), skipControlCharacters(ByteBuf) to consider available bytes.

- Set HeaderParser and LineParser as static inner classes.

- Replaced not safe actualReadableBytes() with buffer.readableBytes().

Result:

Improved performance of HttpObjectDecoder by approximately 177%.

HTTP Content Encoder allow EmptyLastHttpContent

Motiviation:

The HttpContentEncoder does not account for a EmptyLastHttpContent being provided as input. This is useful in situations where the client is unable to determine if the current content chunk is the last content chunk (i.e. a proxy forwarding content when transfer encoding is chunked).

Modifications:

- HttpContentEncoder should not attempt to compress empty HttpContent objects

Result:

HttpContentEncoder supports a EmptyLastHttpContent to terminate the response.

HTTP Content Encoder allow EmptyLastHttpContent

Motiviation:

The HttpContentEncoder does not account for a EmptyLastHttpContent being provided as input. This is useful in situations where the client is unable to determine if the current content chunk is the last content chunk (i.e. a proxy forwarding content when transfer encoding is chunked).

Modifications:

- HttpContentEncoder should not attempt to compress empty HttpContent objects

Result:

HttpContentEncoder supports a EmptyLastHttpContent to terminate the response.

HTTP Content Encoder allow EmptyLastHttpContent

Motiviation:

The HttpContentEncoder does not account for a EmptyLastHttpContent being provided as input. This is useful in situations where the client is unable to determine if the current content chunk is the last content chunk (i.e. a proxy forwarding content when transfer encoding is chunked).

Modifications:

- HttpContentEncoder should not attempt to compress empty HttpContent objects

Result:

HttpContentEncoder supports a EmptyLastHttpContent to terminate the response.

Explicit allow to enable / disable session cache

Motivation:

It is sometimes useful to enable / disable the session cache.

Modifications:

* Add OpenSslSessionContext.setSessionCacheEnabled(...) and isSessionCacheEnabled()

Result:

It is now possible to enable / disable cache on the fly

Explicit allow to enable / disable session cache

Motivation:

It is sometimes useful to enable / disable the session cache.

Modifications:

* Add OpenSslSessionContext.setSessionCacheEnabled(...) and isSessionCacheEnabled()

Result:

It is now possible to enable / disable cache on the fly

Explicit allow to enable / disable session cache

Motivation:

It is sometimes useful to enable / disable the session cache.

Modifications:

* Add OpenSslSessionContext.setSessionCacheEnabled(...) and isSessionCacheEnabled()

Result:

It is now possible to enable / disable cache on the fly

Allow to enable session cache when using OpenSsl

Motivation:

At the moment it is not possible to make use of the session cache when OpenSsl is used. This should be possible when server mode is used.

Modifications:

- Add OpenSslSessionContext (implements SSLSessionContext) which exposes all the methods to modify the session cache.

- Add various extra methods to OpenSslSessionContext for extra functionality

- Return OpenSslSessionContext when OpenSslEngine.getSession().getContext() is called.

- Add sessionContext() to SslContext

- Move OpenSsl specific session operations to OpenSslSessionContext and mark the old methods @deprecated

Result:

It's now possible to use session cache with OpenSsl

Allow to enable session cache when using OpenSsl

Motivation:

At the moment it is not possible to make use of the session cache when OpenSsl is used. This should be possible when server mode is used.

Modifications:

- Add OpenSslSessionContext (implements SSLSessionContext) which exposes all the methods to modify the session cache.

- Add various extra methods to OpenSslSessionContext for extra functionality

- Return OpenSslSessionContext when OpenSslEngine.getSession().getContext() is called.

- Add sessionContext() to SslContext

- Move OpenSsl specific session operations to OpenSslSessionContext and mark the old methods @deprecated

Result:

It's now possible to use session cache with OpenSsl

Allow to enable session cache when using OpenSsl

Motivation:

At the moment it is not possible to make use of the session cache when OpenSsl is used. This should be possible when server mode is used.

Modifications:

- Add OpenSslSessionContext (implements SSLSessionContext) which exposes all the methods to modify the session cache.

- Add various extra methods to OpenSslSessionContext for extra functionality

- Return OpenSslSessionContext when OpenSslEngine.getSession().getContext() is called.

- Add sessionContext() to SslContext

- Move OpenSsl specific session operations to OpenSslSessionContext and mark the old methods @deprecated

Result:

It's now possible to use session cache with OpenSsl

Rename from 'The Netty project' to 'Netty'

Motivation:

Sonar uses the project name in the pom.xml as the project name. (no pun

intended) 4.x and master uses 'Netty' as the project name, so we should

be consistent.

Modifications:

Rename the project from 'The Netty project' to 'Netty'

Result:

Prettier SonarQube result

Headers set/add/contains timeMillis methods

Motivation:

The new Headers interface contains methods to getTimeMillis but no add/set/contains variants. These should be added for consistency.

Modifications:

- Add three new methods: addTimeMillis, setTimeMillis, containsTimeMillis to the Headers interface.

- Add a new method to the Headers.ValueConverter interface: T convertTimeMillis(long)

- Bring these new interfaces up the class hierarchy

Result:

All Headers classes have setters/getters for timeMillis.

Headers set/add/contains timeMillis methods

Motivation:

The new Headers interface contains methods to getTimeMillis but no add/set/contains variants. These should be added for consistency.

Modifications:

- Add three new methods: addTimeMillis, setTimeMillis, containsTimeMillis to the Headers interface.

- Add a new method to the Headers.ValueConverter interface: T convertTimeMillis(long)

- Bring these new interfaces up the class hierarchy

Result:

All Headers classes have setters/getters for timeMillis.

Closure of stream with pending frames causes GO_AWAY.

Motivation:

The current logic in DefaultHttp2OutboundFlowController for handling the

case of a stream shutdown results in a Http2Exception (not a

Http2StreamException). This results in a GO_AWAY being sent for what

really could just be a stream-specific error.

Modifications:

Modified DefaultHttp2OutboundFlowController to set a stream exception

rather than a connection-wide exception. Also using the error code of

INTERNAL_ERROR rather than STREAM_CLOSED, since it's more appropriate

for this case.

Result:

Should not be triggering GO_AWAY when a stream closes prematurely.

HTTP/2 to HTTP/1 non-ascii headers reset stream

Motivation:

The HTTP/2 specification indicates that when converting from HTTP/2 to HTTP/1.x and non-ascii characters are detected that an error should be thrown.

Modifications:

- The ASCII validation is already done but the exception that is raised is not properly converted to a RST_STREAM error.

Result:

- If HTTP/2 to HTTP/1.x translation layer is in use and a non-ascii header is received then a RST_STREAM frame should be sent in response.

Remove the unused .travis.yml

Keeping HTTP/2 HEADERS frames in-place WRT DATA frames.

Motivation:

Currently due to flow control, HEADERS frames can be written

out-of-order WRT DATA frames.

Modifications:

When data is written, we preserve the future as the lastWriteFuture in

the outbound flow controller. The encoder then uses the lastWriteFuture

such that headers are only written after the lastWriteFuture completes.

Result:

HEADERS/DATA write order is correctly preserved.

HTTP/2 OutboundFlowControl negative window excpetion

Motivation:

The DefaultOutboundFlowController was attempting to write frames with a negative length. This resulted in attempting to allocate a buffer of negative size and thus an exception.

Modifications:

- Don't allow DefaultOutboundFlowController to write negative length buffers.

Result:

No more negative length writes which resulted in IllegalArgumentExceptions.

Replace HttpHeaders.getDate() with getTimeMillis()

Motivation:

Headers has getTimeMillis(), not getDate()

Modification:

- Replace HttpHeaders.getDate() with getTimeMillis() so that migration

is smoother

Result:

User code which accesses a date header is easier to migrate

Remove CollectionUtils

Motivation:

CollectionUtils has only one method and it is used only in DefaultHeaders.

Modification:

Move CollectionUtils.equals() to DefaultHeaders and make it private

Result:

One less class to expose in our public API