Commit Graph

89 Commits

Author SHA1 Message Date
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
468a3228a4 Fit every line into 120 columns 2012-06-08 19:28:12 +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
4a23c2a6eb Fix checkstyle errors 2012-06-07 22:01:59 +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
8701e24b9a Add back Channel(Inbound|Outbound)(Message|Stream)HandlerAdapter
- they are useful when creating an anonymous class
- Also added back CombinedChannelHandler with extra constraints
2012-06-07 17:49:45 +09:00
Trustin Lee
aab71ccd8a Remove Channel(Inbound|Outbound)HandlerAdapter which does nothing
- Thanks to the recent refactoring, Channel(Inbound|Outbound)Handler-
  Adapter ended up having empty body.  No need to keep.
2012-06-07 17:25:15 +09:00
Trustin Lee
ea0c9cfe79 Post-overhaul fixes / Split LoggingHandler into three
- LoggingHandler now only logs state and operations
- StreamLoggingHandler and MessageLoggingHandler log the buffer content
- Added ChannelOperationHandlerAdapter
  - Used by WriteTimeoutHandler
2012-06-07 16:56: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
b1a156d3f2 Fix a build failure due to a dependency problem / Fix checkstyle errors 2012-06-07 09:15:53 +09:00
Trustin Lee
a9cc75dd3e Port SSL echo test
- Remove britspaces
2012-06-06 23:18:37 +09:00
norman
a4b2d70264 Remove some more synchronization stuff which is not needed anymore 2012-06-06 08:24:44 +02:00
norman
a56ea06e58 Only parse packet length once per packet. See #382 2012-06-06 08:20:30 +02:00
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