Commit Graph

5730 Commits

Author SHA1 Message Date
Norman Maurer
bdedde1294 [#1259] Add optimized queue for SCMP pattern and use it in NIO and native transport
This queue also produces less GC then CLQ when make use of OneTimeTask
2014-02-27 11:44:06 +01:00
Trustin Lee
927e330cfe Fix a compilation error 2014-02-26 16:44:17 -08:00
Trustin Lee
8ffa168ab8 Fix checkstyle 2014-02-26 16:18:32 -08:00
Trustin Lee
0d210f45f2 Fix a bug where HttpObjectDecoder generates two LastHttpContent consecutively
Motivation:
When an HttpResponseDecoder decodes an invalid chunk, a LastHttpContent instance is produced and the decoder enters the 'BAD_MESSAGE' state, which is not supposed to produce a message any further.  However, because HttpObjectDecoder.invalidChunk() did not clear this.message out to null, decodeLast() will produce another LastHttpContent message on a certain situation.

Modification:
Do not forget to null out HttpObjectDecoder.message in invalidChunk(), and add a test case for it.

Result:
No more consecutive LastHttpContent messages produced by HttpObjectDecoder.
2014-02-26 15:54:33 -08:00
Norman Maurer
ccd135df01 [maven-release-plugin] prepare for next development iteration 2014-02-24 15:39:26 +01:00
Norman Maurer
33587eb183 [maven-release-plugin] prepare release netty-4.0.17.Final 2014-02-24 15:37:31 +01:00
Michael Nitschinger
b3b73be61c Upgrade JMH to 0.4.1 and make use of @Params. 2014-02-23 16:40:04 +01:00
cmcmaugh
d21197e0fc Apply receive timeout to commPort when using RxtxChannel. Part of [#1390] 2014-02-23 16:34:17 +01:00
Norman Maurer
c538fd5098 Fix check to clear READ_OP and EPOLLIN. Part of [#2254] 2014-02-22 20:06:35 +01:00
Norman Maurer
b00e2a19d3 [#2254] Correctly handle Channel.read() and ChannelHandlerContext.read()
This includes also when it is called from channelRead(...) and channelReadComplete(...) methods.
2014-02-22 18:45:36 +01:00
Trustin Lee
0fc66a411f The default buffer must be unpooled for backward compatibility
Mistakenly set to pooled while merging the changes from 4.1 and master.
2014-02-21 14:43:07 -08:00
Norman Maurer
7fe10fe635 [#2254] Fix regression in handling autoRead and Channel.read()
This regression was introduced by e0b39159657c9eb711047bc32367537c4870d467
2014-02-21 08:39:41 +01:00
Trustin Lee
5c27273885 Avoid unnecessary IllegalStateException in ChunkedWriteHandler
Motivation:
ChunkedWriteHandler can sometimes fail to write the last chunk of a ChunkedInput due to an I/O error.  Subsequently, the ChunkedInput's associated promise is marked as failure and the connection is closed.  When the connection is closed, ChunkedWriteHandler attempts to clean up its message queue and to mark their promises as success or failure.  However, because the promise of the ChunkedInput, which was consumed completely yet failed to be written, is already marked as failure, the attempt to mark it as success fails, leading a WARN level log.

Modification:
Use trySuccess() instead of setSuccess() so that the attempt to mark a ChunkedInput as success does not raise an exception even if the promise is already done.

Result:
Fixes #2249
2014-02-20 17:14:53 -08:00
Jeff Pinner
d838a07c14 SPDY: remove SPDY/3 support 2014-02-20 15:00:04 -08:00
Norman Maurer
66e2bb1e75 [maven-release-plugin] prepare for next development iteration 2014-02-19 03:41:24 +01:00
Norman Maurer
c466bb803d [maven-release-plugin] prepare release netty-4.0.16.Final 2014-02-19 03:36:54 +01:00
Norman Maurer
e74b5fc2fa Fix a regression which could lead to GenericFutureListeners never been notifed. Part of [#2186].
This regression was introduced by commit c97f2d2de00ad74835067cb6f5a62cd4651d1161
2014-02-20 15:01:09 +01:00
Trustin Lee
f120b6c390 Fix a bug where HttpObjectAggregator doesn't always produce FullHttpMessage
- Fixes #2182
- Always convert an unfull invalid message to a full message
2014-02-19 15:33:42 -08:00
Trustin Lee
00d982994c Ensure that the last bad chunk is LastHttpChunk 2014-02-19 15:20:48 -08:00
Trustin Lee
3fb65db8d1 HttpObjectDecoder.invalidChunk() should return LastHttpChunk
because the decoder will enter 'BAD_MESSAGE' state and will not produce any chunk since then.
2014-02-19 14:59:11 -08:00
Norman Maurer
34e11d2e16 Correctly handle remove from epoll and EPOLLRDHUP. Also fix a bug with removing EPOLLIN and EPOLLOUT 2014-02-19 16:30:24 +01:00
Norman Maurer
01d2f3f141 Ensure native transport is included in all and tarball 2014-02-17 22:44:37 +01:00
Norman Maurer
b2a0a25b8f Use optimized write and read calls if memoryAddress is present. Part of [#2239] 2014-02-17 21:06:57 +01:00
Norman Maurer
32e28950e1 Move marking ChannelPromise for writes uncancellable to addFlush for keep things simple 2014-02-17 16:14:25 +01:00
Trustin Lee
61bfd46264 Fix an inspector warning 2014-02-17 05:25:58 -08:00
Trustin Lee
ab257b0ac6 Overall clean-up in EpollSocketChannel
- Extract writev part from doWrite() for simplicity
- Clearer comments
2014-02-17 05:21:34 -08:00
Norman Maurer
ea73d074f2 [#2238] Fix bug which caused a SIGSEGV when calling remoteAddress() or localAddress() 2014-02-17 11:59:28 +01:00
Norman Maurer
84b537519c Correctly update the ByteBuffers position on write and writev 2014-02-17 07:30:06 +01:00
Trustin Lee
7f41faeb86 Optimize imports 2014-02-16 11:53:51 -08:00
Trustin Lee
c4936fe9a7 Fix resource leaks in ByteArrayEncoderTest 2014-02-16 11:52:43 -08:00
Norman Maurer
04dab876b6 Use correct writerIndex when read for channel 2014-02-16 20:21:14 +01:00
Norman Maurer
1edca5f8d9 Introduce a native transport for linux using epoll ET
This transport use JNI (C) to directly make use of epoll in Edge-Triggered mode for maximal performance on Linux. Beside this it also support using TCP_CORK and produce less GC then the NIO transport using JDK NIO.
It only builds on linux and skip the build if linux is not used. The transport produce a jar which contains all needed .so files for 32bit and 64 bit. The user only need to include the jar as dependency as usually
to make use of it and use the correct classes.

This includes also some cleanup of @trustin
2014-02-15 22:27:43 +01:00
Trustin Lee
f4074a8811 Fix compilation errors introduced by sloppy merge 2014-02-15 11:31:01 -08:00
Trustin Lee
11a235ffe9 Use thread local direct buffer for I/O when the current allocator is unpooled
- Allocating and deallocating a direct buffer for I/O is an expensive
  operation, so we have to at least have a pool of direct buffers if the
  current allocator is not pooled
2014-02-15 11:27:04 -08:00
Trustin Lee
ab1a7b9774 Fix inefficient loop in QueryStringDecoder.decodeComponent()
- Fixes #2228
- There's no point of looping until the end of the component if at least one '%' or '+' is found.
2014-02-14 13:27:18 -08:00
Michael Nitschinger
268988378f Update JMH to 0.3.2 2014-02-14 13:16:22 -08:00
Trustin Lee
b18c8fe688 Determine the default allocator from system property
- Add ByteBufAllocator.DEFAULT
- The default allocator is 'unpooled'
2014-02-14 13:05:57 -08:00
Trustin Lee
dd4ed6aa14 Do not warn about Unsafe in Android 2014-02-14 12:07:16 -08:00
Trustin Lee
51829a5706 Fix wiki link 2014-02-14 12:04:28 -08:00
Trustin Lee
1ddf91828d Do not use String.format() for log message generation
- It's slow.
2014-02-13 19:33:36 -08:00
Norman Maurer
69a36b8bea Prettify exception message 2014-02-13 06:46:51 +01:00
Norman Maurer
62ebe88981 Allow to set IoRatio to 100% 2014-02-12 15:22:39 +01:00
Norman Maurer
80e6f9adf4 Correctly respect isAutoRead() and make it consistent across OIO/NIO 2014-02-11 20:46:46 +01:00
Norman Maurer
7041a9238e Allow to cancel non-flushed writes 2014-02-11 19:42:49 +01:00
Trustin Lee
d52dc3b740 Do not warn if failed to mark a void promise as success
- it's always supposed to fail.
2014-02-10 15:03:46 -08:00
Trustin Lee
96b0a949e1 Make most outbound operations cancellable / More robust promise update
- Inspired by #2214 by @normanmaurer
- Call setUncancellable() before performing an outbound operation
- Add safeSetSuccess/Failure() and use them wherever
2014-02-10 14:57:18 -08:00
Trustin Lee
852a7cec77 Make the build not fail in JDK8 until we fix Javadoc 2014-02-10 14:11:38 -08:00
Trustin Lee
041d37e0c8 Make most outbound operations are cancellable
- Inspired by #2214
- It actually reduces the chance of trying to marking a cancelled promise as success again, which raises an IllegalStateException.
2014-02-10 14:06:54 -08:00
Trustin Lee
838e80ed6b Fix external Javadoc url 2014-02-10 13:40:30 -08:00
Trustin Lee
0e71da3082 Fix a bug where DefaultPromise.setUncancellable() returns a wrong value
- Fixes #2220 - again
- Missing negation
2014-02-10 11:48:20 -08:00