Commit Graph

5548 Commits

Author SHA1 Message Date
Trustin Lee
99c01aa9f3 Rename formatUserMessage to formatSimple and use it in two-args formatter in LoggingHandler 2013-12-02 18:57:38 +09:00
Trustin Lee
0dddec8dfd Simplify two-args message formatter in LoggingHandler 2013-12-02 18:56:33 +09:00
Trustin Lee
4fcec8b87d Make LoggingHandler.appendHexDump(..) protected for the subclasses 2013-12-02 18:48:19 +09:00
Trustin Lee
5e575daefc Optimize and clean up LoggingHandler
- Use ': ' instead of '(...)' for simpler string concatenation and prettier presentation
- Optimize the overall performance of format*() methods
- All format*() methods are now expected to encode the channel information by themselves so that StringBuilder instances are created less often.
- Use a look-up table for generating per-row prefixes
- Hid formatByteBuf(), formatByteBufHolder(), and formatNonByteBuf() from user because a user can always override format(ctx, eventName, arg).  For example, to disable hexdump:

    protected void format(ChannelHandlerContext ctx, String eventName, Object arg) {
        if (arg instanceof ByteBuf) {
            super.format(ctx, eventName, arg.toString());
        } else {
            super.format(ctx, eventName, arg);
        }
    }
