Commit Graph

413 Commits

Author SHA1 Message Date
Norman Maurer
e8ea98017f Fix regression introduced by 0364265f46 which could lead to corrupt attribute values 2013-06-25 09:31:51 +02:00
Trustin Lee
e0805ecea9 SPDY: handle too large header blocks
- Forward-ported 22b8a96e044b77e5fadc5a1217080a1f9c69aa9c
2013-06-25 11:07:15 +09:00
Andrej Golovnin
c07b0cac70 Adds port to the host header value. Due to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23 the port should be added if it differs from the default port. To simplify the code we just always add the port. 2013-06-25 11:07:14 +09:00
Trustin Lee
a969613540 Merge ChannelInboundConsumingHandler into SimpleChannelInboundHandler
- SimpleChannelInboundHandler now has a constructor parameter to let a
  user decide to enable automatic message release. (the default is to
  enable), which makes ChannelInboundConsumingHandler of less value.
2013-06-25 11:07:14 +09:00
Trustin Lee
dc6e2cd625 Make AbstractMemoryHttpData generate less garbage 2013-06-25 11:07:13 +09:00
Norman Maurer
6a9f965f9b Introduce new utility class calles ReferenceCountUtil and move utility methods from ByteBufUtil to it.
The ones in ByteBufUtil were marked as @deprecated
2013-06-14 07:07:33 +02:00
Trustin Lee
01d9f10af6 Remove the volatile modifiers where they are unnecessary 2013-06-13 14:43:39 +09:00
Trustin Lee
175526b6bd Move ReferenceCounted and AbstractReferenceCounted to io.netty.util
- Fixes #1441
- Also move and rename IllegalBufferAccessException to ReferenceCountException
- Prettier reference count exception messages
2013-06-13 13:14:21 +09:00
Trustin Lee
96380e756c Fix test failures introduced by 78d8f05c21 2013-06-13 11:51:03 +09:00
Norman Maurer
a403da3042 Rewrite HTTP encoder to use gathering writes 2013-06-13 11:02:31 +09:00
Trustin Lee
78d8f05c21 Make sure that HttpObjectDecoder decodes the last HTTP message without 'Content-Length' header
- Fixes #1410
- Revert 1e5f266a3c and provide a proper fix with a test
2013-06-13 10:57:06 +09:00
Norman Maurer
1e5f266a3c [#1410] Make sure we generate a Http response if the server writes back 200 response with empty body and and close the connection 2013-06-12 09:56:00 +02:00
Norman Maurer
e3ec124ccd Make sure WebSocketFrameAggregator and HttpObjectAggregator don't leak ByteBufs 2013-06-11 08:53:14 +02:00
Norman Maurer
92bd4d2fe0 Remove MessageList.remove(*) , MessageList.set(*) and MessageList.add(i,*) 2013-06-10 13:44:01 +02:00
Norman Maurer
e71a521284 [#1414] Use gathering writes in AbstractMemoryHttpData if the buffer is backed by multiple ByteBuffers
* This fix the bug which caused an UnsupportedOperationException when renameTo(...) was called and the underlying ByteBuf was backed by multiple ByteBuffers
2013-06-10 09:25:03 +02:00
Trustin Lee
14158070bf Revamp the core API to reduce memory footprint and consumption
The API changes made so far turned out to increase the memory footprint
and consumption while our intention was actually decreasing them.

Memory consumption issue:

When there are many connections which does not exchange data frequently,
the old Netty 4 API spent a lot more memory than 3 because it always
allocates per-handler buffer for each connection unless otherwise
explicitly stated by a user.  In a usual real world load, a client
doesn't always send requests without pausing, so the idea of having a
buffer whose life cycle if bound to the life cycle of a connection
didn't work as expected.

Memory footprint issue:

The old Netty 4 API decreased overall memory footprint by a great deal
in many cases.  It was mainly because the old Netty 4 API did not
allocate a new buffer and event object for each read.  Instead, it
created a new buffer for each handler in a pipeline.  This works pretty
well as long as the number of handlers in a pipeline is only a few.
However, for a highly modular application with many handlers which
handles connections which lasts for relatively short period, it actually
makes the memory footprint issue much worse.

Changes:

All in all, this is about retaining all the good changes we made in 4 so
far such as better thread model and going back to the way how we dealt
with message events in 3.

To fix the memory consumption/footprint issue mentioned above, we made a
hard decision to break the backward compatibility again with the
following changes:

- Remove MessageBuf
- Merge Buf into ByteBuf
- Merge ChannelInboundByte/MessageHandler and ChannelStateHandler into ChannelInboundHandler
  - Similar changes were made to the adapter classes
- Merge ChannelOutboundByte/MessageHandler and ChannelOperationHandler into ChannelOutboundHandler
  - Similar changes were made to the adapter classes
- Introduce MessageList which is similar to `MessageEvent` in Netty 3
- Replace inboundBufferUpdated(ctx) with messageReceived(ctx, MessageList)
- Replace flush(ctx, promise) with write(ctx, MessageList, promise)
- Remove ByteToByteEncoder/Decoder/Codec
  - Replaced by MessageToByteEncoder<ByteBuf>, ByteToMessageDecoder<ByteBuf>, and ByteMessageCodec<ByteBuf>
- Merge EmbeddedByteChannel and EmbeddedMessageChannel into EmbeddedChannel
- Add SimpleChannelInboundHandler which is sometimes more useful than
  ChannelInboundHandlerAdapter
- Bring back Channel.isWritable() from Netty 3
- Add ChannelInboundHandler.channelWritabilityChanges() event
- Add RecvByteBufAllocator configuration property
  - Similar to ReceiveBufferSizePredictor in Netty 3
  - Some existing configuration properties such as
    DatagramChannelConfig.receivePacketSize is gone now.
- Remove suspend/resumeIntermediaryDeallocation() in ByteBuf

This change would have been impossible without @normanmaurer's help. He
fixed, ported, and improved many parts of the changes.
2013-06-10 16:10:39 +09:00
Norman Maurer
aa96b4b286 No need to create temporary arrays 2013-05-24 19:58:55 +02:00
Norman Maurer
0e8fb21554 Some optimizations to the http codec 2013-05-24 09:07:17 +02:00
Norman Maurer
83dcf829d6 [#1384] Cache HttpHeaderDateFormat in ThreadLocal 2013-05-23 11:39:50 +02:00
shreyharia
1801ecfe30 Update HttpHeaderDateFormat.java
Output for "E, dd-MMM-y HH:mm:ss z"
on java 1.6 I get: Wed, 22-May-13 09:11:41 GM
on java 1.7 I get: Wed, 22-May-2013 09:11:14 GMT

To be uniform on both jdks.. modified it to
"E, dd-MMM-yy HH:mm:ss z"

learnt from - http://stackoverflow.com/questions/16687298/simpledateformat-different-behaviour-depending-on-java-version
2013-05-22 13:36:03 +02:00
Norman Maurer
bd2230961d Fix checkstyle 2013-05-17 22:09:11 +02:00
Norman Maurer
aaca9df99a @Deprecate a method as it's not needed anymore 2013-05-17 22:00:55 +02:00
Norman Maurer
8a5e249d6f [#1374] Allow users to all all subprotocols by using * as wildcard 2013-05-17 21:57:47 +02:00
Norman Maurer
a331c87a7a [#1358] Fix Encoding of multipart attribute names and filenames for non ASCII chars 2013-05-14 15:24:01 +02:00
Norman Maurer
3268d6fc2e [#1352] WebSocketFrameAggregator should only throw TooLongFrameException once per complete frame 2013-05-09 21:12:36 +02:00
Norman Maurer
c8de4f03f1 [#1007] Make sure the current message is only reset on LastHttpContent 2013-05-09 20:11:34 +02:00
Norman Maurer
268b059ebb [#1007] HttpObjectAggregator should only throw one TooLongFrameException per full HTTP message 2013-05-09 19:44:39 +02:00
Norman Maurer
b65c8716a5 Correctly handle multipart disposition 2013-05-08 17:20:44 +02:00
Frederic Bregier
6c0b2be412 Same fix for Netty V4 for issue #1313
Remove encodeAttribute/decodeAttribute for Multipart element
Replace where necessary by cleanString (to remove '"') on name part (not
on value part)
2013-05-08 15:18:30 +02:00
Norman Maurer
c07234ed72 [#1346] Make sure HttpPostRequestEncoder.nextChunk() return LastHttpContent once all chunks are read 2013-05-08 15:11:08 +02:00
Norman Maurer
97bdabad9c [#1293] Fix IllegalBufferAccessException in HttpPostRequestDecoder
* Also let HttpPostRequestDecoder extends Iterator and let its Exceptiosn extend DecoderException
2013-05-06 21:36:30 +02:00
Norman Maurer
a170f05b4b [#1293] Fix handling of chunked requests in HttpPostRequestEncoder and the multipart examples 2013-05-06 15:00:18 +02:00
Frederic Bregier
c230afaed1 Fix for #1313 and #1332
Add TEXTPLAIN in HttpHeaders
Remove all coding/decoding Attribute using URL scheme for name and
attribute
Add text/plain to contant-type
2013-05-05 21:36:38 +02:00
Trustin Lee
1e0c83db23 Introduce AddressedEnvelope message type for generic representation of an addressed message
- Fixes #1282 (not perfectly, but to the extent it's possible with the current API)
- Add AddressedEnvelope and DefaultAddressedEnvelope
- Make DatagramPacket extend DefaultAddressedEnvelope<ByteBuf, InetSocketAddress>
- Rename ByteBufHolder.data() to content() so that a message can implement both AddressedEnvelope and ByteBufHolder (DatagramPacket does) without introducing two getter methods for the content
- Datagram channel implementations now understand ByteBuf and ByteBufHolder as a message with unspecified remote address.
2013-05-01 17:04:43 +09:00
Norman Maurer
ee433ea911 Fix checkstyle 2013-04-30 20:55:50 +02:00
Norman Maurer
57a8a9fd98 [#1321] HttpHeaders.removeTransferEncodingChunked(..) must handle the value in case insensitive manner 2013-04-30 20:41:20 +02:00
Trustin Lee
d92bcff1b6 Fix a bug where HttpContentEncoder generates an empty chunk even if it's not the last chunk
- Fixes #1312
- Added more test cases to ensure the fix
2013-04-27 15:38:28 +09:00
Trustin Lee
7884574c7b Remove freeInboundBuffer() and freeOutboundBuffer() which has no value
- Fixes #1308

freeInboundBuffer() and freeOutboundBuffer() were introduced in the early days of the new API when we did not have reference counting mechanism in the buffer. A user did not want Netty to free the handler buffers had to override these methods.

However, now that we have reference counting mechanism built into the buffer, a user who wants to retain the buffers beyond handler's life cycle can simply return the buffer whose reference count is greater than 1 in newInbound/OutboundBuffer().
2013-04-25 09:15:55 +09:00
Trustin Lee
b5989e2449 Reduce exception instantiation overhead in SslHandler / Reduce unnecessary empty array creation
- Added EmptyArrays as an internal utility class
2013-04-24 09:32:53 +09:00
Trustin Lee
94aad58627 Fix incorrect name validation in AbstractHttpData
- Fixes #1228
2013-04-23 19:26:50 +09:00
Trustin Lee
9fe5048175 No need to make CaseIgnoringComparator public
.. because it's unsed only internally
2013-04-23 18:40:49 +09:00
Norman Maurer
9c4bfa44d9 [#1294] Make sure ByteBuf is released once written to channel 2013-04-22 11:04:56 +02:00
Norman Maurer
c987dd556e [#1295] Make sure retain(..) returns the correct WebSocketFrame type 2013-04-21 13:00:50 +02:00
Norman Maurer
ca5554dfe7 [#1236] Fix problem where adding a new ChannelHandler could block the eventloop
This change also introduce a few other changes which was needed:
 * ChannelHandler.beforeAdd(...) and ChannelHandler.beforeRemove(...) were removed
 * ChannelHandler.afterAdd(...) -> handlerAdded(...)
 * ChannelHandler.afterRemoved(...) -> handlerRemoved(...)
 * SslHandler.handshake() -> SslHandler.hanshakeFuture() as the handshake is triggered automatically after
   the Channel becomes active
2013-04-19 07:00:50 +02:00
Trustin Lee
70eee55a48 Revamp HttpContentEncoder
- Use state machine to simplify the code
- Always produce a chunked response for simplicity
- Change the signature of beginEncode() - HttpContent was simply unnecessary.
- Add more test cases
- Fixes #1280
2013-04-17 12:51:22 +09:00
Trustin Lee
4b1df148a6 Fix a bug where HttpContentEncoder does not update 'Content-Length' and 'Transfer-Encoding' correctly
- Add 'Content-Length' and remove 'Transfer-Encoding' in case of FullHttpMessage
- Remove 'Content-Length' and add 'Transfer-Encoding: chunked' in case of non-full HttpMessage
- Fixes #1275
2013-04-16 11:49:47 +09:00
Norman Maurer
d8387fa4c3 [#858] Merge ChannelPipeline.replaceAndForward into replace and removeAndForward into remove 2013-04-13 18:19:33 +02:00
Trustin Lee
b58e6787ee Fix typo 2013-04-10 10:41:23 +09:00
irelandKen
9308625b2c Update FullHttpMessage.java
I think FullHttpMessage = HttpMessage + LastHttpContent,
not that FullHttpMessage = FullHttpMessage + LastHttpContent
2013-04-08 21:12:19 +02:00
Norman Maurer
af4b71a00e Remove special handling of Object[] in codec framework (a.k.a unfolding)
- Fixes #1229
- Primarily written by @normanmaurer and revised by @trustin

This commit removes the notion of unfolding from the codec framework
completely.  Unfolding was introduced in Netty 3.x to work around the
shortcoming of the codec framework where encode() and decode() did not
allow generating multiple messages.

Such a shortcoming can be fixed by changing the signature of encode()
and decode() instead of introducing an obscure workaround like
unfolding.  Therefore, we changed the signature of them in 4.0.

The change is simple, but backward-incompatible.  encode() and decode()
do not return anything.  Instead, the codec framework will pass a
MessageBuf<Object> so encode() and decode() can add the generated
messages into the MessageBuf.
2013-04-03 21:44:54 +09:00
Trustin Lee
f95dbb7a4d Make HttpPostRequestDecoder.addHttpData() and getFileUpload() protected
.. so that a user can extend it to get notified when changes are made
2013-04-02 16:07:31 +09:00
Norman Maurer
d9ac6638f4 [#1221] Make sure HttpObjectAggregator 100-Continue buffer is not released 2013-04-02 07:38:46 +02:00
Norman Maurer
a97cca50df [#1212] Fire handshake status events to notify the user about handshake states 2013-03-28 06:57:04 +01:00
Norman Maurer
4a9ab4f57c Add WebSocketFrameAggregator which takes care to aggregate fragmented websocket frames 2013-03-27 07:46:11 +01:00
Norman Maurer
20d76610da [#1204] Correctly detect lastChunk in HttpPostRequestDecoder 2013-03-25 08:32:52 +01:00
Norman Maurer
f76e38592d [#1201] Correctly handle mix of not compressed and compressed requests 2013-03-25 08:13:12 +01:00
Norman Maurer
4bd9c0195f Add a handler that makes writing websocket clients much easier 2013-03-22 12:11:35 +01:00
ursa
ecaba68348 Fix bug in memory-based HTTP data content initialization with input stream, add test (port from branch 3).
- Fixes #1170
2013-03-18 13:05:40 +09:00
Norman Maurer
d9c3f4bc05 [#1159] Make sure we not produce an empty bytebuf on decodeLast(..) 2013-03-14 12:45:24 +01:00
Trustin Lee
c660002b4e Add DecoderResult.UNFINISHED to represent the case where a decoder generated a message that was not decoded completely / Remove partial failure in DecoderResult which is not very useful but confusing 2013-03-12 13:04:53 +09:00
Norman Maurer
acde9a3f8e Fix a NoSuchElementException when WebSocketClientHandshaker is used with HttpRequestEncoder. This time for real 2013-03-11 14:39:41 +01:00
Norman Maurer
978cf0d98a Fix a NoSuchElementException when WebSocketClientHandshaker is used with HttpRequestEncoder 2013-03-11 13:54:03 +01:00
Norman Maurer
6ac9b17ddd Make WebSocket codec also work when HttpClientCodec and HttpServerCodec is used.
Also refactor the handshakers to share more code and make it easier to implement a new one and less error-prone
2013-03-08 08:46:47 +09:00
Trustin Lee
a8a7c4f576 Provide a way to implement an ChannelInbound/OutboundMessageHandler conveniently without extending an adapter class
- Add ChannelHandlerUtil and move the core logic of ChannelInbound/OutboundMessageHandler to ChannelHandlerUtil
- Add ChannelHandlerUtil.SingleInbound/OutboundMessageHandler and make ChannelInbound/OutboundMessageHandlerAdapter implement them.  This is a backward incompatible change because it forces all handler methods to be public (was protected previously)
- Fixes: #1119
2013-03-05 17:27:53 +09:00
Norman Maurer
b6038534cc [#1101] Fix NPE which accour when send a 100-continue response and using the HttpContentEncoder 2013-02-28 07:13:21 +01:00
Norman Maurer
977b6f3a28 [#1101] Fix NPE which accour when send a 100-continue response and using the HttpContentDecoder 2013-02-28 07:06:39 +01:00
Trustin Lee
671f9d48d4 Use ConcurrentHashMapV8 wherever possible
- Fixes #1052
2013-02-26 15:54:51 -08:00
Trustin Lee
f67441354a Move logging classes from internal to internal.logging
.. because internal is crowded
2013-02-26 14:54:25 -08:00
Norman Maurer
a03bd5105a [##1064] Fix problem where the LastHttpContent was changed to HttpContent and so the end was never detected 2013-02-26 07:47:30 +01:00
Norman Maurer
30e7ab2f7d [#1089] Correctly offer FullHttpContent if it is used to construct HttpPostRequestDecoder 2013-02-26 07:33:04 +01:00
Trustin Lee
9e67cce932 Use BufUtil.retain() where possible 2013-02-21 13:58:13 -08:00
Norman Maurer
43ff36cef0 Cleanup 2013-02-21 19:31:05 +01:00
Norman Maurer
00310d96af [#1067] Fix bug which can cause IllegalBufferAccessException when using aggregator and deflater the same time 2013-02-21 06:48:53 +01:00
Trustin Lee
1011227b88 Remove apiviz tags - we are focusing on user guide instead and putting diagrams there 2013-02-14 12:09:16 -08:00
Norman Maurer
54435a908f Make internal class final and package private 2013-02-14 09:36:27 +01:00
Norman Maurer
5370573400 Change ReferenceCounted.retain* to return itself and so allow method chaining 2013-02-14 07:39:44 +01:00
Norman Maurer
fcba55329c [#1046] Make sure HttpContentEncoder calls ByteBuf.retain() if needed 2013-02-12 20:32:27 +01:00
Trustin Lee
b4f4b95739 Move io.netty.logging to io.netty.internal / Move Signal out of internal because we use it in Channel*MessageAdapters 2013-02-11 20:08:18 +09:00
Trustin Lee
a91c6596c4 Add TODO 2013-02-11 19:43:53 +09:00
Trustin Lee
a2e5cd94be Prettify APIviz / Tighten visibility / Move subclasses to top level / Remove unused UnknownSocksMessage 2013-02-11 19:42:23 +09:00
Norman Maurer
0e47fb50e2 Tighten up visibility 2013-02-11 07:26:10 +01:00
Trustin Lee
2f1a0b0593 Remove freeInbound/OutboundMessage(), replaced by ReferenceCounted.retain/release()
- Related: #1029
2013-02-10 13:31:31 +09:00
Trustin Lee
b9996908b1 Implement reference counting
- Related: #1029
- Replace Freeable with ReferenceCounted
- Add AbstractReferenceCounted
- Add AbstractReferenceCountedByteBuf
- Add AbstractDerivedByteBuf
- Add EmptyByteBuf
2013-02-10 13:10:09 +09:00
Trustin Lee
27190fcb7f Fix a bug where HttpContentDecoder emits duplicate HttpMessage or raises NPE 2013-02-10 01:35:01 +09:00
Trustin Lee
2ac7983471 Do not trigger inboundBufferUpdated unnecessarily / Fix a bug in WebSocketServerProtocolHandlerTest / Fix a bug in forbiddenHttpRequestResponder() 2013-02-09 20:32:49 +09:00
Norman Maurer
42b21222dc [#1025] Allow to add extra headers to the websocket handshake response 2013-02-08 19:54:05 +01:00
Trustin Lee
82c46180c9 Tighten access modifier of encode/decode() 2013-02-08 17:37:16 +09:00
Trustin Lee
76eb40a4d2 Make ChannelOutboundMessageHandlerAdapter similar to ChannelInboundMessageHandlerAdapter 2013-02-08 17:07:01 +09:00
Trustin Lee
1640b1fea6 Automatically detect the message types in MessageToMessageCodec 2013-02-08 16:12:32 +09:00
Trustin Lee
fa1b49de98 More robust automatic messageType detection for ChannelInboundMessageHandlerAdapter and MessageToMessageDecoder 2013-02-08 15:45:17 +09:00
Trustin Lee
e5616c85c4 Automatic messageType detection for ChannelInboundMessageHandlerAdapter 2013-02-08 13:48:47 +09:00
Trustin Lee
d4742bbe16 Clean up abstract ChannelHandler impls / Remove ChannelHandlerContext.hasNext*()
- Rename ChannelHandlerAdapter to ChannelDuplexHandler
- Add ChannelHandlerAdapter that implements only ChannelHandler
- Rename CombinedChannelHandler to CombinedChannelDuplexHandler and
  improve runtime validation
- Remove ChannelInbound/OutboundHandlerAdapter which are not useful
- Make ChannelOutboundByteHandlerAdapter similar to
  ChannelInboundByteHandlerAdapter
- Make the tail and head handler of DefaultChannelPipeline accept both
  bytes and messages.  ChannelHandlerContext.hasNext*() were removed
  because they always return true now.
- Removed various unnecessary null checks.
- Correct method/field names:
  inboundBufferSuspended -> channelReadSuspended
2013-02-07 23:47:45 +09:00
Norman Maurer
582c6be456 [#1023] WebSocketClientHandshaker00 now also work with non heap buffers 2013-02-07 14:21:11 +01:00
ursa
992d431a95 Fix line-end detection for binary streams upload.
- Related: #1016
2013-02-06 11:54:05 +09:00
Trustin Lee
2ec932798f Replace .readable() and .writable() to .isReadable() and .isWritable() 2013-01-31 18:24:33 +01:00
Trustin Lee
42c65cca3a Make MessageBuf bounded
- Move common methods from ByteBuf to Buf
- Rename ensureWritableBytes() to ensureWritable()
- Rename readable() to isReadable()
- Rename writable() to isWritable()
- Add isReadable(int) and isWritable(int)
- Add AbstractMessageBuf
- Rewrite DefaultMessageBuf and QueueBackedMessageBuf
  - based on Josh Bloch's public domain ArrayDeque impl
2013-01-31 18:11:06 +01:00
Courtney Robinson
2d9cc9f63b Allow to specify the mode the encoder uses for form params. This allows it to be used with OAUTH
The OAuth 1 spec has small deviations from UrlEncoder.encode's output.

+ Percent encodes the parameters
+ Added tests to verify
+ See relevant OAuth section
http://oauth.net/core/1.0/#encoding_parameters
+ Detailed explanation http://hueniverse.com/oauth/guide/authentication/
2013-01-31 07:49:34 +01:00
Norman Maurer
97ea338bce [#971] Fix a bug where the HttpContentCompressor was try to start compressing on an empty response 2013-01-30 20:58:07 +01:00
Norman Maurer
cff2edf75d Remove not used enum 2013-01-30 19:02:29 +01:00
Norman Maurer
238e03f75b Add setters and getters back to Http Objects
* This is done because we noticed that the previous change limit the usage more then it gave us any benefit. Now it is possible
  again to rewrite the url on the fly or reuse the objects when writing a proxy and so limit the GC pressure.
* Fixes also #979
2013-01-30 07:42:18 +01:00
Trustin Lee
c5ccaee506 Fix a bug in HttpPostRequestDecoder where character encoding is ignored when reading a line
- Fixed #992 (backported from 3)
  - 9650cda163
  - b38bde2d2b
2013-01-29 15:59:15 +09:00
Norman Maurer
d7bfd44e10 [#982] [#977] [#858] Allow to transfer the content a ChannelHandlers inbound/outbound buffer on removal/replacement
This changes the behavior of the ChannelPipeline.remove(..) and ChannelPipeline.replace(..) methods in that way
that after invocation it is not possible anymore to access any data in the inbound or outbound buffer. This is
because it empty it now to prevent side-effects. If a user want to preserve the content and forward it to the
next handler in the pipeline it is adviced to use one of the new methods which where introduced.

 - ChannelPipeline.removeAndForward(..)
 - ChannelPipeline.replaceAndForward(..)
2013-01-28 10:25:38 +01:00
Norman Maurer
29bed32a89 [#963] Fix invalid free-up of messages if they are only passed-throught in HttpContentEncoder and HttpContentDecoder 2013-01-21 10:41:23 +01:00
Norman Maurer
c1e827fd72 [#942] Add an option to disable decoding of chunked transfer encoding in HttpObjectDecoder 2013-01-20 10:40:54 +01:00
Trustin Lee
b60e0b6a51 Modernize InternalLogger API and enable logging framework autodetection
- Borrow SLF4J API which is the best of the best
- InternalLoggerFactory now automatically detects the logging framework
  using static class loading. It tries SLF4J, Log4J, and then falls back
  to java.util.logging.
- Remove OsgiLogger because it is very likely that OSGi container
  already provides a bridge for existing logging frameworks
- Remove JBossLogger because the latest JBossLogger implementation seems
  to implement SLF4J binding
- Upgrade SLF4J to 1.7.2
- Remove tests for the untestable logging frameworks
- Remove TestAny
2013-01-19 20:50:52 +09:00
Norman Maurer
e8636050ca [#864] Switch to single decoding mode on the protocol upgrade to prevent races 2013-01-18 09:56:17 +01:00
Trustin Lee
cfa300f431 Fix APIviz panic 2013-01-18 14:12:35 +09:00
Norman Maurer
8a9e602a66 Prevent possible ClassCastException 2013-01-17 09:37:17 +01:00
Trustin Lee
4472fe9795 Remove 'get' prefix 2013-01-17 15:06:46 +09:00
Trustin Lee
eacc474cda Remove 'get' prefix 2013-01-17 14:48:03 +09:00
Norman Maurer
dfbecb796c [#910] Make use of ByteBufHolder in SPDY, HTTP multipart and WebSockets to allow for buffer pooling 2013-01-17 06:34:52 +01:00
Trustin Lee
e95d3de1ff Fix a bug where HttpContents are freed too early 2013-01-17 00:50:43 +09:00
Trustin Lee
3b79008eda Change the WebSocket API to use HttpHeaders instead of Map<String, String> for custom headers / Cleanup 2013-01-17 00:33:40 +09:00
Trustin Lee
540bc99549 Take advantage of invocation chaining in HttpHeaders 2013-01-16 23:56:51 +09:00
Trustin Lee
34820511ff Second HTTP overhaul
- Rename message types for clarity
  - HttpMessage -> FullHttpMessage
  - HttpHeader -> HttpMessage
  - HttpRequest -> FullHttpRequest
  - HttpResponse -> FulllHttpResponse
  - HttpRequestHeader -> HttpRequest
  - HttpResponseHeader -> HttpResponse
- HttpContent now extends ByteBufHolder; no more content() method
- Make HttpHeaders abstract, make its header access methods public, and
  add DefaultHttpHeaders
- Header accessor methods in HttpMessage and LastHttpContent are
  replaced with HttpMessage.headers() and
  LastHttpContent.trailingHeaders(). Both methods return HttpHeaders.
- Remove setters wherever possible and remove 'get' prefix
- Instead of calling setContent(), a user can either specify the content
  when constructing a message or write content into the buffer.
  (e.g. m.content().writeBytes(...))
- Overall cleanup & fixes
2013-01-16 23:46:02 +09:00
Norman Maurer
b7de868003 [#677] Overhaul HTTP codec
This commit tries to simplify the handling of Http easier and more consistent. This has a effect of many channges. Including:
 - HttpMessage was renamed to HttpHeader and the setContent and getContent methods were removed
 - HttpChunk was renamed to HttpContent
 - HttpChunkTrailer was renamed to LastHttpContent
 - HttpCodecUtil was merged into HttpHeaders

Now a "complete" Http message (request or response) contains of the following parts:
 - HttpHeader (HttpRequestHeader or HttpResponseHeader)
 - 0 - n HttpContent objects which contains parts of the content of the message
 - 1 LastHttpContent which marks the end of the message and contains the remaining data of the content

I also changed the sematic of HttpResponse and HttpRequest, these now represent a "complete" message which contains the HttpHeader and the HttpLastContent, and so can be used to eeasily send requests. The HttpMessageAggregator was renamed to HttpObjectAggregator and produce HttpResponse / HttpRequest message.
2013-01-15 17:51:12 +01:00
Norman Maurer
ec5ad7b22c [#921] Fix NPE which can be thrown on bad-timing when using WebSocketClientHandshaker07 2013-01-10 12:40:27 +01:00
Norman Maurer
b742dcc209 [#902] Remove usage of generics for output of Encoder/Decoder to make them more flexible again 2013-01-09 07:13:31 +01:00
Trustin Lee
218afba1f2 Do not set 'Content-Encoding' if the target encoding is 'identity'
- Fixes #769
2013-01-01 15:13:35 +09:00
Norman Maurer
4e77bacdf7 [#873] [#868] Split ChannelFuture into ChannelFuture and ChannelPromise 2012-12-31 23:27:16 +09:00
Norman Maurer
852f546b5b [#846] Tighten up visibility 2012-12-25 18:54:55 +01:00
Norman Maurer
5bd3648b3d [#845] Enable PUT of files above 2GB 2012-12-24 21:52:04 +01:00
Norman Maurer
2ea45950f1 Javadoc fixes 2012-12-23 23:03:54 +01:00
Veebs
92f1a81f47 #751 - Added support for legacy websocket v7 in order to pass SocksJS tests 2012-12-19 12:35:56 +01:00
Trustin Lee
78ccfeedf9 Save memory copy 2012-12-19 18:36:31 +09:00
Trustin Lee
937c0481e0 Do not use slice() to get the content of HTTP msg
- Fixes #794
2012-12-19 18:28:55 +09:00
Trustin Lee
eb23c9d27c Add missing 'operation(args, future)' for 'operation(args)'
- Fixes #818
- Fix inspector warnings
2012-12-14 19:42:58 +09:00
Trustin Lee
5a4a59406b Merge ByteBuf.hasNioBuffer() and hasNioBuffers()
- Fixes #797
2012-12-14 12:20:33 +09:00
Veebs
0c5fd38eb6 #722 - Make WebSocketClientHandshakerFactory a static utility class 2012-12-13 07:34:05 +01:00
Veebs
2704efc056 Added documentation to websocket classes. 2012-12-13 07:13:46 +01:00
Norman Maurer
312810d415 [#795] Fix WebSocketClientHandshaker13 and WebSocketClientHandshaker08 finishHandshake() method. 2012-12-07 20:14:11 +01:00
Trustin Lee
33c0c89fef Remove unnecessary empty lines 2012-12-03 19:58:13 +09:00
Norman Maurer
717bde05e2 [786] Fix possible corruption of first WebSocketFrame caused by WebSocketServerHandshaker* 2012-12-02 19:55:45 +01:00
Mike Heath
ff14feeb54 The handshake handler should not handle the exception and simply close the socket. The exception should be propagated to the WebSocketServerProtocolHandler to send the appropriate response and then close the socket. 2012-11-20 10:00:28 +01:00
Norman Maurer
d28eca7138 [#740] Fix WebSocketClientHandshaker00.finishHandshake() validations 2012-11-15 13:06:48 +01:00
Norman Maurer
46d713970b [#737] WebSocketClientHandshaker00 should set Content-Length header do workaround problem with proxy 2012-11-14 10:08:44 +01:00
Norman Maurer
3b729848dc [#735] Improve the notification of the handshake future 2012-11-13 20:05:54 +01:00
Norman Maurer
efaa5c2ff5 [#735] Make sure the handshake ChannelFuture is notified after the right encoder is present in the ChannelPipeline 2012-11-13 09:26:32 +01:00
Norman Maurer
2d5028bfd6 [#729] Correctly handle urls with empty abs_path in it when issue the websocket handshake 2012-11-12 15:29:02 +01:00
Trustin Lee
a05064d3eb Fix more inspection warnings + compilation errors 2012-11-12 13:25:00 +09:00
Trustin Lee
36c8eb02e8 Fix parameter namings + some more 2012-11-12 12:59:37 +09:00
Trustin Lee
aedf8790c3 Fix various Javadoc issues / Do not use argN parameter names 2012-11-12 12:26:19 +09:00
Trustin Lee
ea4a0e3535 Prefer {@code ...} to <code>...</code> / Fix deprecation warnings 2012-11-12 11:51:23 +09:00
Trustin Lee
15642f2cd8 Do not call static methods via instances 2012-11-12 11:23:06 +09:00
Trustin Lee
9746bb2036 Make a member field final wherever possible 2012-11-12 09:43:55 +09:00
Trustin Lee
4dce19b814 Replace a variable with a constant wherever possible 2012-11-12 09:43:14 +09:00
Trustin Lee
aa7cd691df Remove redundant 'else' branches. 2012-11-12 09:31:40 +09:00
Trustin Lee
91a61d7f43 Remove unnecessary qualifiers 2012-11-12 09:11:48 +09:00
Trustin Lee
61d872d6e2 Suppress false-positive inspection warnings / 2012-11-12 09:05:16 +09:00
Trustin Lee
a07fb94fe7 Prefer "str".equals(var) to var.equals("str") / Add proper null checks 2012-11-12 08:59:54 +09:00