Commit Graph

333 Commits

Author SHA1 Message Date
Norman Maurer
d946659520 [#1906] Use a ByteBuf allocator from the ByteBufAllocator when encode Strings 2013-10-09 21:18:08 +02:00
Norman Maurer
00f99dbff6 [#1893] Fix bug in JdkZlibDecoder which did not let it handle large data 2013-10-07 07:31:21 +02:00
Norman Maurer
aedd631dbb [#1798] Correctly handle skipping of too big frames 2013-08-29 13:51:50 +02:00
Norman Maurer
51a536fd30 Free up all buffers after the tests 2013-08-28 11:00:55 +02:00
Norman Maurer
7a38163743 [#1788] Correctly decode CRC32 and ISIZE when using JdkZlibDecoder
Because of incorrect decoding a CompressionException was thrown before
2013-08-28 11:00:47 +02:00
Derek Troy-West
6a4131c10f Currently the system variable to chose which type of zlib decoder is being negated 2013-08-27 08:27:34 +02:00
Norman Maurer
65d24a7647 [#1735] Disable usage of JdkZlibDecoder by default, will be enabled in 4.1.0.Final 2013-08-26 08:15:30 +02:00
Norman Maurer
39cabcd36c [#1481] Add a JdkZlibDecoder which has no dependencies 2013-08-14 07:41:28 +02:00
Norman Maurer
7d31943326 Remove some dead code 2013-08-11 21:37:43 +02:00
Norman Maurer
73755d1233 [#1729] Let StringEncoder extend MessageToMessageEncoder and so safe a memory copy 2013-08-11 21:24:02 +02:00
Norman Maurer
9a88c50ffb [#1728] Recycle list after done with it in ReplayingDecoder/ByteToMessageDecoder channelInactive(..) 2013-08-11 21:04:55 +02:00
Norman Maurer
26ddf0849f [#1714] Make sure ByteArrayDecoder also works correctly with pooled buffers 2013-08-09 08:40:43 +02:00
Norman Maurer
1547876e97 Tiny optimizations 2013-08-09 08:24:24 +02:00
Trustin Lee
87b17e195a Grammar 2013-08-05 17:40:45 +09:00
Norman Maurer
4d064d85df Rename class 2013-08-02 07:24:49 +02:00
Norman Maurer
ebee56ef49 More tests related to self removal from pipeline in ByteToMessageDecoder and ReplayingDecoder 2013-08-02 07:23:46 +02:00
Norman Maurer
487c28d93e Add testcases to prove that remove ReplayingDecoder/ByteToMessageDecoder from within the decode(...) method works 2013-08-01 20:42:46 +02:00
Norman Maurer
a06295fe0a Correctly fix problem in ByteToMessageDecoder and ReplayingDecoder which could let to have a released buffer passed to the decode methods.
This fixes #1664 and revert also the original commit which was meant to fix it 3b1881b523 . The problem with the original commit was that it could delay handlerRemove(..) calls and so mess up the order or forward bytes to late.
2013-08-01 09:54:07 +02:00
Norman Maurer
6ce8571df3 [#1668] Remove synchronized usage in JZlibEncoder and JdkZlibEncoder 2013-07-29 07:08:49 +02:00
Norman Maurer
6278d88d2f [#1656] Fix IndexOutOfBoundsException in MessageToMessageException 2013-07-26 11:46:26 +02:00
Norman Maurer
eb3283c59c [#1613] Allow to specify if direct buffers are prefered in ByteToMessageCodec 2013-07-19 09:39:06 +02:00
Trustin Lee
7215c011ca Fix resource leaks in the tests 2013-07-18 23:42:51 +09:00
Trustin Lee
fe59ab1b9c Fix resource leak in LengthFieldBasedFrameDecoderTest 2013-07-18 20:55:02 +09:00
Norman Maurer
22be797054 Use Unpooled to allocate buffer in Base64 2013-07-16 07:24:45 +02:00
Norman Maurer
7522d530ac Use the allocator of the src ByteBuf to allocate the new ByteBuf 2013-07-15 10:08:44 +02:00
Norman Maurer
2f7759a264 Remove unused package private classes 2013-07-14 23:50:27 +02:00
Norman Maurer
3140282ae3 Use the ByteBufAllocator when possible 2013-07-14 23:34:36 +02:00
Norman Maurer
ecb215c12f Fix buffer leaks 2013-07-14 22:50:53 +02:00
Norman Maurer
a07abee55f Add and correct javadocs 2013-07-13 19:42:02 +02:00
Norman Maurer
910c5fd594 Hide RecyclableArrayList from sub-classes 2013-07-13 16:57:44 +02:00
Norman Maurer
a8af577423 Add javadocs to methods that user may override and make the others final 2013-07-12 13:49:54 +02:00
Trustin Lee
765d470500 Remove UnreplayableOperationException
- Can't find a reason to keep it.
2013-07-12 20:40:39 +09:00
Norman Maurer
edb6786a5c Make the cumulation field in ByteToMessageDecoder package private to hide it 2013-07-12 13:29:54 +02:00
Norman Maurer
b57d9f307f Allow per-write promises and disallow promises on flush()
- write() now accepts a ChannelPromise and returns ChannelFuture as most
  users expected.  It makes the user's life much easier because it is
  now much easier to get notified when a specific message has been
  written.
- flush() does not create a ChannelPromise nor returns ChannelFuture.
  It is now similar to what read() looks like.
2013-07-11 00:49:48 +09:00
Norman Maurer
da5c6add14 Rename CodecOutput to RecyclableArrayList and move it to internal package.
* Also reuse it in SslHandler
2013-07-10 07:50:26 +02:00
Norman Maurer
768152cf88 Correctly handle forward of remaining data on removal 2013-07-09 22:41:56 +02:00
Trustin Lee
26e9d70457 Remove channelReadSuspended / Rename messageReceived(Last) to channelRead(Complete)
- Remove channelReadSuspended because it's actually same with messageReceivedLast
- Rename messageReceived to channelRead
- Rename messageReceivedLast to channelReadComplete

We renamed messageReceivedLast to channelReadComplete because it
reflects what it really is for.  Also, we renamed messageReceived to
channelRead for consistency in method names.
2013-07-09 23:58:51 +09:00
Trustin Lee
cbd8817905 Remove MessageList from public API and change ChannelInbound/OutboundHandler accordingly
I must admit MesageList was pain in the ass.  Instead of forcing a
handler always loop over the list of messages, this commit splits
messageReceived(ctx, list) into two event handlers:

- messageReceived(ctx, msg)
- mmessageReceivedLast(ctx)

When Netty reads one or more messages, messageReceived(ctx, msg) event
is triggered for each message.  Once the current read operation is
finished, messageReceivedLast() is triggered to tell the handler that
the last messageReceived() was the last message in the current batch.

Similarly, for outbound, write(ctx, list) has been split into two:

- write(ctx, msg)
- flush(ctx, promise)

Instead of writing a list of message with a promise, a user is now
supposed to call write(msg) multiple times and then call flush() to
actually flush the buffered messages.

Please note that write() doesn't have a promise with it.  You must call
flush() to get notified on completion. (or you can use writeAndFlush())

Other changes:

- Because MessageList is completely hidden, codec framework uses
  List<Object> instead of MessageList as an output parameter.
2013-07-09 23:51:48 +09:00
Trustin Lee
65c2a6ed46 Make ByteBuf an abstract class rather than an interface
- 5% improvement in throughput (HelloWorldServer example)
- Made CompositeByteBuf a concrete class (renamed from DefaultCompositeByteBuf) because there's no multiple inheritance in Java

Fixes #1536
2013-07-08 14:59:52 +09:00
Trustin Lee
da5a5af520 Add Test case for truncated SSL packets
- Related issue: #1534
- Also made sure ByteToMessageDecoder does not wrap EncoderException.
2013-07-07 11:52:34 +09:00
Norman Maurer
7dda4b9ce4 [#1532] Remove @deprecated ByteBufIndexFinder and all methods that take it as argument 2013-07-06 20:14:53 +02:00
Trustin Lee
a6bdd7cda4 Fix compilation errors 2013-07-01 17:27:45 +09:00
Norman Maurer
4dab51b619 Remove un-used method parameter 2013-06-28 20:41:10 +02:00
Norman Maurer
e234abdbf7 Add javadocs 2013-06-28 20:28:29 +02:00
Trustin Lee
0dcf352f4c Vastly simplified ByteBufProcessor and MessageListProcessor
- Related: #1378
- They now accept only one argument.
- A user who wants to use a buffer for more complex use cases, he or she can always access the buffer directly via memoryAddress() and array()
2013-06-28 20:29:00 +09:00
Norman Maurer
094d01873b Throw IllegalStateException if implementations of ByteToMessageDecoder and ByteToMessageCodec use @Sharable 2013-06-27 22:38:35 +02:00
Trustin Lee
ac39cad5ff Split ByteBuf.forEachByte() into forEachByte() and forEachByteDesc()
- Related: #1378
- As suggested by @liqweed
2013-06-27 18:48:09 +09:00
Trustin Lee
b5bb36c087 Use (fromIndex, toIndex) instead of (index, length) for ByteBuf.forEachByte(...)
- Related: #1378
2013-06-27 17:30:19 +09:00
Trustin Lee
792edf631c Deprecate ByteBufIndexFinder
- Prefer ByteBufProcessor
- Related: #1378
2013-06-27 14:26:58 +09:00
Trustin Lee
4dd9b6ef2e Add ByteBufProcessor and ByteBuf.forEach(...)
- Fixes #1378
- Needs to provide optimized forEach implementations though.
2013-06-27 13:55:42 +09:00