Commit Graph

5627 Commits

Author SHA1 Message Date
Michael Nitschinger
f03c32e137 [codec-memcache] encode key directly, no need to use unpooled. 2014-02-13 16:51:51 -08:00
Michael Nitschinger
a1526bedd3 codec-memcache: removed println in test case. 2014-02-13 16:51:45 -08:00
Michael Nitschinger
183bfe8f9f codec-memcache: fix decoding issue for value parts.
This changeset fixes an issue when decoding would stop if the value
comes separated in two or more packets, leading to invalid bytes read.
2014-02-13 16:51:37 -08:00
Trustin Lee
3d874f0bd7 Improve documentation for the two-args formatter in LoggingHandler 2014-02-13 16:51:26 -08:00
Trustin Lee
fbed62249c Rename formatUserMessage to formatSimple and use it in two-args formatter in LoggingHandler 2014-02-13 16:51:15 -08:00
Trustin Lee
a9150ee7d6 Simplify two-args message formatter in LoggingHandler 2014-02-13 16:51:06 -08:00
Trustin Lee
2e58497160 Make LoggingHandler.appendHexDump(..) protected for the subclasses 2014-02-13 16:50:50 -08:00
Trustin Lee
835b4443f3 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);
        }
    }
2014-02-13 16:50:31 -08:00
Norman Maurer
f6ffc5c1c7 [#1682] HttpVersion.valueOf(...) should not convert to uppercase 2014-02-13 16:36:36 -08:00
Michael Nitschinger
c78544cfaa Avoid memory leak when encoding the key 2014-02-13 16:36:09 -08:00
Vladimir Krivosheev
eb308cfff6 ability to use Executor instead of ThreadFactory 2014-02-13 16:14:41 -08:00
Trustin Lee
780516471f Bring back ChannelGroup.find(id) 2014-02-13 15:53:45 -08:00
Trustin Lee
40003ed250 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.
2014-02-13 15:53:07 -08:00
Trustin Lee
ef4bc99849 Remove unnecessary parenthesis 2014-02-13 15:52:06 -08:00
Daniel Bevenius
fa33529ca5 Adding check for zero readable bytes in WebSocket08FrameDecoder decode. 2014-02-13 15:49:44 -08:00
Trustin Lee
812481602a Don't create an EmbeddedSocketAddress every time 2014-02-13 15:45:47 -08:00
Trustin Lee
d748113c7d Abstract classes' names should start with 'Abstract' 2014-02-13 15:39:05 -08:00
Trustin Lee
71b6439c66 Fixed various inspector warnings 2014-02-13 15:38:52 -08:00
Trustin Lee
3dd7fba320 Moved constant classes out of util 2014-02-13 15:38:20 -08:00
Michael Nitschinger
5551fc7351 adding memcache codec to netty-all project. 2014-02-13 15:38:08 -08:00
Trustin Lee
a327a25a6c Use StringUtil.simpleClassName(..) instead of Class.getSimpleName() where necessary
- Class.getSimpleName() doesn't render anonymous classes very well
- + some minor cleanup
2014-02-13 15:37:16 -08:00
Michael Nitschinger
20f6f7e018 Implementing the Binary Memcache protocol
This changeset implements the full memcache binary protocol spec, including
a first batch of tests. Ascii protocol and more coverage and helper classes
will follow.
2014-02-13 15:29:38 -08:00
Trustin Lee
ebc78dab1d Add a getter method for accessing the ClassPool of JavassistTypeParameterMatcherGenerator
.. so that a user can even manipulate the class pool as they wish.
2014-02-13 15:25:55 -08:00
Trustin Lee
a5f33f4020 Fix some inspector warnings 2014-02-13 15:25:09 -08:00
fredericBregier
651c7b056a Split HttpPostRequestDecoder into HttpPostStandardRequestDecoder and HttpPostMultipartRequestDecoder / Add HttpData.maxSize
- Related issues: #1937 #1938 and #1946
- Add InterfaceHttpPostRequestDecoder and Make HttpPostRequestDecoder implement it
- HttpPostRequestDecoder actually delegates itself to HttpPostStandardRequestDecoder or HttpPostMultipartRequestDecoder
- Remove IncompatibleDataDecoderException because it's not thrown anywhere now
2014-02-13 15:24:45 -08:00
Trustin Lee
499033d44f Add a shortcut method for collision-free naming 2014-02-13 15:17:09 -08:00
Trustin Lee
b533a1361b Replace UniqueName with Constant and ConstantPool
- Proposed fix for #1824

UniqueName and its subtypes do not allow getting the previously registered instance.  For example, let's assume that a user is running his/her application in an OSGi container with Netty bundles and his server bundle.  Whenever the server bundle is reloaded, the server will try to create a new AttributeKey instance with the same name.  However, Netty bundles were not reloaded at all, so AttributeKey will complain that the name is taken already (by the previously loaded bundle.)

To fix this problem:

- Replaced UniqueName with Constant, AbstractConstant, and ConstantPool.  Better name and better design.

- Sctp/Udt/RxtxChannelOption is not a ChannelOption anymore.  They are just constant providers and ChannelOption is final now.  It's because caching anything that's from outside of netty-transport will lead to ClassCastException on reload, because ChannelOption's constant pool will keep all option objects for reuse.

- Signal implements Constant because we can't ensure its uniqueness anymore by relying on the exception raised by UniqueName's constructor.
2014-02-13 15:14:34 -08:00
Norman Maurer
573b54a93d [#1907] LengthFieldPrepender should better extend MessageToMessageEncoder for less memory copies 2014-02-13 14:52:12 -08:00
Trustin Lee
2d96b32155 Clean-up ChannelOutboundBufferTest
- partial port of 136e1ebba8
2014-02-13 14:50:11 -08:00
Trustin Lee
a65f097d53 Allow empty handler list when creating a new EmbeddedChannel
.. so that it can be used for dynamically initialized pipelines

- Fixes #1899
2014-02-13 14:46:33 -08:00
Norman Maurer
517da2b46a Fix checkstyle 2014-02-13 14:36:14 -08:00
Bill Gallagher
7e5aa4a911 use enum for state in LocalChannel 2014-02-13 14:35:58 -08:00
Bill Gallagher
a19fe06928 use enum for state in EmbeddedChannel 2014-02-13 14:34:51 -08:00
Norman Maurer
60acd54c7e [#1876] Make use of proper state machine in WebSocket08FrameDecoder for performance reasons 2014-02-13 14:34:34 -08:00
Trustin Lee
449ce0dd7a Remove the irrelevant AIO channel options 2014-02-13 13:59:12 -08:00
Norman Maurer
85ab9b5982 [#1710] Add missing duplicate() overrides in interfaces 2014-02-13 13:57:28 -08:00
Trustin Lee
faaff9bd86 Backport the tests in ReentrantChannelTest
- Originally from c149f4bcc0 by @wgallagher
2014-02-13 13:55:39 -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
Trustin Lee
7e0e4c6325 Fix a bug where DefaultPromise.setUncancellable() returns a wrong value
- Fixes #2220
- Its Javadoc says it returns true when the promise is done (but not cancelled) or the promise is uncancellable, but it returns false when the promise is done.
2014-02-10 11:40:04 -08:00
Norman Maurer
084db044cd [#2219] Fix javadocs of HttpObjectAggregator to show correct handler order in pipeline 2014-02-09 17:10:09 +01:00
Trustin Lee
ed4f7305ce Remove the StringCache option which was removed in JDK8 2014-02-08 11:14:16 -08:00