2013-12-02 18:44:30 +09:00
Norman Maurer
a4e4479407 Fix checkstyle 2013-12-02 08:24:15 +01:00
Norman Maurer
d66bffe271 [#2021] No need to synchronize for unpooled chunks 2013-12-02 08:02:32 +01:00
Norman Maurer
4a680a3b49 Remove the use of ThreadLocal for performance reasons 2013-11-29 19:18:27 +01:00
Trustin Lee
8b495bb6e1 Fix bugs in ZLIB codec where they produce malformed stream or their streams are not flushed on time
- Fixes #2014
- Add the tests that mix JDK ZLIB codec and JZlib codecs
- Fix a bug where JdkZlibEncoder does not encode the GZIP header when nothing was written to te channel
- Fix a bug where the encoders do not consider the overhead of the wrapper format when calculating the estimated compressed output size.
- Fix a bug where the decoders do not discard the received data after the compressed stream is finished
2013-11-29 18:08:34 +09:00
Norman Maurer
4ea39aa9df Fix test 2013-11-28 13:50:08 +01:00
Norman Maurer
dab954dfb5 Merge buffers for performance reasons if possible when encode http requests/responses. 2013-11-28 13:48:34 +01:00
Trustin Lee
387f6917af Add test case for HttpHeaders.equalsIgnoreCase(...) 2013-11-28 18:24:03 +09:00
Trustin Lee
d4fd7ff458 Fix NPE raised by HttpHeaders.equalsIgnoreCases() when one of its arguments is null 2013-11-28 15:51:13 +09:00
Norman Maurer
b067566a7c Optimize the decoding and encoding of HTTP for better performance
* No need to calculate the hash of known header names multiple times
* Optimize header encoding
* Also optimize the encoding of known header values
* Optimize encoding of HTTP method, version and status
2013-11-27 12:35:58 +01:00
Trustin Lee
8be11dd79a Fix maven-bundle-plugin life cycle mapping in Eclipse 2013-11-27 18:54:51 +09:00
Trustin Lee
974d1ebf0a Merge package private interfaces into public ones.
- Related: #1989 and #1991
2013-11-27 18:42:23 +09:00
Trustin Lee
110745b0eb Remove the distinction of inbound handlers and outbound handlers
- Fixes #1808
- Move all methods in ChannelInboundHandler and ChannelOutboundHandler up to ChannelHandler
- Remove ChannelInboundHandler and ChannelOutboundHandler
- Deprecate ChannelInboundHandlerAdapter, ChannelOutboundHandlerAdapter, and ChannelDuplexHandler
- Replace CombinedChannelDuplexHandler with ChannelHandlerAppender
  because it's not possible to combine two handlers into one easily now
- Introduce 'Skip' annotation to pass events through efficiently
- Remove all references to the deprecated types and update Javadoc
2013-11-27 17:31:28 +09:00
Trustin Lee
807d96ed6c Simplify bundle generation / Add io.netty.versions.properties to all JARs
- Fixes #2003 properly
- Instead of using 'bundle' packaging, use 'jar' packaging.  This is
  more robust because some strict build tools fail to retrieve the
  artifacts from a Maven repository unless their packaging is not 'jar'.
- All artifacts now contain META-INF/io.netty.version.properties, which
  provides the detailed information about the build and repository.
- Removed OSGi testsuite temporarily because it gives false errors
  during split package test and examination.
- Add io.netty.util.Version for easy retrieval of version information
2013-11-26 22:00:14 +09:00
Norman Maurer
10e3651bf8 [#2006] Correctly handle HttpMessage / HttpContent implementations 2013-11-26 10:57:50 +01:00
Norman Maurer
98845cb392 [#2005] Allow to use HttpContentDecompressor in strict mode 2013-11-26 08:20:56 +01:00
Norman Maurer
daeaaf25a9 Respect validateHeaders when duplicate/copy the response/request 2013-11-26 08:12:58 +01:00
Norman Maurer
279e2e3cd2 Optimize DefaultHttpHeaders.contains(...) 2013-11-24 14:42:33 +01:00
Norman Maurer
8eb88b7889 Optimize check for equals header name and value 2013-11-24 14:32:55 +01:00
Norman Maurer
75280ac6e3 [#2003] Generate a io.netty.util.Version class which holds the version 2013-11-24 13:41:07 +01:00
Norman Maurer
a01f246091 Fix compile errors caused by last commit 2013-11-24 10:32:05 +01:00
Norman Maurer
f84a50d3cb Use the same HttpHeaders optimisations in master as in 4.0 2013-11-24 10:19:15 +01:00
Norman Maurer
0fa6dcefc5 [#1682] HttpVersion.valueOf(...) should not convert to uppercase 2013-11-23 20:35:47 +01:00
Michael Nitschinger
8b5f8de2ef Avoid memory leak when encoding the key 2013-11-22 19:22:45 +01:00
Trustin Lee
132af3a485 Introduce ChannelHandlerInvoker, dedeciated for invoking event handler methods, and move most handler invocation code in ChannelHandlerContext to the default ChannelHandlerInvoker implementation
- Fixes #1912
- Add ChannelHandlerInvoker and its default implementation
- Add pipeline manipulation methods that accept ChannelHandlerInvoker
- Rename Channel(Inbound|Outbound)Invoker to
  Channel(Inbound|Outbound)Ops to avoid confusion
- Remove the Javadoc references to the package-private interfaces
2013-11-21 14:14:23 +09:00
Alex Petrov
883ab29d05 Improve doc of IdleStateHandler according to example given in UptimeClientHandler (L57) 2013-11-20 10:24:09 +01:00
Norman Maurer
43943c7ab1 [#1994] DefaultPromise.cancel() should reuse CancellationException for performance reasons 2013-11-19 18:01:20 +01:00
Trustin Lee
d0e928db70 Additional fix for potential race condition which occurs when a user cancels a connection attempt
- Fixes #1986
2013-11-18 17:00:23 +09:00
Trustin Lee
38f57adb70 Fix an unexpected IllegalStateException from a selector loop when a user cancels a connection attempt
- Fixes #1986
2013-11-18 16:33:49 +09:00
Trustin Lee
786fdbd6e0 Bring back ChannelGroup.find(id) 2013-11-18 15:59:44 +09:00
Trustin Lee
2235873537 Resurrect Channel.id() with global uniqueness
- Fixes #1810
- Add a new interface ChannelId and its default implementation which generates globally unique channel ID.
- Replace AbstractChannel.hashCode with ChannelId.hashCode() and ChannelId.shortValue()
- Add variants of ByteBuf.hexDump() which accept byte[] instead of ByteBuf.
2013-11-18 15:30:12 +09:00
Daniel Bevenius
624573971f Support for empty HTTP request header values. 2013-11-17 15:49:14 +01:00
Trustin Lee
6ba1a85c4b Remove unnecessary parenthesis 2013-11-15 23:08:25 +09:00
Norman Maurer
6306b83e2d [#1982] Limit the usage of ThreadLocal.get() for performance reasons 2013-11-14 09:48:33 +01:00
Norman Maurer
41ccbfd388 Also allow to disable header validation via HttpServerCodec and HttpClientCodec. Related to [#1981] 2013-11-14 09:37:57 +01:00
Trustin Lee
6e2593ddc3 Fix regression introduced by 4c7fa950cc
- Some promises were not fulfilled when SSLEngine produces 0 bytes.
2013-11-14 15:08:10 +09:00
Daniel Bevenius
7cc2507076 Adding check for zero readable bytes in WebSocket08FrameDecoder decode. 2013-11-13 07:11:05 +01:00
Norman Maurer
d11d3a6b50 Also allow to override how direct ByteBuffers are freed 2013-11-12 12:44:11 +01:00
Norman Maurer
9b7d286652 Allow to override how wrapped direct ByteBuffer are allocated to make it easier to extend 2013-11-12 12:44:00 +01:00
Norman Maurer
329bbfcd87 [#1976] Fix IndexOutOfBoundsException when calling CompositeByteBuf.discardReadComponents() 2013-11-09 20:13:43 +01:00
Alex Petrov
519c632b2e Improve docstrings for and of 2013-11-08 12:23:43 +01:00
Trustin Lee
daf15fc167 Don't create an EmbeddedSocketAddress every time 2013-11-08 18:01:29 +09:00
Trustin Lee
9125977692 Simpler toString() for ByteBufAllocators 2013-11-08 17:53:57 +09:00
Trustin Lee
4c7fa950cc Optimize SslHandler
- Fixes #1905
- Call ctx.flush() only when necessary
- Improve the estimation of application and packet buffer sizes
- decode() method now tries to call unwrap() with as many SSL records as
  possible to reduce the number of events triggered
2013-11-08 17:42:28 +09:00
Norman Maurer
a86e215718 Fix regression which lead to leak buffers when nothing could be read from the Channel.
This was introduced as part of #1812, but fortunatualy was not part of any release.
2013-11-07 07:13:20 +01:00
Michael Nitschinger
ea7b690430 add docs and testing for the LoggingHandler. 2013-11-06 18:19:19 +01:00
Trustin Lee
7fff25c0de Remove AUTO_CLOSE option
- Related #1952
- Since 5.0, we ask users decide to close the channel on write failure.
2013-11-05 17:34:48 +09:00