Commit Graph

116 Commits

Author SHA1 Message Date
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
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
748de5ea83 Fix a compilation error 2012-06-08 10:02:44 +09:00
Trustin Lee
92cbe6f980 Support long Expires dates and commas in cookie values (#96)
- Contribution by @valodzka
2012-06-08 09:25:39 +09:00
Trustin Lee
4a23c2a6eb Fix checkstyle errors 2012-06-07 22:01:59 +09:00
Trustin Lee
10f7a31908 Fixed SpdySessionHandlerTest / Fixed NPE in EmbeddedChannel
- Some tests like SpdySessionHandlerTest accesses outbound buffer
  even before the outbound buffer is initialized by
  AbstractEmbeddedChannel's subclasses, leading to NPE at <init>.
  To fix this problem, subclasses now pass the outbound buffer as
  a constructor parameter to AbstractEmbeddedChannel.
2012-06-07 21:33:31 +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
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
3def2e6598 Fix more checkstyle errors 2012-06-07 09:19:14 +09:00
Frédéric Brégier
c2e3d305b4 Merge pull request #381 from fredericBregier/master
Improve HTTP message streaming in decoder same as #380
2012-06-05 10:05:34 -07:00
Frédéric Brégier
06e754eb81 Improve HTTP message streaming in decoder, in Master same as #380 submitted fix 2012-06-05 19:56:01 +03:00
Trustin Lee
1eced1e9e3 Update license headers 2012-06-04 13:31:44 -07:00
Trustin Lee
361cb417e0 Move SPDY echo tests to testsuite to use AbstractSocketTest
- Moved MIN_VERSION and MAX_VERSION to SpdyConstants to allow public
  access
- Removed the tests that are not necessary anymore.
2012-06-03 04:47:05 -07:00
Trustin Lee
f991a8c7d4 Fix a bug where DefaultChannelPipeline.write() doesn't find the buffer
- Also fixed failures in SpdySessionHandlerTest
2012-06-03 04:10:32 -07:00
Trustin Lee
3e0cbf0caa Fix HttpClientCodecTest.testFailsOnMissingResponse()
- AbstractCodecEmbedder does not throw an exception immediately anymore.
  It stores the caught exceptions in the product queue and throws them
  on pool() or peek().
2012-06-03 03:32:30 -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
Trustin Lee
cc4c98d7ba Fix #378 again
- @jroper's fix did not work, so I just fixed it again.
2012-06-02 23:05:20 -07:00
James Roper
e8a74c8ad0 Fixing #378, when path or domain are null in both this and that, equals and compareTo return false even when the cookies are equal. 2012-06-03 01:04:23 +03: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
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
77274ae743 Automated code clean-up 2012-05-31 12:03:01 -07:00
Trustin Lee
734d452be2 Apply missing changes in the branch '3' 2012-05-31 11:50:08 -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
197f31c90e Test all supported SPDY session management 2012-05-31 02:06:53 -07:00
Trustin Lee
a494f201fc Call setHandshakeComplete() before the handler replacement (#332)
- Contributed by @normanmaurer
2012-05-31 02:02:02 -07:00
Trustin Lee
7ac89ace4f Finished forward-porting SPDY codec 2012-05-31 01:53:58 -07:00
Trustin Lee
131eef2c51 Forward-porting SPDY codec 2012-05-31 00:37:27 -07:00
Trustin Lee
d7a198a60f Zap marshalling and spdy codec to forwardport again 2012-05-30 23:14:18 -07:00
Trustin Lee
743596aaea Fix a bug where first websocket frame is discarded (#332) 2012-05-30 19:18:08 -07:00
Trustin Lee
a5a76131e6 Fix checkstyle errors 2012-05-30 19:09:23 -07:00
vibul
4fc089829d Fixed bug where subprotocol not sent by client
Conflicts:

	codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java
	codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker08.java
	codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker13.java
	codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java
2012-05-30 19:07:44 -07:00
Frédéric Brégier
a73e6ea581 typo fix ! Sorry 2012-05-30 17:39:03 -07:00
Frédéric Brégier
a91e72403c Very small fix (readUnsigned while in optimized version it was signed but should be unsigned) 2012-05-30 17:37:41 -07:00
Trustin Lee
d6cedb008b Reduce the cost of throwing a SeekAheadNoBackArrayException 2012-05-30 17:37:12 -07:00
Frédéric Brégier
f799c9f215 Add Exception to the exception class name 2012-05-30 17:31:40 -07:00
Frédéric Brégier
b8ab8828c0 Add Exception to name of the Exception ;-) 2012-05-30 17:31:21 -07:00
Frédéric Brégier
ac39f39f36 Update codec-http/src/main/java/io/netty/handler/codec/http/HttpPostRequestDecoder.java 2012-05-30 17:31:03 -07:00
Frédéric Brégier
5d2bf43b59 Optimize Buffer access while decoding by going through backend array when possible (divide by almost 2 the time spent in decoding) 2012-05-30 17:30:47 -07:00
Frédéric Brégier
759d0633a4 Add the SeekAheadOptimize class to enable faster seek of bytes values in HttpPostRequestDecoder 2012-05-30 17:30:36 -07:00
Trustin Lee
e8bc276ddd Fix in addContent when switching from MemoryAttribute if it is done when
last buffer added, in order to not close immediately the underlying
file before adding the last buffer.

- Contribution by @fredericBregier
2012-05-30 17:28:51 -07:00
Trustin Lee
dba9a6d408 Close channel when needed / Call force() only when necessary
- Contribution by @fredericBregier
2012-05-30 17:26:41 -07:00
Trustin Lee
92f010d688 Use int instead of long for maxFramePayloadLength 2012-05-30 17:21:51 -07:00
Trustin Lee
67ee22e23a Add max frame length for web socket to limit chance of DOS attack (#283)
- Contributed by @veebs
2012-05-30 17:13:00 -07:00
Trustin Lee
ec43aa121f Case-insensitive matching for Upgrade and Connection header (#278) 2012-05-30 16:43:04 -07:00