Commit Graph

76 Commits

Author SHA1 Message Date
norman
f759d30538 Fix starttls support. Now SslHandler should be fully functional again 2012-06-06 08:06:12 +02:00
norman
2aea5291bd Port SslHandler to the new API. Everything except of starttls works 2012-06-06 07:52:28 +02:00
norman
35ba150db0 Fix BlockingReadHandler 2012-06-05 14:18:09 +02:00
norman
12069d3bf4 Eliminate most of the synchonization stuff in ChunkedWriteHandler as its not needed anymore with the new thread-model 2012-06-05 14:13:56 +02:00
Trustin Lee
1eced1e9e3 Update license headers 2012-06-04 13:31:44 -07:00
norman
1ed87601b8 Add a testcase to prove that we have no bug in ChunkedWriteHandler when notify futures 2012-06-04 15:14:44 +02:00
Trustin Lee
c6600b3bfd codec module is only used by tests
Thanks @normanmaurer
2012-06-03 02:25:16 -07: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
cc4f705029 Replace ChannelBuffer.toByteBuffer() with hasNioBuffer() and nioBuffer()
... just like we do with byte arrays.  toByteBuffer() and
toByteBuffers() had an indeterministic behavior and thus it could not
tell when the returned NIO buffer is shared or not.  nioBuffer() always
returns a view buffer of the Netty buffer.  The only case where
hasNioBuffer() returns false and nioBuffer() fails is the
CompositeChannelBuffer, which is not very commonly used and *slow*.
2012-06-02 01:30:55 -07:00
Trustin Lee
14e68aca57 Fix a Javadoc error 2012-06-01 23:18:46 -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
754cd99843 Port ChunkedWriteHandler 2012-06-01 00:36:12 -07:00
Trustin Lee
7be188f8c0 Ported BlockingReadHandler 2012-05-31 16:44:51 -07:00
Trustin Lee
9bb5b34887 Remove BufferedWriteHandler
- All writes in Netty 4 are buffered by default and a user can call
  flush() to flush it.
2012-05-31 15:55:11 -07:00
Trustin Lee
2aa466640e Ported Read/WriteTimeoutHandler with simplification
- The default behavior is now to close the channel on timeout.  A user
  can override this behavior, but I would just use IdleStateHandler or
  use eventLoop's timer facility directly for finer control.
2012-05-31 15:53:38 -07:00
Trustin Lee
5f24f176bb Port ReadTimeoutHandler 2012-05-31 15:04:25 -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
Norman Maurer
5852d82ad6 Only send event upstream once the Ssl handshake was completed successfull. See #358
Conflicts:

	handler/src/main/java/io/netty/handler/ssl/SslHandler.java
2012-05-30 19:25:29 -07:00
Norman Maurer
e2bdc2234d Cleanup 2012-05-30 19:21:21 -07:00
Norman Maurer
e2a7462d70 Fix syntax. See #342 2012-05-30 19:14:10 -07:00
Jeff Pinner
2f71c001b4 Make SslBufferPool an interface 2012-05-30 19:13:52 -07:00
norman
7007e2fbaf Make all methods of SslBufferPool public so a subclass can be placed in another package. See #336 2012-05-30 19:12:26 -07:00
norman
1226cdacfb Use the correct ChannelBufferFactory when creating new ChannelBuffers. See #335
Conflicts:

	handler/src/main/java/io/netty/handler/ssl/SslHandler.java
2012-05-30 19:12:11 -07:00
norman
ed357181c0 Make sure SslHandler also works if SslBufferPool use non heap ByteBuffers. See #329
Conflicts:

	handler/src/main/java/io/netty/handler/ssl/SslHandler.java
2012-05-30 19:11:23 -07:00
Trustin Lee
117626e034 Add ChunkedWriteHandlerTest from branch 3 2012-05-30 18:50:33 -07:00
Trustin Lee
57d3d0cbb5 Update ChunkedWriteHandler to the latest revision at branch 3 2012-05-30 18:47:55 -07:00
norman
7b434e225f Make sure we fire the event from the io-thread. See #306 2012-05-30 18:45:57 -07:00
norman
31e643b32d Refactor ChunkedWriteHandler to remove synchronization which can have bad side effects like deadlocks. See #297 and #301
Conflicts:

	handler/src/main/java/io/netty/handler/stream/ChunkedWriteHandler.java
