Commit Graph

657 Commits

Author SHA1 Message Date
Trustin Lee
762e40f357 Make sure HttpVersion checks if the version string is not empty
.. which was the behavior in 3.x.
2013-10-17 20:27:41 +09:00
Jeff Pinner
949a6968ee SPDY: remove SPDY/2 support 2013-10-14 07:27:50 -07:00
Norman Maurer
1f1a627a22 No need to slice before copy. Part of #1848 2013-10-12 20:06:17 +02:00
Michael Grove
036f0859bd copy all sliced buffers, fixes #1848 2013-10-12 20:06:04 +02:00
Norman Maurer
79ff26d221 Fix compile error 2013-10-11 22:06:40 +02:00
Bill Gallagher
be959dc4b7 Merge pull request #1918 from wgallagher/entries
bring back entries()
2013-10-11 13:04:04 -07:00
Bill Gallagher
65f5b15a42 bring back entries() 2013-10-11 15:49:33 -04:00
Norman Maurer
beb6d37603 Add HttpHeaders.contains(name, value, ...) to save creation of LinkedList for simple checks 2013-10-11 21:46:05 +02:00
Bill Gallagher
b72761e99c minor gc optimization: better DefaultSpdyHeaders.iterator() 2013-10-11 20:36:14 +02:00
Bill Gallagher
951a65e57e minor gc optimization: better DefaultHttpHeaders.iterator() 2013-10-11 20:34:27 +02:00
Norman Maurer
2366c2846d [#1881] Use correct field name in NullPointerException 2013-10-04 09:54:21 +02:00
Norman Maurer
4bca1c3fe3 [#1876] Make use of proper state machine in WebSocket08FrameDecoder for performance reasons 2013-10-01 10:20:01 +02:00
Norman Maurer
1ecd1e01a5 [#1880] Use ByteBufAllocator when read bytes into new chunks 2013-10-01 09:27:02 +02:00
Norman Maurer
5a59cb9fb7 [#1879] Correctly validate close frame 2013-10-01 07:32:07 +02:00
Norman Maurer
aaafdf909d [#1878] Fix leak of ByteBuf when masked payload is used 2013-10-01 07:18:16 +02:00
Norman Maurer
328f67fdfe [#1874] WebSocket08FrameDecoder may leak memory if channel is closed before the full frame was received 2013-09-30 20:43:30 +02:00
Jeff Pinner
321990a115 SPDY: add SPDY/3.1 support
- with Michael Schore <mschore@twitter.com>
2013-09-28 12:58:44 +02:00
Arron Norwell
5a0d7fe19a HttpRequestEncoder should append '/' to absolute path requests only when needed 2013-09-22 13:57:10 +02:00
Norman Maurer
c0b9ef9386 [#1833] Add testcase for fix 2013-09-14 11:53:30 +02:00
Phillip Schichtel
d885394b8a [#1833] Replace ; with & only in the QueryString and not the whole URI 2013-09-14 11:52:39 +02:00
Norman Maurer
12f325767c [#1819] Remove HTTP compressor and decompressor from the pipeline after websockets handshake completes 2013-09-09 11:55:25 +02:00
Norman Maurer
c89f1b0a03 [#1818] Pass through message as they are when no compression is needed 2013-09-09 11:43:45 +02:00
Norman Maurer
198dde33b3 Optimize the http-codec to be much faster then before.
This includes the following changes:
  * Rewrite HttpObjectDecoder to use ByteToMessageDecoder
  * Optimize parsing of the header
  * Allow to disable the header validation for performance reason
  * Not need to validate kwown header names and values
  * Minimize access of ThreadLocals
  * Optimize parsing of initial line
2013-09-05 20:21:04 +02:00
Norman Maurer
e46ba9e8de Move encode of chunked content to an extra method, this allows for inline. Related to #1812
encode of chunked content is not the most common pattern so moving it to an extra method makes it possible to inline the rest as it is a smaller method now.
2013-09-05 10:15:51 +02:00
Norman Maurer
81258e9a4e [#1710] Add missing duplicate() overrides in interfaces 2013-09-02 10:02:12 +02:00
Derek Troy-West
b669237bac HTTP Chunk, wrong delimiter written 2013-08-27 18:11:08 +09:00
Norman Maurer
09a748abdb Bump up version to 4.1.0.Alpha1-SNAPSHOT 2013-08-26 15:18:18 +02:00
Norman Maurer
2e39b25cd4 [maven-release-plugin] prepare for next development iteration 2013-08-26 12:01:03 +02:00
Norman Maurer
b67659a866 [maven-release-plugin] prepare release netty-4.0.8.Final 2013-08-26 12:00:54 +02:00
Mike Schore
005d33a761 SPDY: allow MAX_CONCURRENT_STREAMS to be set to 0 2013-08-24 16:55:14 +02:00
Jeff Pinner
d1f592575a SPDY: ensure channel close happens after outbound message is written 2013-08-15 20:31:35 +02:00
Norman Maurer
cc12e40065 [#1730] Correctly release resources in MixedFileUpload after switching from Memory to Disk 2013-08-12 07:23:00 +02:00
Norman Maurer
b9e279064d Minimize buffer allocation as it is expensive if no pooled buffers are used 2013-08-11 21:55:24 +02:00
Norman Maurer
1d3560e389 [maven-release-plugin] prepare for next development iteration 2013-08-08 13:53:28 +02:00
Norman Maurer
8e97e6c461 [maven-release-plugin] prepare release netty-4.0.7.Final 2013-08-08 13:53:19 +02:00
Norman Maurer
60b889375c Allow to also write FileRegion and ChunkInput when using HTTP chunked. Fixes [#1693] 2013-08-07 09:37:23 +02:00
Norman Maurer
3b94154893 [#1690] Correctly return first header value on DefaultHttpHeaders.get(..) 2013-08-06 07:12:45 +02:00
Norman Maurer
20a010a2ea Small optimization in DefaultHttpHeaders.clear() 2013-08-05 21:41:07 +02:00
Norman Maurer
3f2000fa3a [maven-release-plugin] prepare for next development iteration 2013-08-01 10:59:55 +02:00
Norman Maurer
3f70d5caa4 [maven-release-plugin] prepare release netty-4.0.6.Final 2013-08-01 10:59:46 +02:00
Norman Maurer
e3410680de [maven-release-plugin] prepare for next development iteration 2013-07-31 20:08:14 +02:00
Norman Maurer
0e124583d6 [maven-release-plugin] prepare release netty-4.0.5.Final 2013-07-31 20:08:05 +02:00
Norman Maurer
acb28e3ac8 Multiple optimizations in the HttpObjectDecoder
* Minimize allocation of StringBuilder and also minimize char array copy
* Try to detect HttpVersion without calling toUpperCase() for performance reasons
2013-07-31 09:23:02 +02:00
Norman Maurer
e09aea5902 Rename methods of EmbeddedChannel and mark old ones as @deprecated 2013-07-31 16:04:08 +09:00
Josh Wilson
d4b8f16d1f Added http status codes from RFC 6585 2013-07-30 06:41:38 +02:00
Norman Maurer
4222610b2a Remove synchronized in SPDY code 2013-07-29 20:25:45 +02:00
Norman Maurer
6873111d72 [#1648] Make sure trailing headers are not dropped during content encoding/decoding 2013-07-24 15:59:59 +02:00
Jeff Pinner
d5bf1a1187 SPDY: fix NullPointerException in SpdyFrameDecoder 2013-07-24 08:01:30 +02:00
Norman Maurer
0bc7d3f5d1 [maven-release-plugin] prepare for next development iteration 2013-07-23 10:04:23 +02:00
Norman Maurer
ca00182797 [maven-release-plugin] prepare release netty-4.0.4.Final 2013-07-23 10:04:14 +02:00
Norman Maurer
ed9527ba41 [#1639] Fix bug where SpdyOrHttpChooser may not buffer data correctly during protocol detection 2013-07-23 09:05:10 +02:00
Norman Maurer
dbc74fcc97 [#1637] Check for null parameters 2013-07-23 06:30:45 +02:00
Shawn Silverman
80f92f90cb netty-1616: Adding a 'last' check to SpdyHttpEncoder. 2013-07-20 08:11:53 +02:00
Norman Maurer
904385117f [#1607] Make use of gathering writes for WebSocket encoders, to minimize memory copy 2013-07-19 08:28:07 +02:00
Trustin Lee
b130ee6a6c [maven-release-plugin] prepare for next development iteration 2013-07-18 11:17:42 +09:00
Trustin Lee
10d395e829 [maven-release-plugin] prepare release netty-4.0.3.Final 2013-07-18 11:17:31 +09:00
Norman Maurer
fc7c950b08 [maven-release-plugin] prepare for next development iteration 2013-07-17 15:58:36 +02:00
Norman Maurer
bbbf72359e [maven-release-plugin] prepare release netty-4.0.2.Final 2013-07-17 15:58:28 +02:00
Norman Maurer
939fd8d17e Improve the HttpPostRequestDecoder and so make it configurable when it will discard read bytes to prevent OOM 2013-07-17 15:00:43 +02:00
Norman Maurer
66c4c07ec0 [#1595] Fix IllegalStateException thrown by HttpObjectEncoder when an empty HttpContent was written 2013-07-17 12:01:50 +02:00
Derek Troy-West
8e71186153 Modify HttpContentDecoder to writeInbound and readInbound from its internal decoder 2013-07-16 16:27:40 +02:00
Trustin Lee
57eb531eb8 [maven-release-plugin] prepare for next development iteration 2013-07-16 17:16:10 +09:00
Trustin Lee
76cefcc421 [maven-release-plugin] prepare release netty-4.0.1.Final 2013-07-16 17:15:54 +09:00
Jeff Pinner
b8200d975c SPDY: port SpdySessionHandler to netty 4 2013-07-16 06:56:45 +02:00
Norman Maurer
e879848056 [#1579] Fix resource leakage in WebSocketUtil.base64(...) 2013-07-15 19:12:24 +02:00
Norman Maurer
5297eba280 [maven-release-plugin] prepare for next development iteration 2013-07-15 15:48:15 +02:00
Norman Maurer
c5d8af446a [maven-release-plugin] prepare release netty-4.0.0.Final 2013-07-15 15:48:05 +02:00
Trustin Lee
246a3ecdcb [maven-release-plugin] prepare for next development iteration 2013-07-15 20:58:33 +09:00
Trustin Lee
e8fd209115 [maven-release-plugin] prepare release netty-4.0.0.Final 2013-07-15 20:58:21 +09:00
Norman Maurer
e1c78b471b Use the configured ByteBufAllocator in SpdyFrameEncoder 2013-07-15 20:46:23 +09:00
Norman Maurer
efd08efd1b Add missing @Override annotations 2013-07-15 08:18:57 +02:00
Norman Maurer
cd51674070 Small performance improvements for RTSP 2013-07-15 08:18:37 +02:00
Norman Maurer
0393ffbfb2 Reduce memory copies in HttpContentDecoder and so also the risk of memory leaks 2013-07-14 23:12:49 +02:00
Norman Maurer
ecb215c12f Fix buffer leaks 2013-07-14 22:50:53 +02:00
Norman Maurer
32b671f4dc [1575] Correctly parse Content-Type value 2013-07-14 15:48:00 +02:00
Jeff Pinner
030d9fd227 SPDY: check if spdyHeadersFrame is null before adding it to out 2013-07-12 08:53:42 +02:00
Norman Maurer
3db3a9a2bf [#1558] Use correct scheme to detect port. Thanks @golovnin for spotting it. 2013-07-11 23:44:36 +02:00
Norman Maurer
2380461861 [#1558] Corrects handling of port number in WebSockets handshake header values
* This patch was inspired by the work of @golovnin
2013-07-11 23:23:36 +02:00
Jeff Pinner
daa79f3a11 SPDY: fix bug #1211 reintroduced in 7bedd8f 2013-07-11 23:05:17 +02:00
Norman Maurer
e85ae721b2 Set the destroyed flag at the correct time and fix a the httpupload example to release all resources 2013-07-11 13:48:37 +02:00
Norman Maurer
10097bf881 Correctly set the destroyed flag 2013-07-11 11:50:56 +02:00
Norman Maurer
9c49322b9c Improve performance of HttpRequestEncoder.encodeInitialLine(...) 2013-07-10 22:25:20 +02:00
Norman Maurer
46f6e1d360 [#1542] Fix resource-leak in HttpObjectAggregator when a too long frame was detected 2013-07-10 22:10:48 +02:00
Jeff Pinner
b5527e905e fix SpdyHttpDecoder 2013-07-10 21:50:54 +02:00
Jeff Pinner
cf9ee928b0 HttpContentEncoder should not remove Content-Length when acting as a passthrough. 2013-07-10 21:02:00 +02:00
alain
2adf393277 [#1553] Improve performance of encodeInitialLine 2013-07-10 21:00:47 +02:00
Trustin Lee
4d44b37939 Fix potential leak in HttpContentEncoder 2013-07-11 01:10:52 +09:00
Norman Maurer
b57d9f307f Allow per-write promises and disallow promises on flush()
- write() now accepts a ChannelPromise and returns ChannelFuture as most
  users expected.  It makes the user's life much easier because it is
  now much easier to get notified when a specific message has been
  written.
- flush() does not create a ChannelPromise nor returns ChannelFuture.
  It is now similar to what read() looks like.
2013-07-11 00:49:48 +09:00
Trustin Lee
7bedd8f28e Simplify the exception handling of ChannelOutboundHandler.write()
DefaultChannelHandlerContext does not trigger exceptionCaught() immediately when ChannelOutboundHandler.write() raises an exception.  It just records the exception until flush() is triggered.  On invokeFlush(), if there's any exception recorded, DefaultChannelHandlerContext will fail the promise without calling ChannelOutboundHandler.flush().  If more than one exception were raised, only the first exception is used as the cause of the failure and the others will be logged at warn level.
2013-07-10 00:36:47 +09:00
Trustin Lee
26e9d70457 Remove channelReadSuspended / Rename messageReceived(Last) to channelRead(Complete)
- Remove channelReadSuspended because it's actually same with messageReceivedLast
- Rename messageReceived to channelRead
- Rename messageReceivedLast to channelReadComplete

We renamed messageReceivedLast to channelReadComplete because it
reflects what it really is for.  Also, we renamed messageReceived to
channelRead for consistency in method names.
2013-07-09 23:58:51 +09:00
Trustin Lee
cbd8817905 Remove MessageList from public API and change ChannelInbound/OutboundHandler accordingly
I must admit MesageList was pain in the ass.  Instead of forcing a
handler always loop over the list of messages, this commit splits
messageReceived(ctx, list) into two event handlers:

- messageReceived(ctx, msg)
- mmessageReceivedLast(ctx)

When Netty reads one or more messages, messageReceived(ctx, msg) event
is triggered for each message.  Once the current read operation is
finished, messageReceivedLast() is triggered to tell the handler that
the last messageReceived() was the last message in the current batch.

Similarly, for outbound, write(ctx, list) has been split into two:

- write(ctx, msg)
- flush(ctx, promise)

Instead of writing a list of message with a promise, a user is now
supposed to call write(msg) multiple times and then call flush() to
actually flush the buffered messages.

Please note that write() doesn't have a promise with it.  You must call
flush() to get notified on completion. (or you can use writeAndFlush())

Other changes:

- Because MessageList is completely hidden, codec framework uses
  List<Object> instead of MessageList as an output parameter.
2013-07-09 23:51:48 +09:00
Trustin Lee
75229e145a Prettier web socket log messages 2013-07-09 14:53:05 +09:00
Norman Maurer
9c1b31d20a [#1535] Remove Channel.id() and so fix the possible leakage of the previous used Channel id map
The user can still use Channel.hashCode() for logging. It's just not 100% unique but should be good enough for most cases
2013-07-08 14:07:18 +02:00
Trustin Lee
1bf2f702cb Do not use unreleaseableBuffer and duplicate
.. because it's not as fast as just creating a new direct buffer.
2013-07-07 15:28:43 +09:00
Trustin Lee
553cd034b9 Fix checkstyle 2013-07-07 12:39:29 +09:00
Trustin Lee
a4f2789e55 Add missing final modifier 2013-07-07 12:38:53 +09:00
Trustin Lee
2b2f8db5d2 Use ThreadLocalRandom where possible 2013-07-07 12:37:36 +09:00
Norman Maurer
086ae3536c [#1533] Introduce ByteBufHolder.duplicate() and make use of it in DefaultChannelGroup.write(...) 2013-07-06 21:17:51 +02:00
Norman Maurer
b63f3488b7 Add a HttpPostRequestDecoder.destory() method which should be used to destroy the decoder and free up resources
* Also make the contract more clear about who needs to call release()
2013-07-05 08:31:07 +02:00
Norman Maurer
b26e61d689 Fix broken tests 2013-07-05 07:18:33 +02:00