Norman Maurer
87ba8cb4b0
[ #705 ] Fix SpdyOrHttpChooser
2012-11-02 17:58:19 +01:00
Jeff Pinner
be6ddb74aa
HTTP method should be case sensitive (RFC-2616 Sec. 5.1.1)
2012-11-01 22:52:23 -07:00
Cruz Julian Bishop
93d0226c03
Small checkstyle fixes
...
Netty can build again, now.
Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-10-30 21:57:26 +10:00
Norman Maurer
4696fcde1f
[ #691 ] Correctly handle SpdyRstStreamFrame
2012-10-30 08:48:09 +01:00
Norman Maurer
e726ff63d9
Cleanup
2012-10-29 20:21:38 +01:00
Trustin Lee
a6c4f651a7
[ #661 ] WebSocketClientHandshaker is broken.
...
- Remove HttpRequestEncoder after handshaking is complete
- Fix a bug in the WebSocket client example where it sends a frame even before handshake is complete
2012-10-16 14:40:39 -07:00
Norman Maurer
7eef61580e
No need to use a concurrent Queue with out new thread-model. See #626
2012-10-02 20:16:35 +02:00
Norman Maurer
09d9f46e58
Merge pull request #630 from ngocdaothanh/master
...
Add CORS headers
2012-10-01 21:49:38 -07:00
Norman Maurer
59cd054fe3
Merge SpdyOrHttpChooser and SpdyHttpResponseStreamIdHandler into master. See #626
2012-09-30 21:18:54 +02:00
Ngoc Dao
7751daf2a4
Add ACCESS_CONTROL_EXPOSE_HEADERS
2012-09-28 19:18:21 +09:00
Ngoc Dao
f5e94d27e0
Add CORS headers
...
http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
https://developer.mozilla.org/en-US/docs/HTTP_access_control
2012-09-28 17:19:50 +09:00
Trustin Lee
623956b838
[ #441 ] Provide a better way to handle decoder failures
...
* Make HttpChunkAggregator handle DecoderResult properly
2012-09-28 15:26:38 +09:00
Trustin Lee
9155f58c64
Rename get/setDecodeResult() to get/setDecoderResult()
2012-09-28 15:20:02 +09:00
Trustin Lee
bf808b3486
Rename DecodeResult to DecoderResult
2012-09-28 15:19:08 +09:00
Trustin Lee
41e0ef2e9a
[ #441 ] Provide a better way to handle decoder failures
...
* Update toString() of all HttpObject implementations
* HttpMessageDecoder does not raise an exception but sets decoderResult property of the decoded message.
* HttpMessageDecoder discards inbound traffic once decoding fails, by adding a new state called BAD_MESSAGE.
* Add a test case that tests this behavior.
2012-09-28 15:16:29 +09:00
Trustin Lee
b923d0c51f
Use supertype HttpObject instead of HttpMessage + HttpChunk where possible
2012-09-28 14:00:07 +09:00
Trustin Lee
adebda1560
[ #441 ] Provide a better way to handle decoder failures
...
* Add DecodeResult that represents the result of decoding a message
* Add HttpObject which HttpMessage and HttpChunk extend.
** HttpObject has a property 'decodeResult'
2012-09-28 13:48:17 +09:00
Trustin Lee
2ecf26c8eb
Fix #525 Add CORS preflight headers to HttpHeaders.Names
2012-09-27 19:16:02 +09:00
Trustin Lee
a156f67804
[ #624 ] Add varargs constructor to MessageToByteEncoder, MessageToMessage(Encoder|Decoder|Codec) to implement default isEncodable/isDecodable()
...
.. and modify all their subtypes to take advantage of this improvement.
2012-09-23 17:01:31 +09:00
norman
8ab1ef1432
Fix checkstyle
2012-09-10 12:10:24 +02:00
norman
0233a3dd63
Close the channel after the response was written to the client on a WebSocketHandshakeException. See #587
2012-09-10 07:22:35 +02:00
norman
6c2053bae5
Check if WebSocketServerProtocolHandshakeHandler is already in the pipeline before adding it. See #587
2012-09-10 07:18:26 +02:00
norman
6e39192462
Rename WebSocketServerHandshakeHandler to WebSocketServerProtocolHnadshakeHandler and also make it public. See #587
2012-09-10 07:15:59 +02:00
Norman Maurer
4353aa6794
Use Secure websockets if SslHandler is present in the ChannelPipeline. See #587
2012-09-09 19:48:53 +02:00
Norman Maurer
bd557a6330
Remove not necessary try / catch block. See #587
2012-09-09 19:35:56 +02:00
Jeff Smick
416c026efe
Upgrade client connection after completed response
2012-09-09 08:54:46 -07:00
Daniel Bevenius
150e8b4105
WebSocket enhancements
...
- Refactoring and adding suggestions from Norman and Vibul.
2012-09-09 08:30:40 +02:00
Norman Maurer
c6436ad470
Also move the replacement of the decoder to the ChannelFutureListener for the websocket upgrade. See #586
2012-09-09 08:21:32 +02:00
Jeff Smick
90d15c4627
Upgrade connection after completed response
...
Channel handlers above the HttpEncoder may delay the repsonse being
written to the socket. We need to wait for the response to complete
before upgrading the pipeline.
2012-09-08 20:54:43 -07:00
Trustin Lee
a43f686d64
[ #527 ] Add Javadoc for HttpTransferEncoding
2012-08-21 14:05:04 +09:00
Trustin Lee
ec2b29f0b6
[ #539 ] Potential direct memory leak in HttpContentEn/Decoder
2012-08-20 13:38:14 +09:00
Trustin Lee
10f26f3205
[ #539 ] Potential direct memory leak in HttpContentEn/Decoder
2012-08-20 12:18:39 +09:00
Trustin Lee
7f3f792017
Fix a bug where CookieDecoder sets the default maxAge to -1
...
.. which should be Long.MIN_VALUE
2012-08-20 12:05:47 +09:00
Trustin Lee
602f976e41
[ #527 ] Add a new property to HttpMessage to help clarify its transfer encoding
...
- Add an enum: HttpTransferEncoding
- consists of SINGLE, STREAMED, and CHUNKED
- Add HttpMessage.transferEncoding
- replaces is/setChunked()
2012-08-19 19:06:47 +09:00
Norman Maurer
c22b559dfa
Set maxAge to Integer.MIN_VALUE by default. See #534
2012-08-19 11:55:15 +03:00
Norman Maurer
e80abf0b39
Update codec-http/src/main/java/io/netty/handler/codec/http/DefaultCookie.java
...
Allow to set a negative value for maxAge of DefaultCookie. See #533
2012-08-19 11:48:51 +03:00
Trustin Lee
0a99a33540
Use String.getBytes(Charset) wherever possible
2012-08-17 11:43:59 +09:00
Trustin Lee
de37d75871
[ #521 ] Encode URI using UTF-8 charset
...
- Forwardport @jpinner's pull request #522
- Use Charset instead of charset name
2012-08-17 11:39:36 +09:00
Trustin Lee
00d6010916
[ #494 ] Automatically adding chunked encoding header breaks streaming
...
Add a missing statement dropped while forwardporting
2012-08-17 11:34:35 +09:00
Trustin Lee
e530ccaeb8
Fix typo
2012-08-17 11:31:40 +09:00
Trustin Lee
0baf359202
[ #494 ] Automatically adding chunked encoding header breaks streaming
...
Forwardport @jamestyrrell's pull request
2012-08-17 11:30:08 +09:00
Jeff Pinner
d3d52edb31
SPDY: introduce SpdyControlFrame tag interface
2012-08-14 18:00:39 -07:00
Jeff Pinner
a0d9bed8f9
SPDY: remove deprecated data compressed flag
2012-08-14 17:58:22 -07:00
norman
ba1c7c5c55
Replace usage of QueueFactory with ConcurrentLinkedQueue and LinkedBlockingQueue. See #477
2012-07-30 08:01:46 +02:00
norman
bdde5a20f6
Allow to set Expires attribute
...
to a date in theast. See #479
2012-07-30 07:44:53 +02:00
Trustin Lee
8d813b127c
Replace free() with reference counting / Fix SlicedByteBuf.unsafe()
...
- based on @normanmaurer's feed back
- Added Unpooled.compositeBuffer(int)
2012-07-20 12:33:17 +09:00
Trustin Lee
5a613f379e
Make ByteBuf dynamic / Introduce an interface for composite buffers
...
- Replace ByteBufferBackedByteBuf with DirectByteBuf
- Make DirectByteBuf and HeapByteBuf dynamic
- Remove DynamicByteBuf
- Replace Unpooled.dynamicBuffer() with Unpooled.buffer() and
directBuffer()
- Remove ByteBufFactory (will be replaced with ByteBufPool later)
- Add ByteBuf.Unsafe (might change in the future)
2012-07-19 20:25:47 +09:00
Frédéric Brégier
e36c4c77bf
fix header to out
2012-07-18 11:50:28 +03:00
Frédéric Brégier
56a72c6456
writesBytes as in V3 instead of writeInt (RFC says 0 to 4 bytes)
2012-07-18 11:46:56 +03:00
Frédéric Brégier
92334b919e
Fix for issue #456 related to payload using 2 differents RANDOM while only one should be used
2012-07-18 11:43:36 +03:00
Trustin Lee
e157ea1a66
Allow a user use any type as a ReplayingDecoder state / AIO cleanup
...
- Removed VoidEnum because a user can now specify Void instead
- AIO: Prefer discardReadBytes to clear
- AIO: Fixed a potential bug where notifyFlushFutures() is not called
if flush() was requested with no outbound data
2012-07-09 20:40:43 +09:00
Trustin Lee
9af7512c35
Use String.CASE_INSENSITIVE_ORDER instead of custom Comparator
2012-07-07 13:30:28 +09:00
norman
a7a4081e70
Fix checkstyle
2012-07-04 15:27:10 +02:00
norman
1784283d29
Correctly format cookies. This fix some bug which lead to expiring of cookies to not work. See #426
2012-07-04 15:20:47 +02:00
norman
61a7c78a53
Port fix for #433
2012-07-04 15:14:05 +02:00
norman
ac4dacd84f
Minimize byte copies by using a CompositeByteBuf to concat the chunks. See #413
2012-07-03 10:37:11 +02:00
Norman Maurer
c35f90f920
Port enhancement to reduce memory copy if possible. See #412
2012-06-29 13:26:13 +02:00
Norman Maurer
cd95dc5924
Merge pull request #422 from Massive-Dynamics/http-doc
...
Even more documentation changes (mainly) - HTTP
2012-06-29 02:55:20 -07:00
Cruz Julian Bishop
3792693468
Changed "Gets the" to "Returns the" - Requested by @trustin
2012-06-29 19:25:31 +10:00
Cruz Julian Bishop
f3fff2d3e8
Documentation redone for Cookie
2012-06-29 18:59:12 +10:00
Cruz Julian Bishop
26ed1a9972
Documentation and slight internal refactoring of HttpCodecUtil
2012-06-29 17:03:47 +10:00
Norman Maurer
d0c8c10681
Merge pull request #420 from Massive-Dynamics/fix-failed-javadoc
...
Fixes a bit of javadoc that was broken by a failed merge
2012-06-28 23:51:05 -07:00
Cruz Julian Bishop
4d5e4c3433
Make HttpResponse's javadoc a bit easier to read
2012-06-29 16:39:39 +10:00
Cruz Julian Bishop
a818cad45a
Make HttpRequest's documentation easier to read
2012-06-29 16:37:40 +10:00
Cruz Julian Bishop
59bb92171b
Made the documentation in HttpMessage a bit easier to understand
2012-06-29 16:33:14 +10:00
Cruz Julian Bishop
9f9b36f579
Redid documentation for WebSocketUtil
2012-06-29 15:12:59 +10:00
Cruz Julian Bishop
be57cf3b51
Fixes a bit of javadoc that was broken by a failed merge
2012-06-29 15:03:41 +10:00
Norman Maurer
2610a94de9
Fix SpdyHttpHeaders.setScheme setting the wrong header. See #417
2012-06-28 13:36:21 +02:00
Trustin Lee
a5d35f89d2
Add missing license headers
2012-06-26 17:33:05 +09:00
Trustin Lee
3b945bca78
Remove a method of no use
2012-06-26 05:30:07 +09:00
Trustin Lee
6d2f6d697d
Make CookieEncoder and CookieDecoder stateless
...
- Also: CookieEncoder is split into ServerCookieEncoder and
ClientCookieEncoder
2012-06-26 05:26:54 +09:00
Trustin Lee
7b2992a95a
Fix #218 : CookieDecoder.decode() throws StackOverflowError
...
- Rewrote key-value decoder not using a regular expression
2012-06-24 18:07:47 +09:00
Trustin Lee
ee8091f6fb
Fix #397 : Allow all cookie names that conform to the RFC
...
- Lenient flag is not needed anymore
2012-06-24 14:17:13 +09:00
Trustin Lee
a6e3d7d0ca
Fix #405 : CookieEncoder should refuse to encode more than one cookie
...
.. if on server mode
2012-06-24 12:59:44 +09:00
Trustin Lee
9ec51d01d6
Add ChannelMetadata and remove unnecessary disconnect() impls
...
- Add Channel.metadata() and remove Channel.bufferType()
- DefaultPipeline automatically redirects disconnect() request to
close() if the channel has no disconnect operation
- Remove unnecessary disconnect() implementations
2012-06-19 10:39:30 +09:00
Trustin Lee
1f69e664fb
Forward-port JDK ZlibEncoder patch ( #404 )
...
- Rename ZlibEncoder/Decoder to JZlibEncoder/Decoder
- Define a new ZlibEncoder/Decoder class
- Add JdkZlibEncoder
- All JZlib* and JdkZlib* extends ZlibEncoder/Decoder
- Add ZlibCodecFactory and use it everywhere
2012-06-19 09:54:25 +09:00
Trustin Lee
91fe9f4b38
serverID -> serverId ( #393 Ensure all fields follow naming convention)
2012-06-12 21:20:27 +09:00
Trustin Lee
a35aeb8cd9
StreamID -> StreamId ( #393 Ensure all fields follow naming convention)
2012-06-12 21:06:45 +09:00
Trustin Lee
9bf0ad8329
ID -> Id ( #393 Ensure all fields follow our naming convention)
2012-06-12 20:29:06 +09:00
Trustin Lee
60de50d89e
ID -> Id ( #393 Ensure all fields follow our naming convention)
2012-06-12 20:25:21 +09:00
Trustin Lee
154198a385
ID -> Id ( #393 Ensure all fields follow our naming convention)
2012-06-12 20:20:24 +09:00
Trustin Lee
676b81a4cd
getPersist(ed) -> isPersist(ed) ( #393 )
2012-06-12 20:05:12 +09:00
Trustin Lee
fdb66b6294
Add 'is' prefix to boolean getters if their meaning is ambiguous
...
- plus minor code cleanup
- ID -> Id or id
2012-06-12 17:58:22 +09:00
Trustin Lee
ecd0ae5406
Prefer MessageBuf over Queue where possible
...
- Also replaced thread safe queues with non-thread-safe ones where
possible
- Unpooled.wrappedBuffer(Queue<T>) does not wrap MessageBuf anymore
2012-06-12 17:02:00 +09:00
Trustin Lee
e1faea035e
Automatic clean-up with Eclipse
...
- Mostly import organization & whitespace removal
2012-06-11 23:04:04 +09:00
Trustin Lee
6211e53e86
Code clean-up based on IntelliJ code analysis
2012-06-11 22:54:28 +09:00
Trustin Lee
754392aaa9
Add ByteBuf.order(ByteOrder) method to simplify little endian access
...
- Removed all methods that requires ByteOrder as a parameter
from Unpooled (formerly ByteBufs/ChannelBuffers)
- Instead, a user calls order(ByteOrder) to get a little endian
version of the user's buffer
- This gives less overwhelming number of methods in Unpooled.
2012-06-11 20:24:44 +09:00
Trustin Lee
876847fd20
Merge MessageBufs and ByteBufs into Unpooled
...
- e.g. Unpooled.messageBuffer()
- It will make much more sense once we introduce pooling:
- i.e. Pooled.buffer()
2012-06-11 17:02:29 +09:00
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
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