2012-05-30 18:45:28 -07:00
norman
280c65a28e Refactor ChunkedWriteHandler to remove synchronization which can have bad side effects like deadlocks. See #297 and #301
Conflicts:

	handler/src/main/java/io/netty/handler/stream/ChunkedWriteHandler.java
2012-05-30 18:43:52 -07:00
norman
f8f703e679 Add @Override annotations 2012-05-30 18:41:43 -07:00
norman
c705379adb Notify ChannelFuture's of queued writes if the SslHandler gets remove d from the ChannelPipeline. See #306 2012-05-30 18:41:32 -07:00
norman
c0bb070876 Fail all queued writes if the ChunkedWriteHandler is removed from the ChannelPipeline. See #304 2012-05-30 18:41:13 -07:00
norman
d308fa8fe1 Fail all pending writes on channelClosed(..). See #305 2012-05-30 18:40:59 -07:00
Norman Maurer
d1e6328102 Allow to register ChannelFutureListener's that get notified once the inbound of the SSLEngine is closed. See #137 2012-05-30 18:40:43 -07:00
Trustin Lee
f428853b35 Remove IpV4Subnet.main()
- Should run as a test case
2012-05-30 15:41:39 -07:00
Trustin Lee
54047c69cf Remove IpSubnet.main()
- Should be run as a test case
2012-05-30 15:40:51 -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
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
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
894ececbb7 Convert DOS line ending to UNIX line ending 2012-05-15 17:14:02 +09:00
Trustin Lee
dd2e36e5d9 Remove unused or unmaintainable internal classes 2012-05-15 17:10:54 +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
7a5f4721b9 Optimize LoggingHandler using lookup tables 2012-05-12 08:31:13 +09:00
Trustin Lee
d02bc1c0d3 Log outbound buffer
- Use uppercase names for outbound events
2012-05-11 00:46:51 +09:00
Trustin Lee
d5b52077fe Remove hexdump option in LoggingHandler and dump always
- Allow a user override the log message instead
- Prettier hex dump
2012-05-11 00:39:44 +09:00
Trustin Lee
da9ecadfc0 Introduce bypass buffer and use it in LoggingHandler
- Added ChannelBufferHolders.(inbound|outbound)BypassBuffer()
  - The holder returned by these methods returns the next handler's
    buffer.  When a handler's new(Inbound|Outbound)Buffer returns
    a bypass holder, your inboundBufferUpdated() and flush()
    implementation should check if the buffer is a bypass and should not
    modify the content of the buffer.
- Channel(Inbound|Outbound)?HandlerAdapter is now abstract.
  - A user has to specify the exact inbound/outbound buffer type
  - It's because there's no way to determine the best buffer type
- Implemented LoggingHandler using the new API.
  - It doesn't dump received or sent messages yet.
- Fixed a bug where DefaultUnsafe.close() does not trigger deregister()
- Fixed a bug where NioSocketChannel.isActive() does not return false
  when closed
2012-05-10 23:19:59 +09:00
Trustin Lee
368156f5d0 Another round of the new API design
- Channel now creates a ChannelPipeline by itself

  I find no reason to allow a user to use one's own pipeline
  implementation since I saw nobody does except for the cases where a
  user wants to add a user attribute to a channel, which is now covered
  by AttributeMap.

- Removed ChannelEvent and its subtypes because they are replaced by
  direct method invocation.
- Replaced ChannelSink with Channel.unsafe()
- Various getter renaming (e.g. Channel.getId() -> Channel.id())
- Added ChannelHandlerInvoker interface
- Implemented AbstractChannel and AbstractServerChannel
- Some other changes I don't remember
2012-05-01 17:19:41 +09:00
Trustin Lee
fd0b0a4e2b Code cleanup 2012-03-30 12:48:28 +09:00
Trustin Lee
a81fa75c59 Fix #239: IdleStateHandler starts two timers
1) ReadTimeoutHandler is also affected by this bug - fixed
2) Reverted IdleStateHandler.beforeAdd() and channelConnected() -
without isAttached() check, timeout can be inaccurate if beforeAdd() is
called long before channelConnected().
2012-03-22 16:03:58 +09:00