Commit Graph

184 Commits

Author SHA1 Message Date
Norman Maurer
16eb4ec713 Revert "[maven-release-plugin] prepare for next development iteration"
This reverts commit e3e0776c20.
2012-10-28 18:35:47 +01:00
Norman Maurer
e3e0776c20 [maven-release-plugin] prepare for next development iteration 2012-10-28 13:06:07 +01:00
Norman Maurer
95de4db0f1 [maven-release-plugin] prepare release netty-4.0.0.Alpha6 2012-10-28 13:05:59 +01:00
Trustin Lee
8bab0aae9e Fix a bug in the SecureChat example where greeting is generated too soon 2012-10-16 15:00:32 -07:00
Trustin Lee
a6c4f651a7 [#661] WebSocketClientHandshaker is broken.
- Remove HttpRequestEncoder after handshaking is complete
- Fix a bug in the WebSocket client example where it sends a frame even before handshake is complete
2012-10-16 14:40:39 -07:00
Norman Maurer
6e98a04813 Fix the detection of encrypted data. See #655 2012-10-16 14:03:40 +02:00
Jestan Nirojan
8a75442419 Merge remote-tracking branch 'upstream/master' 2012-09-29 17:21:58 +08:00
Trustin Lee
ce35386805 Prevent cross-site scripting 2012-09-29 17:18:18 +09:00
Jestan Nirojan
6904b62c2f Resolved conflicts in SctpData/SctpMessage refactoring 2012-09-29 02:01:00 +08:00
Trustin Lee
820af50b63 [maven-release-plugin] prepare for next development iteration 2012-09-28 17:57:40 +09:00
Trustin Lee
595e1067c7 [maven-release-plugin] prepare release netty-4.0.0.Alpha5 2012-09-28 17:57:04 +09:00
Trustin Lee
9f6505192c Simplify if 2012-09-28 16:59:51 +09:00
Trustin Lee
eae7b2d662 [#532] HttpStaticFileServer should generate an index page
* Add index page listing and directory redirection
2012-09-28 16:58:26 +09:00
Trustin Lee
94838ee274 [#441] Provide a better way to handle decoder failures
* Rename isPartial() to isPartialFailure()
* Add isCompleteFailure() and isFailure()
2012-09-28 15:46:17 +09:00
Trustin Lee
045b621b3f [#441] Update HTTP examples so that they understand DecoderResult 2012-09-28 15:42:38 +09:00
Trustin Lee
bd8ee64366 Pull #625 from @CruzBishop selectively 2012-09-27 19:04:35 +09:00
Trustin Lee
a156f67804 [#624] Add varargs constructor to MessageToByteEncoder, MessageToMessage(Encoder|Decoder|Codec) to implement default isEncodable/isDecodable()
.. and modify all their subtypes to take advantage of this improvement.
2012-09-23 17:01:31 +09:00
Jestan Nirojan
942f05d336 Corrected cmd args in SCTP Sample clients 2012-09-23 14:16:26 +08:00
Jestan Nirojan
b268f0b333 Added SCTP Codec Handlers + minor refactoring 2012-09-23 14:12:32 +08:00
Jestan Nirojan
bf22173ed1 Added Multi-Homing in SctpOioChannel 2012-09-21 12:16:06 +08:00
Jestan Nirojan
db4a3a4789 Merge remote-tracking branch 'upstream/master' 2012-09-21 11:56:47 +08:00
Jestan Nirojan
47eafa386c Added SCTP OIO Transport
- Sctp OioChannel/ServeChannel implementation.
- Changed interrupt handling in OioEventLoop.
- SctpOioEchoClient/Server Example.
2012-09-21 11:56:13 +08:00
norman
3295145e88 [maven-release-plugin] prepare for next development iteration 2012-09-13 10:40:52 +02:00
norman
42685759de [maven-release-plugin] prepare release netty-4.0.0.Alpha4 2012-09-13 10:40:44 +02:00
norman
df72356d7d Rename classes as result of descussion on #594 2012-09-12 14:04:41 +02:00
norman
ec1339d775 Finish the refactoring of bootstrap 2012-09-11 09:34:51 +02:00
Jestan Nirojan
22cbaa489a Ported SCTP Transport
- Ported SCTP Echo Server/Client Example
- Added SctpMessage, SctpData and SctpNotification classes
2012-09-04 17:47:48 +05:30
Trustin Lee
f2538a996d [maven-release-plugin] prepare for next development iteration 2012-08-30 16:47:52 +09:00
Trustin Lee
628c5598b3 [maven-release-plugin] prepare release netty-4.0.0.Alpha3 2012-08-30 16:46:58 +09:00
Trustin Lee
73720c422d [maven-release-plugin] prepare for next development iteration 2012-08-21 15:41:04 +09:00
Trustin Lee
68bef8cb99 [maven-release-plugin] prepare release netty-4.0.0.Alpha2 2012-08-21 15:40:45 +09:00
Trustin Lee
0a43350c66 [maven-release-plugin] prepare for next development iteration 2012-08-21 14:41:45 +09:00
Trustin Lee
56211fee59 [maven-release-plugin] prepare release netty-4.0.0.Alpha2 2012-08-21 14:39:59 +09:00
Trustin Lee
a0e34fd93a [maven-release-plugin] prepare for next development iteration 2012-08-21 14:13:38 +09:00
Trustin Lee
72ccf65093 [maven-release-plugin] prepare release netty-4.0.0.Alpha2 2012-08-21 14:13:17 +09:00
Trustin Lee
602f976e41 [#527] Add a new property to HttpMessage to help clarify its transfer encoding
- Add an enum: HttpTransferEncoding
  - consists of SINGLE, STREAMED, and CHUNKED
- Add HttpMessage.transferEncoding
  - replaces is/setChunked()
2012-08-19 19:06:47 +09:00
Cruz Julian Bishop
af0a7eaf13 Fix a typo in ObjectEchoClientHandler
This fixes #510 in master

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-08-14 19:52:27 +10:00
Trustin Lee
d3a2835503 Add ServerBootstrap.group() that takes a single group 2012-08-10 20:26:04 +09:00
Trustin Lee
d298707198 [#502] Split EventLoop/EventExecutor into parent and children
- Add EventExecutorGroup and EventLoopGroup
- EventExecutor and EventLoop extends EventExecutorGroup and
  EventLoopGroup
  - They form their own group so that .next() returns itself.
- Rename Bootstrap.eventLoop() to group()
- Rename parameter names such as executor to group
- Rename *EventLoop/Executor to *EventLoop/ExecutorGroup
- Rename *ChildEventLoop/Executor to *EventLoop/Executor
2012-08-10 20:17:18 +09:00
vibul
19ddb7a8e1 Increase websocket framesize for autobahn tests 2012-07-19 12:40:54 +10:00
Trustin Lee
d801459cb8 [maven-release-plugin] prepare for next development iteration 2012-07-10 23:11:33 +09:00
Trustin Lee
527f2f6c6e [maven-release-plugin] prepare release netty-4.0.0.Alpha1 2012-07-10 23:10:48 +09:00
Trustin Lee
6d2f6d697d Make CookieEncoder and CookieDecoder stateless
- Also: CookieEncoder is split into ServerCookieEncoder and
  ClientCookieEncoder
2012-06-26 05:26:54 +09:00
Trustin Lee
a6e3d7d0ca Fix #405: CookieEncoder should refuse to encode more than one cookie
.. if on server mode
2012-06-24 12:59:44 +09:00
Trustin Lee
1f69e664fb Forward-port JDK ZlibEncoder patch (#404)
- Rename ZlibEncoder/Decoder to JZlibEncoder/Decoder
- Define a new ZlibEncoder/Decoder class
- Add JdkZlibEncoder
- All JZlib* and JdkZlib* extends ZlibEncoder/Decoder
- Add ZlibCodecFactory and use it everywhere
2012-06-19 09:54:25 +09:00
Trustin Lee
ecd0ae5406 Prefer MessageBuf over Queue where possible
- Also replaced thread safe queues with non-thread-safe ones where
  possible
- Unpooled.wrappedBuffer(Queue<T>) does not wrap MessageBuf anymore
2012-06-12 17:02:00 +09:00
Trustin Lee
e1faea035e Automatic clean-up with Eclipse
- Mostly import organization & whitespace removal
2012-06-11 23:04:04 +09:00
Trustin Lee
6211e53e86 Code clean-up based on IntelliJ code analysis 2012-06-11 22:54:28 +09:00
Trustin Lee
876847fd20 Merge MessageBufs and ByteBufs into Unpooled
- e.g. Unpooled.messageBuffer()
- It will make much more sense once we introduce pooling:
  - i.e. Pooled.buffer()
2012-06-11 17:02:29 +09:00
Trustin Lee
574d84e98e Remove ChannelBufferHolder / Add more handler interfaces for type safety
- ChannelInboundHandler and ChannelOutboundHandler does not have a type
  parameter anymore.  
- User should implement ChannelInboundMessageHandler or
  ChannelOutboundMessageHandler.
2012-06-10 12:22:32 +09:00
Trustin Lee
a849d11877 ChannelBuffers -> ByteBufs / Add MessageBuf & ChannelBuf
- Add MessageBuf which replaces java.util.Queue
- Add ChannelBuf which is common type of ByteBuf and ChannelBuf
- ChannelBuffers was renamed to ByteBufs
- Add MessageBufs
- All these changes are going to replace ChannelBufferHolder.
2012-06-10 11:31:39 +09:00
Trustin Lee
5164d91255 Rename ChannelBuffer to ByteBuf as discussed before
- ChannelBuffer gives a perception that it's a buffer of a
  channel, but channel's buffer is now a byte buffer or a message
  buffer.  Therefore letting it be as is is going to be confusing.
2012-06-10 11:08:43 +09:00
Trustin Lee
87f52aa604 Ensure that a user implements flush() or inboundBufferUpdated()
- Also prohibited a user from overriding
  ChannelInbound(Byte|Message)HandlerAdapter.  If a user wants to do
  that, he or she should extend ChannelInboundHandlerAdapter instead.
2012-06-10 10:48:11 +09:00
Trustin Lee
e376888d48 Replace 'Stream' with 'Byte'
- In computing, 'stream' means both byte stream and message stream,
  which is confusing.
- Also, we were already mixing stream and byte in some places and
  it's better use the terms consistently.
  (e.g. inboundByteBuffer & inbound stream)
2012-06-09 21:05:59 +09:00
Trustin Lee
86cf144b8a Update the checkstyle rules 2012-06-09 05:07:34 +09:00
Trustin Lee
468a3228a4 Fit every line into 120 columns 2012-06-08 19:28:12 +09:00
Trustin Lee
493e77a5a7 Remove trailing whitespace 2012-06-08 11:14:47 +09:00
Trustin Lee
50fafdc3d3 Rewrite SslHandler / Reduce the chance of OIO-OIO dead lock
- SslHandler always begins handshake unless startTls is true
  - Removed issueHandshake property
  - If a user wants to start handshake later, he/she has to add 
    SslHandler later.
- Removed enableRenegotiation property
  - JDK upgrade fixes the security vulnerability - no need to complicate
    our code
- Some property name changes
  - getSSLEngineInboundCloseFuture() -> sslCloseFuture() 
- Updated securechat example
- Added timeout for handshake and close_notify for better security
  - However, it's currently hard-coded.  Will make it a property later.
2012-06-08 01:22:35 +09:00
Trustin Lee
994038975a Port HttpContentEncoder/Decoder to use EmbeddedStreamChannel / Cleanup
- Removed unused constructor parameter in AbstractChannel
- Re-enabled GZIP encoding in HTTP snoop example
2012-06-07 21:06:56 +09:00
Trustin Lee
6b819fb993 Fix a NPE in DefaultChannelPipeline.write(...)
- Also re-enabled logging handler in the echo example
2012-06-07 17:00:21 +09:00
Trustin Lee
5e93d206ff Overhaul - Split ChannelHandler & Merge ChannelHandlerContext
- Extracted some handler methods from ChannelInboundHandler into
  ChannelStateHandler
- Extracted some handler methods from ChannelOutboundHandler into
  ChannelOperationHandler
- Moved exceptionCaught and userEventTriggered are now in
  ChannelHandler
  
- Channel(Inbound|Outbound)HandlerContext is merged into
  ChannelHandlerContext
- ChannelHandlerContext adds direct access methods for inboud and
  outbound buffers
  - The use of ChannelBufferHolder is minimal now.
    - Before: inbound().byteBuffer()
    - After: inboundByteBuffer()
    - Simpler and better performance
    
- Bypass buffer types were removed because it just does not work at all
  with the thread model.
  - All handlers that uses a bypass buffer are broken.  Will fix soon.

- CombinedHandlerAdapter does not make sense anymore either because
  there are four handler interfaces to consider and often the two
  handlers will implement the same handler interface such as
  ChannelStateHandler.  Thinking of better ways to provide this feature
2012-06-07 14:52:33 +09:00
Trustin Lee
3def2e6598 Fix more checkstyle errors 2012-06-07 09:19:14 +09:00
norman
fd7767ccda Fix example 2012-06-06 07:52:46 +02:00
Trustin Lee
1eced1e9e3 Update license headers 2012-06-04 13:31:44 -07:00
Trustin Lee
3b2c25e8ed Rename (Server)Bootstrap.(child)initializer to (child)handler
- The handler you specify with initializer() is actually simply added
  to the pipeline and that's all.  It's ChannelInitializer which does
  additional work.  For example, a user can specify just a single
  handler with initializer() and it will still work.  This is especially
  common for Bootstrap, so I renamed initializer to handler, which makes
  more sense.
2012-06-03 01:00:16 -07:00
Norman Maurer
f34fc73e89 Some changes to the examples to show the usage of @Sharable 2012-06-02 20:13:58 +02:00
Trustin Lee
45f19d02ff Remove the codecs and handlers that can't make it on time for 4.0.0.A1
- Removed ones are: IP filer and HTTP multipart codec
  - Needs closer code review and polishing
  - Sorry. I'll add them back in the next alpha releases
  - SSL handler and ChunkedWriteHandler also need more work, but
    I really want to make them part of the first alpha because they
    are used pretty often by users.
2012-06-02 01:38:10 -07:00
Trustin Lee
141a05c831 Strict thread model / Allow assign an executor to a handler
- Add EventExecutor and make EventLoop extend it
- Add SingleThreadEventExecutor and MultithreadEventExecutor
- Add EventExecutor's default implementation
- Fixed an API design problem where there is no way to get non-bypass
  buffer of desired type
2012-06-01 17:51:19 -07:00
Trustin Lee
7ddc93bed8 Ported IdleStateHandler / Forward-ported the UptimeClient example
- Add ChannelHandlerContext.eventLoop() for convenience
- Bootstrap and ServerBootstrap handles channel initialization failure
  better
- More strict checks for missing @Sharable annotation
  - A handler without @Sharable annotation cannot be added more than
    once now.
2012-05-31 14:54:48 -07:00
Trustin Lee
0cd766df30 Move HTTP multipart classes to its own package / Clean-up
- Move CaseIgnoringComparable to netty-common
- Add HttpConstants
2012-05-31 11:32:42 -07:00
Trustin Lee
633fada6ec Take advantage of the new method in ChannelInboundStreamHandlerAdapter 2012-05-31 09:07:10 -07:00
Trustin Lee
3584da2dad Use ChannelInboundStreamHandlerAdapter in EchoClientHandler 2012-05-31 09:04:19 -07:00
Trustin Lee
2a63acef4d More convenient inbound stream handler / Smarter inbound buffer cleanup
- Added a new convenience method to ChannelInboundstreamHandlerAdapter 
- EchoServerHandler uses the new method
- DefaultChannelPipeline calls inboundByteBuffer.discardReadBytes()
  when it is sure there's no memory copy involved
2012-05-31 09:03:31 -07:00
Trustin Lee
9f9045c3b4 Add EventLoop implementation for the local transport 2012-05-30 04:33:43 -07:00
Trustin Lee
078a502c5f Add shutdown hooks to SingleThreadEventLoop
- LocalChannel and LocalServerChannel uses it to close themselves on
  shutdown
- LocalEcho example does not call close() anymore because the channels
  are closed automatically on shutdown
2012-05-30 04:23:15 -07:00
Trustin Lee
a53ecbf5f1 Implement the local transport
- Replace the old local example with localecho example
- Channel's outbound buffer is guaranteed to be created on construction
  time.
2012-05-30 03:58:14 -07:00
Trustin Lee
8237afff64 Ported most examples
- Renamed ChannelBootstrap to Bootstrap
- Renamed ServerChannelBootstrap to ServerBootstrap
- Moved bootstrap classes to io.netty.bootstrap as before
- Moved unfoldAndAdd() to a separate utility class
- Fixed a bug in unfoldAndAdd() where it did not handle ChannelBuffer
  correctly
2012-05-29 16:41:26 -07:00
Trustin Lee
026715e818 Refactor the pipeline API to support stacked codecs
- Previous API did not support the pipeline which contains multiple
  MessageToStreamEncoders because there was no way to find the closest
  outbound byte buffer.  Now you always get the correct buffer even if
  the handler that provides the buffer is placed distantly.
  For example:
  
    Channel -> MsgAEncoder -> MsgBEncoder -> MsgCEncoder
  
  Msg(A|B|C)Encoder will all have access to the channel's outbound
  byte buffer.  Previously, it was simply impossible.

- Improved ChannelBufferHolder.toString()
2012-05-29 12:09:29 -07:00
Trustin Lee
81e8c49931 Fix bugs in ZlibDecoder / Port the factorial example
- Fixed IndexOutOfBoundsException in ZlibDecoder
- Fixed a bug where ZlibDecoder raises an exception when a connection
  is closed
2012-05-29 00:06:00 -07:00
Trustin Lee
e48281471b Limit future notification stack depth / Robost writeCounter management
- Also ported the discard example while testing this commit
2012-05-28 05:05:49 -07:00
Trustin Lee
626c5ef9c9 Remove the classes that are not part of Netty 4.0.0.Alpha1
- Will add them back before Beta1
2012-05-27 19:39:10 -07:00
Trustin Lee
528b5c4328 Removed the modules that are not part of 4.0.0.Alpha1
- Will add them back before Beta1 is out
2012-05-27 19:28:28 -07:00
Trustin Lee
3b8de9f133 Add LoggingHandler to ServerSocketChannel's pipeline 2012-05-27 04:17:33 -07:00
Trustin Lee
a1bdf671f1 Simplified EventLoop implementation names
- Also
  - Fixed a test failure
  - Fixed compiler warnings related with ChannelInitializer type
    parameters
2012-05-25 15:51:22 -07:00
Trustin Lee
c7c923cab3 Ported the QOTM example to the new API
- Fixed bugs in the NIO datagram transports
  - DefaultNioDatagramChannelConfig did not initialize on Java 6
2012-05-24 09:32:14 -07:00
Trustin Lee
50b4894c36 Use ChannelInboundMessageHandlerAdapter 2012-05-23 09:49:03 -07:00
Trustin Lee
af37ec4f23 Ported the HTTP snoop example to the new API
- Replaced pipeline factories with initializers
- Ported essential parts related with HTTP to the new API
- Replaced ChannelHandlerAdapter.combine() with CombinedChannelHandler
- Fixed a bug where ReplayingDecoder does not notify the next handler
- Fixed a bug where ReplayingDecoder calls wrong callDecode() method
- Added a destination buffer as an argument to AbstractChannel.doRead()
  for easier implementation
- Fixed a bug where NioSocketChannel did not try to increase the inbound
  buffer size (moved the logic to AbstractChannel)
2012-05-20 14:19:11 +09:00
Trustin Lee
92a688e5b2 Retrofit the codec framework with the new API (in progress)
- Replaced FrameDecoder and OneToOne(Encoder|Decoder) with:
  - (Stream|Message)To(String|Message)(Encoder|Decoder)
- Moved the classes in 'codec.frame' up to 'codec'
- Fixed some bugs found while running unit tests
2012-05-16 23:02:06 +09:00
Trustin Lee
e16c835780 Simplify the echo client example 2012-05-15 14:16:27 +09:00
Trustin Lee
6eb540ca40 Add more convenient methods to ChannelPipeline
.. to simplify pipeline construction as shown in the echo example
2012-05-15 14:08:42 +09:00
Trustin Lee
d01d1d0843 Rename (Server)ChannelBuilder to (Server)ChannelBootstrap
- It does not build a new Channel but just helps bootstrapping it.
- Added shutdown() method for simpler deinitialization
- ServerChannelBootstrap has shorter method names for the parent channel
2012-05-15 13:45:25 +09:00
Trustin Lee
128851dd09 Bump up the backlog value 2012-05-15 13:18:46 +09:00
Trustin Lee
f00fadb9fd Simplify the construction of multi-threaded selector event loop
- Hide InternalLogger from users
2012-05-15 13:11:47 +09:00
Trustin Lee
311f17f6ef Replace Bootstrap with ChannelBuilder and ServerChannelBuilder
- Added ChannelInitializer which is supposed to be used with the
  builders
- Echo examples use ChannelBuilder and ServerChannelBuilder now
- Replace ChannelFuture.rethrowIfFailed() with sync*()
- Bug fixes
2012-05-14 23:57:23 +09:00
Trustin Lee
05f955ee10 Clean up echo example / Fix a bug where closeFuture is not notified 2012-05-14 14:17:40 +09:00
Trustin Lee
95f05ae215 Uncomment logging in EchoClient 2012-05-12 08:32:43 +09:00
Trustin Lee
efe7fd9539 Uncomment logging in EchoServer 2012-05-12 08:31:55 +09:00
Trustin Lee
c57d7dd098 Add EventLoopFactory and make MultithreadEventLoop use it
- based on the feed back from @normanmaurer
2012-05-11 21:47:07 +09:00
Trustin Lee
4b673c4ebb Fix infinite loop while handling a client socket / Retrofit EchoClient 2012-05-11 21:19:19 +09:00
Trustin Lee
cb718a07c8 Move ChannelFutureFactory.newVoidFuture() to Channel.Unsafe() / Cleanup 2012-05-11 00:57:42 +09:00