Commit Graph

2967 Commits

Author SHA1 Message Date
Norman Maurer
bc1ef572b9 [#766] Add extract(..) method to FrameDecoder to allow easier optimizations in sub-classes and still make it consistent 2012-11-25 17:33:38 +01:00
Daniel Bevenius
ed65dffddf Adding WebSocket Example using WebSocketServerProtocolHandler. 2012-11-25 14:28:52 +01:00
Benoit Sigoure
d4155ad518 Add a line-based frame decoder with good performance.
Using DelimiterBasedFrameDecoder with Delimiters.lineDelimiter() has
quadratic performance in the size of the input buffer.  Needless to
say, the performance degrades pretty quickly as the size of the buffer
increases.  Larger MTUs or loopback connections can make it so bad that
it appears that the code is "busy waiting", when in fact it's spending
almost 100% of the CPU time in DelimiterBasedFrameDecoder.indexOf().

Add a new LineBasedFrameDecoder that decodes line-delimited frames
in O(n) instead of DelimiterBasedFrameDecoder's O(n^2) implementation.
In OpenTSDB's telnet-style protocol decoder this resulted in throughput
increases of an order of magnitude.

Change DelimiterBasedFrameDecoder to automatically detect when the
frames are delimited by line endings, and automatically switch to
using LineBasedFrameDecoder under the hood.  This means that all Netty
applications out there that using the combo DelimiterBasedFrameDecoder
with Delimiters.lineDelimiter() will automatically benefit from the
better performance of LineBasedFrameDecoder, without requiring a code
change.
2012-11-24 20:51:45 +01:00
Norman Maurer
26943f189c [761] Fix possible NPE in cleanupWriteBuffer() when closing Channel 2012-11-23 06:47:10 +01:00
Jaen Saul
0cb145ed68 SPDY: fix header block values truncation in decompression 2012-11-20 20:25:37 +02:00
Norman Maurer
5ec179c33c [#723] Use ExecutorServer.shutdown() in ExecutorHandler when terminate it. This way not tasks are lost 2012-11-17 19:47:06 +01:00
Jeff Pinner
8e3ec00e33 SPDY: fixed session status (internal error misdocumented) 2012-11-17 19:27:07 +01:00
Norman Maurer
3e7c8341a6 [#734] Make sure that ChannelFuture is also notified when write an unsupported message to the channel and also prevent a NPE which could be raised because of the bug before 2012-11-16 22:42:52 +01:00
Norman Maurer
d15f9eda08 [#740] Fix WebSocketClientHandshaker00.finishHandshake() validations 2012-11-15 13:00:44 +01:00
Norman Maurer
1e8ed50482 [#737] WebSocketClientHandshaker00 should set Content-Length header do workaround problem with proxy 2012-11-14 10:12:42 +01:00
Norman Maurer
50e171273d [#735] Improve the notification of the handshake future 2012-11-13 18:42:12 +01:00
Norman Maurer
966565d4b9 [#735] Make sure the handshake ChannelFuture is notified after the right encoder is present in the ChannelPipeline 2012-11-13 09:31:34 +01:00
Norman Maurer
a0e9921517 [#735] Make sure the handshake ChannelFuture is notified after the right encoder is present in the ChannelPipeline 2012-11-13 09:14:16 +01:00
Norman Maurer
df575c6cd0 [#729] Correctly handle urls with empty abs_path in it when issue the websocket handshake 2012-11-12 15:33:23 +01:00
Trustin Lee
adee1b4156 Fix visibility warnings from the inspector. 2012-11-12 14:03:43 +09:00
Trustin Lee
262919b045 Allow '_' in parameter names although discouraged 2012-11-12 13:39:24 +09:00
Trustin Lee
c09f8c147d Fix more inspection warnings + compilation errors 2012-11-12 13:24:59 +09:00
Trustin Lee
bcc088b3d7 Fix parameter namings + some more 2012-11-12 12:59:37 +09:00
Trustin Lee
369574078b Fix inspection warnings related with JUnit usage 2012-11-12 12:45:06 +09:00
Trustin Lee
669fa64829 Fix various Javadoc issues / Do not use argN parameter names 2012-11-12 12:26:18 +09:00
Trustin Lee
d92236a124 Prefer {@code ...} to <code>...</code> / Fix deprecation warnings 2012-11-12 11:51:23 +09:00
Trustin Lee
c1b31f982e Fix deprecation warnings 2012-11-12 11:25:58 +09:00
Trustin Lee
a3acde0b73 'break' statement in a 'finally' block!? 2012-11-12 09:55:07 +09:00
Trustin Lee
849a265c2e Optimize imports 2012-11-12 09:47:20 +09:00
Trustin Lee
2fe3e495c1 Make a member field final wherever possible 2012-11-12 09:43:54 +09:00
Trustin Lee
d23766fa27 Replace a variable with a constant wherever possible 2012-11-12 09:43:14 +09:00
Trustin Lee
12115198d0 Remove redundant 'else' branches. 2012-11-12 09:31:40 +09:00
Trustin Lee
4cd7fb1abb Remove unnecessary 'return's / Clean up QueryStringDecoder 2012-11-12 09:15:33 +09:00
Trustin Lee
a76cdc26d0 Remove unnecessary qualifiers 2012-11-12 09:11:48 +09:00
Trustin Lee
dc8d9fac87 Prefer "str".equals(var) to var.equals("str") / Add proper null checks 2012-11-12 09:00:59 +09:00
Norman Maurer
95074e3677 Allow to serve more then one bound port per Thread. This fix the problem that you was not able to bound thousends of ports without huge amount of threads. 2012-11-11 18:52:28 +01:00
Trustin Lee
6be84510dc More robust localhost resolution
Ensure the resolved localhost can be bound and connected actually
2012-11-10 08:45:07 +09:00
Trustin Lee
922a8dbb47 Use 'x' over "x" wherever possible / String.equals("") -> isEmpty() 2012-11-10 08:03:52 +09:00
Trustin Lee
d638052036 Add 'static' modifier to the methods that don't need to be member methods 2012-11-10 07:54:33 +09:00
Trustin Lee
ffe5459a88 Replace keySet() + unnecessary map lookup with entrySet() 2012-11-10 07:36:42 +09:00
Trustin Lee
9a87f1748c Make classes static wherever possible 2012-11-10 07:32:52 +09:00
Trustin Lee
9a4296f320 Use foreach loop wherever possible / Prefer String.contains() to indexOf() >= 0 / Prefer StringUtil.split() to String.split() 2012-11-10 07:24:54 +09:00
Trustin Lee
ab02e90684 Remove methods overridden but identical with the super implementation / Make constructors of abstract classes protected rather than non-sense public
AbstractWrappedByteBuf.capacity(int) should raise a UnsupportedOperationException rather than ReadOnlyBufferException.
2012-11-10 07:10:30 +09:00
Trustin Lee
ac53b9e99e Remove unnecessary throws clauses for unchecked exceptions 2012-11-10 07:07:37 +09:00
Trustin Lee
4b4c6a436b Remove unused imports 2012-11-10 07:05:18 +09:00
Trustin Lee
bc7eb20c6e Remove various unnecesary qualifiers 2012-11-10 07:02:56 +09:00
Trustin Lee
44159abefa Remove redundant field initialization 2012-11-10 06:56:39 +09:00
Trustin Lee
1b35cfee85 Remove redundant throws clauses / Suppress inspections for some false positives 2012-11-10 06:47:58 +09:00
Trustin Lee
c3c75717db Remove unnecessary this, parenthesis, and semicolons 2012-11-10 02:26:59 +09:00
Trustin Lee
5d1690dfa7 Add missing final modifiers 2012-11-10 02:19:39 +09:00
Trustin Lee
6453b71ab0 Remove recundant type casting 2012-11-10 02:13:33 +09:00
Trustin Lee
f4585b9f53 Remove unnecessary null check before equals() 2012-11-10 01:34:39 +09:00
Trustin Lee
ff03df6851 Remove unnecessary 'final' on parameter 2012-11-10 01:33:16 +09:00
Trustin Lee
72d85f58eb Remove unnecessarily qualified statis access 2012-11-10 01:31:31 +09:00
Trustin Lee
53cecdb31b Prefer isEmpty() over size() == 0 2012-11-10 01:21:25 +09:00
Trustin Lee
0bc6ace8d1 Remove redundant no-arg constructors 2012-11-10 01:08:32 +09:00
Trustin Lee
74a235d29f Simplify array initialization 2012-11-10 01:00:26 +09:00
Trustin Lee
d8f0bc9e3e Do not use Vector 2012-11-10 00:59:10 +09:00
Trustin Lee
59bc375f73 Fix backward incompatibility 2012-11-10 00:48:35 +09:00
Trustin Lee
c34d0a2272 Replace dynamic regular expressions with precompiled Patterns or new StringUtil.split() 2012-11-10 00:42:35 +09:00
Trustin Lee
00d9111833 Remove concatenation with empty string 2012-11-09 17:55:12 +09:00
Trustin Lee
b0b765001c Enum should not have a non-final value 2012-11-09 17:37:03 +09:00
Trustin Lee
c06722c232 Add missing @Override annotation 2012-11-09 17:34:24 +09:00
Trustin Lee
bdaa4fbfeb Simplify SingletonHolder by using interface instead of static class 2012-11-09 17:33:26 +09:00
Trustin Lee
779ddd1d2f Replace a = a + b to a += b 2012-11-09 17:19:30 +09:00
Trustin Lee
b1f2fe752b Move private methods only used from inner classes to the inner classes 2012-11-09 17:19:10 +09:00
Trustin Lee
3e21e3250f Fix overly-strong type casts 2012-11-09 17:15:13 +09:00
Norman Maurer
1a006fafad [#719] Handle http requests without an absolute path the right way when encoding them, which is adding / to it 2012-11-09 07:16:32 +01:00
Norman Maurer
55457691d2 [#712] Fix parsing dates in the past bug in CookieDecoder 2012-11-08 10:02:50 +01:00
Norman Maurer
88c2200264 Fix checkstyle 2012-11-02 20:20:19 +01:00
Norman Maurer
19104e8774 [#698] ExceptionEvent could be swallowed if last handler in pipeline is a ChannelDownstreamHandler 2012-11-02 20:15:17 +01:00
Jeff Pinner
b0db3a04aa HTTP method should be case sensitive (RFC-2616 Sec. 5.1.1) 2012-11-01 22:42:12 -07:00
Norman Maurer
d9090ecb1b Merge branch '3' of https://github.com/netty/netty into 3 2012-10-30 08:49:11 +01:00
Norman Maurer
fd61b27ee8 [#691] Correctly handle SpdyRstStreamFrame 2012-10-30 08:19:48 +01:00
Norman Maurer
62395ad1c5 Merge pull request #693 from veebs/3ws
updated autobahn test instructions in 3 branch
2012-10-29 23:21:30 -07:00
Norman Maurer
db697f1f06 [694] WebSocket08FrameDecoder calls await*() in the Worker-Thread 2012-10-29 21:04:11 +01:00
Veebs
43d937b39f updated autobahn test instructions 2012-10-29 04:11:02 -07:00
Norman Maurer
b1cfaad9bf Fix NPE which can accour when the Selector is closed but there are still timeout tasks to handle on client mode. The NPE does not have any bad side-effects, but its still ugly. See #685 2012-10-26 11:40:20 +02:00
Trustin Lee
b9429c930f [#679] Netty 3.5.8 breaks app on startup with NPE
- Get system property when requested; do not cache it.
2012-10-24 10:38:23 -07:00
Norman Maurer
99698a5272 Fix NPE when System property os.name does not exist. See #669 and #679 2012-10-24 18:46:56 +02:00
Norman Maurer
e3cf41c9fb Upgrade to apiviz 1.3.2.GA. See #676 2012-10-23 13:20:02 +02:00
Norman Maurer
1e8b7d896a Fix comment 2012-10-17 15:47:21 +02:00
Norman Maurer
9c921b050f Some more optimization in HashedWheelTimer based on the comments of @viktorklang 2012-10-17 15:26:54 +02:00
Trustin Lee
543cb17acd Reduce synchronization overhead in HashedWheelTimer.start/stop() 2012-10-16 13:38:25 -07:00
Norman Maurer
b75ab6171c Only parse the packet length once per encrypted packet. See #658 2012-10-16 14:21:42 +02:00
Norman Maurer
52d64afa2f Fix the detection of encrypted data. See #655 2012-10-16 13:23:18 +02:00
Norman Maurer
0c82f5d2e5 Introduce helper method to detect if a buffer is encrypted. See #657 2012-10-16 13:22:41 +02:00
Norman Maurer
f5969778d0 Explicit close streams 2012-10-16 11:26:04 +02:00
Ngoc Dao
fb5e199d9e Uncomment the following lines if you want HTTPS 2012-10-09 14:33:12 +09:00
Ngoc Dao
ae909f5d12 Uncomment the following line if you want HTTPS: add missing imports 2012-10-09 14:30:15 +09:00
Norman Maurer
2056882cfc Fire the IdleStateEvent and also the ReadTimeOutException / WriteTimeOutException from the Worker-Thread. See #641 2012-10-05 20:08:21 +02:00
Norman Maurer
8669732479 Fix checkstyle 2012-10-05 07:16:54 +02:00
Norman Maurer
4bca91786a Merge pull request #637 from losipiuk/3
Call ChunkedWriteHandler.flush() once again if tried when locked.
2012-10-04 02:54:31 -07:00
Norman Maurer
389cdb124f Add a test that I wrote while working on some OOME problem 2012-10-04 11:07:05 +02:00
Norman Maurer
a6e89aa142 Manually GC direct ByteBuffer that is used by the Worker's on releaseExternalResources() to free up memory asap. See #638 2012-10-04 09:02:53 +02:00
Lukasz Osipiuk
20509fb516 Call ChunkedWriteHandler.flush() once again if tried when locked.
Force recursive call of ChunkedWriteHandler.flush() if another thread
tried to call it when lock was held.
Solves problem of lost resumeTransfer() call.
2012-10-02 15:17:23 +02:00
Norman Maurer
6ca523a754 Merge pull request #631 from ngocdaothanh/3
Add CORS headers
2012-10-01 21:48:37 -07:00
Norman Maurer
4dc4664692 Fix year in header 2012-10-01 06:59:13 +02:00
Norman Maurer
8f4c583e40 Fix NPE in MemoryAwareThreadPoolExecutor and also add a testcase. See #634 2012-10-01 06:57:12 +02:00
Ngoc Dao
605bbac15c Sort header names 2012-09-28 19:25:27 +09:00
Ngoc Dao
8c694b3bfb 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:10:54 +09:00
Norman Maurer
2689b055fd Fix checkstyle 2012-09-25 18:18:48 +02:00
Veebs
612e6ff9af Corrected typo 2012-09-24 04:05:46 -07:00
Norman Maurer
c70ea8250c Add a new handler which is called SpdyHttpResponseStreamIdHandler and takes care of adding the right STREAM_ID if non is present. This makes it possible to reuse http only handlers with spdy. See #626 2012-09-23 22:46:31 +02:00
Norman Maurer
d497ca97ce Add a new handler which is called SpdyHttpResponseStreamIdHandler and takes care of adding the right STREAM_ID if non is present. This makes it possible to reuse http only handlers with spdy. See #626 2012-09-23 22:42:50 +02:00
Norman Maurer
e6d5e25733 Fix visibility. See #626 2012-09-23 20:18:41 +02:00
Norman Maurer
6355abfde3 Add SpdyOrHttpChooser which handles the setup the ChannelPipeline for SPDY or HTTP (based on the protocol). Users can extend this to make it easier. See #626 2012-09-23 19:53:30 +02:00
Norman Maurer
03ae711b0a Cleanup imports 2012-09-23 18:29:42 +02:00
Norman Maurer
530b72fad7 Fix IndexOutOfBoundException when using CompositeChannelBuffer and the readerIndex is at the last position and an empty array is passed to read to. See #474 2012-09-22 18:33:33 +02:00
Norman Maurer
ef0ee5f7ba Add javadocs and cleanup. Part of #613 2012-09-21 20:25:18 +02:00
Norman Maurer
0ee4bbf8e7 Merge pull request #613 from netty/timeout_improvement
Use a TimerTask to trigger handling of timeouts, so we can raise the sel...
2012-09-21 08:33:42 -07:00
Lukasz Osipiuk
5362842548 Fix StackOverflowError in ChunkedWriteHandler; issue #620 2012-09-21 14:56:31 +02:00
stefanmk
3de2d06971 Update src/main/java/org/jboss/netty/handler/queue/BufferedWriteHandler.java
fix bug, flush variable was never reset
2012-09-19 17:50:25 +03:00
Norman Maurer
bd99d0f3e4 Allow to pass in the Timer via constructor and also stop it when the bootstrap was shutdown 2012-09-18 20:44:39 +02:00
Norman Maurer
b1f846b0d7 Use the correct delay to schedule the task and remove not necessary if check 2012-09-18 08:47:31 +02:00
Norman Maurer
68777158a4 Use a TimerTask to trigger handling of timeouts, so we can raise the select timeout again and so solve the problems with heavy context-switches 2012-09-18 08:21:53 +02:00
norman
c3af4427bb Correctly handle exceptions when doing the handshake. See #593 2012-09-14 14:00:16 +02:00
norman
67f6513183 Cleanup 2012-09-14 13:58:04 +02:00
norman
d82b929e21 Make sure the WebSocketClientHandshaker* work also with non Heap ChannelBuffers. See #602 2012-09-14 13:55:47 +02:00
norman
1ddc19bbca Include apiviz jar in dist. See #599 2012-09-14 09:51:06 +02:00
norman
07187bccee Also notify ChannelFuture of PendingWrite when the SSLEngine was closed. See #601 2012-09-14 09:44:54 +02:00
norman
f1e00947a6 Make sure we only create an Iterator during processSelectedKeys(..) if there is really something key to process. This cut down unneeded garbage that needs to get handled by the GC later. See #597 2012-09-13 09:45:55 +02:00
Daniel Bevenius
aca94691da Removing @Override annotations. 2012-09-11 12:15:08 +02:00
Daniel Bevenius
7c79d6f7b1 Fixes after feedback from Norman. 2012-09-11 11:01:35 +02:00
Daniel Bevenius
21b9dd00cd WebSocket enhancements for 3.x 2012-09-11 08:51:15 +02:00
Norman Maurer
051b062530 ClientBoostrap#bind() Javadoc fix. See #588 2012-09-10 05:32:12 +02:00
Norman Maurer
c534864e3f Remove @Override annotation 2012-09-10 05:21:22 +02:00
Jeff Smick
324ba369e0 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-09 08:50:31 -07:00
norman
3d441821a9 Throw an RejectedExecutionException if someone tries to register a Channel to an AbstractNioWorker that was shutdown before. Part of #582 2012-09-04 07:40:07 +02:00
Norman Maurer
3bdccc633a Remove @deprecated use of allowShutDownOnIdle in the AbstractNioWorker and AbstractNioWorkerPool implementation. See #583 2012-09-03 21:21:24 +02:00
Norman Maurer
64b9e8fb40 Don't create Selector in a lazy fashion, just create it in the constructor. See #582 2012-09-03 21:14:00 +02:00
norman
378ea8e475 Fix a race which could lead to an exception on windows when try to release resources. See #395 2012-09-03 14:37:55 +02:00
Trustin Lee
1ac9930e39 Fix incorrect Java 7 detection 2012-09-03 16:15:33 +09:00
Trustin Lee
32c58354fa Add SystemPropertyUtil.refresh() / Remove DebugUtilTest
- DebugUtilTest does not pass at all unless a new VM is not launched for
  every test method
2012-09-03 16:12:02 +09:00
norman
a61403de53 Calculate the 80% the right way. See #327 2012-09-03 08:58:33 +02:00
Trustin Lee
f87bd9fd81 Split too long lines 2012-09-01 16:51:08 +09:00
Trustin Lee
79371e632c Fix typo 2012-09-01 16:50:38 +09:00
Trustin Lee
bd3000858d Move system property parse/access operations to SystemPropertyUtil 2012-09-01 16:49:22 +09:00
Trustin Lee
1369ba55b4 Use class names instead of fields to detect Java version
.. because some use patched JDK with backported fields.
2012-09-01 13:09:24 +09:00
Trustin Lee
b28244772c Remove unused internal classes 2012-09-01 12:59:32 +09:00
Norman Maurer
4759a43c4d Check if loglevel is enabled before log 2012-08-31 21:59:08 +02:00
Norman Maurer
45829ff721 Disable epoll bug workaround by default. It can be enabled via -Dorg.jboss.netty.epollBugWorkaround=true. It will be enabled by default later if it has proven to be stable. See #327 2012-08-31 21:55:14 +02:00
Norman Maurer
db98b9fe29 Port latest fixes for the epoll(..) workaround. See #327 2012-08-31 12:44:42 +02:00
Norman Maurer
e2464a14a4 Handle CancelledKeyException. See #327 2012-08-31 12:44:17 +02:00
Norman Maurer
fee1492c6b Address comments of @trustin and @kimchy. See #327 2012-08-31 11:58:59 +02:00
Norman Maurer
63a234ba12 Correctly detect if the Selector.select(..) unblocks because of a manual wakup or because of a closed channel. See #327 2012-08-31 02:23:31 +02:00
Norman Maurer
883af62c92 Correctly set wakeup.compareAndSet(..) before wakeup the Selector. See #578 2012-08-31 00:36:12 +02:00
Norman Maurer
252b1414bf Correctly convert to nanos. See #565 2012-08-30 07:25:36 +03:00
Norman Maurer
eddca7583e Merge branch '3' into jdk_epoll_bug_workaround
Conflicts:
	src/main/java/org/jboss/netty/channel/socket/nio/SelectorUtil.java
2012-08-29 07:48:59 +02:00
Norman Maurer
49ad538aef Log on warn level if the selector was recreated and remove multiple calls to SelectionKey.cancel() 2012-08-29 07:43:14 +02:00
Norman Maurer
6bd6be0b09 Fix checkstyle and broken method call. Part of #569 and #572 2012-08-28 18:19:31 +02:00
Norman Maurer
0522c4ffc4 Merge pull request #572 from fredericBregier/3
3 - fix for issue  #569
2012-08-28 09:08:22 -07:00
Frédéric Brégier
148fc841ac Second part of fix for issue #569
When moving to take into account arrayOffset, it should have been taken into account also in setReadPosition and other places. Fix it now...
Also fix mismatch algorithm between SeekAheadOptimize and not SeekAheadOptimize (standard) versions.
2012-08-28 16:39:47 +03:00
Frédéric Brégier
a3cedc8b47 First part of fix for issue #569
When moving to take into account arrayOffset, it should have been taken into account also in setReadPosition and other places. Fix it now...
2012-08-28 16:23:35 +03:00
Norman Maurer
dc56905630 Merge pull request #545 from jaens/3-fix-spdy-compress
Do not write compressed SPDY frames out-of-band in another thread
2012-08-28 05:38:58 -07:00
Norman Maurer
e685e535f9 Introduce a new abstract class called OneToOneStrictEncoder which helps to ensure strict ordering. This should be used if that is needed like in the case of ZIP. See ##546 2012-08-28 13:32:38 +02:00
Norman Maurer
dc8ff7e173 Correctly convert to nanos 2012-08-28 13:04:59 +02:00
norman
039c7563cf Cleanup 2012-08-27 11:21:05 +02:00
norman
292a186d16 Add workaround for epoll bug that cause 100% cpu usage also in the NioClientSocketPipelineSink 2012-08-27 11:12:15 +02:00
norman
db1a72c02e Handle ClosedChannelException on re-create of the selector 2012-08-27 11:11:34 +02:00
norman
f8a99a0108 Use nanos to detect the jdk epoll bug. Also use 80% of the select timeout to detect it to be more save. Thanks to @kimchy for spot this 2012-08-27 10:20:40 +02:00
Norman Maurer
798390fc4d Switch to System.nanoTime() to calculate block time of Selector.select(..) 2012-08-26 18:48:50 +02:00
Norman Maurer
8b4f593397 Allow to adjust timeout of Selector.select(timeout) via org.jboss.netty.selectTimeout property. See #568 2012-08-26 09:02:59 +02:00
Norman Maurer
5d07dea3b7 Use Selecor.select() to accept new Sockets to not need to schedule a timeout if not needed anyway. See #567 2012-08-26 08:46:48 +02:00
Norman Maurer
ff3f2b6361 Re-create Selector if we hit the epoll(..) jdk bug which leads to 100% cpu load. This is just a workaround but helps to recover. See #327 2012-08-25 21:51:52 +02:00
Norman Maurer
1a6e7b4be1 Merge pull request #556 from netty/jdk_bug_workaround
Don't rely on the return value fo Selector.select(..) as it is buggy and...
2012-08-25 11:11:05 -07:00
Cruz Julian Bishop
f34eb62104 Remove AbstractChannel.getRandom()
Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-08-25 16:49:38 +10:00
Cruz Julian Bishop
93c990dd7a Generate Channel IDs in a pseudorandom fashion
Requested by @psweeny in #547

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-08-25 13:43:02 +10:00
norman
5c6e3fe6ba Don't rely on the return value fo Selector.select(..) as it is buggy and so can cause 100% cpu usage. See #535 2012-08-24 08:59:39 +02:00
Norman Maurer
14d01f4a8f Move the catch block out of the connect method, which makes more sense as we need to catch it anyway in a more general scope. See See #535 2012-08-23 21:04:34 +02:00
Norman Maurer
85e55eebd8 Add a workaround for the 100% cpu usage that can happen because of an endless loop. See #535 2012-08-23 20:41:22 +02:00
norman
03c4283020 Backport fix for make SslHandler close the connection on SSLException or NotSslRecordException. This needs to get enabled via setter to keep backward compatibility. See #160 2012-08-22 07:46:49 +02:00
Trustin Lee
01ba0ff075 [#160] Revert the fix for #160 for the branch '3'
- Fix will be part of 4.x
2012-08-22 13:44:58 +09:00
Trustin Lee
81305d87b4 [#160] No response to write if server is using SslHandler and client is not
- Make SslHandler close the connection immediately on SSLException or
  or NotSslRecordException
2012-08-22 12:16:40 +09:00
Trustin Lee
31a51b4937 [#239] IdleStateHandler and ReadTimeoutHandler starts two timers
- Ensure initialize does not start timer twice
2012-08-21 20:13:44 +09:00
Jaen Saul
4e351f7399 Do not write compressed SPDY frames out-of-band in another thread 2012-08-20 21:39:28 +03:00
Trustin Lee
a93ada2031 [#539] Potential direct memory leak in HttpContentEn/Decoder 2012-08-20 13:40:58 +09:00
Trustin Lee
bf74b16774 [#539] Potential direct memory leak in HttpContentEn/Decoder 2012-08-20 13:35:12 +09:00
Trustin Lee
88c3fd306b Typo 2012-08-20 12:18:59 +09:00
Trustin Lee
513fc4f78b [#539] Fix potential direct memory leak in HttpContentEn/Decoder 2012-08-20 12:14:38 +09:00
Trustin Lee
ebbcfbc185 Fix test failure 2012-08-20 12:04:16 +09:00
Norman Maurer
f7f0511193 Set maxAge to Integer.MIN_VALUE by default. See #534 2012-08-19 10:53:13 +02:00
Norman Maurer
af672039d7 Allow to set a negative value for maxAge of DefaultCookie. See #533 2012-08-19 10:45:55 +02:00
Trustin Lee
963b7c20ac Merge pull request #496 from CruzBishop/static-fixes
Some static analysis fixes
2012-08-17 00:12:53 -07:00
Trustin Lee
195a7bb953 Use UTF-8 to encode URI - see #521 2012-08-17 11:44:21 +09:00
Trustin Lee
c509a278c3 Rename variables to reduce confusion 2012-08-17 11:33:54 +09:00
James Tyrrell
e5a7fa2c96 [#494] Automatically adding chunked encoding header breaks streaming 2012-08-16 18:23:22 +10:00
Norman Maurer
3f709efcea Merge pull request #522 from jpinner/utf8_encode_uri_3
Fix #521: Encode URI using UTF-8 charset
2012-08-16 00:22:19 -07:00
norman
24f1b54c86 Only cache the localAddress if its a non wildcard address, so its possible to retrieve the 'real' adress later once the channel is fully bound/connected. See #524 2012-08-16 07:38:38 +02:00
Jeff Pinner
4f001f3246 Fix #521: Encode URI using UTF-8 charset 2012-08-15 14:04:30 -07:00
Norman Maurer
b6264c02d9 Make sure that it continue to try to read from the socket even if the SocketTimeoutException was triggered because of the SO_TIMEOUT. See #520 2012-08-15 22:39:40 +02:00
Norman Maurer
d3d5a931d0 Set the SO_TIMEOUT on the underlying Socket so we will be able to run submitted tasks in the IO-Thread even if the read operation would block because of nothing to read. See #520 2012-08-15 22:29:03 +02:00
norman
88124d88ce Remove synchronized blocks to optimize BufferedWriteHandler. See #519 2012-08-15 15:02:53 +02:00
Cruz Julian Bishop
8af95f0897 Fixed a typo in ObjectEchoClientHandler
This fixes #510 in branch 3

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-08-14 19:54:52 +10:00
Norman Maurer
3a3c5de76b Merge branch '3' of github.com:netty/netty into 3 2012-08-12 10:59:04 +02:00
Norman Maurer
6d87b7629e Fix NPE in DefaultChannelPipeline if toString() is called with an empty pipeline. See #505 2012-08-12 10:58:43 +02:00
Cruz Julian Bishop
0aebfb762b Removes unnecessary parentheses for @trustin
Part of #496

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-08-09 19:10:17 +10:00
Cruz Julian Bishop
abc2f87f2f Merge remote-tracking branch 'netty/3' into static-fixes 2012-08-09 19:01:05 +10:00
Trustin Lee
6d5a332667 Fix a buf in CompositeChannelBuffer.setBytes() where -1 is not returned 2012-08-09 17:50:27 +09:00
norman
eb8757f1cb Fix bug which leads to return HttpMessageEncoder implementations null if encoding a HttpChunk which is the last one. This vilates the OneToOneEncoder contract and so leads to a missing notification of the write future. See #493 2012-08-09 08:02:27 +02:00
Cruz Julian Bishop
618ddb42e3 Replaces two manual array copies
This is a potential performance boost, but there shouldn't
be too much of a difference.

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-08-09 09:51:43 +10:00
Cruz Julian Bishop
2f88b9167c Removes a pointless operation ( +0 )
I mean, seriously, this does nothing. At all. :)

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-08-09 09:02:14 +10:00
Cruz Julian Bishop
e685ce36fc Removes pointless bitwise operations
Examples are << 0 and >>> 0

These do nothing at all, and so, should not be there in the first place

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-08-09 08:54:54 +10:00
Cruz Julian Bishop
d206ef6d15 Removes unneeded boxing of integers
This is the first in a number of commits that fixes static
analysis problems

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
2012-08-09 08:48:39 +10:00
norman
e0a88a0f15 Share some more code 2012-08-01 09:00:13 +02:00
norman
9f285d1819 Make sure the ByteBuffer is copied on NioDatagramWorker.read(..). See #485 2012-08-01 08:43:41 +02:00
Norman Maurer
40685a030d Use the right ByteOrder for the ByteBuffer on read(..). See #484 2012-07-31 20:35:50 +02:00
Norman Maurer
95cf6a4a71 Use SocketReceiveBufferAllocator to allocate the ByteBuffer which is used to read from the DatagramChannel. See #483 2012-07-31 20:32:03 +02:00
norman
c28e3c7300 Make the code more compact. See #480 2012-07-30 14:29:50 +02:00
norman
947a12555a Make the code more compact. See #480 2012-07-30 14:28:28 +02:00
norman
f129ee1e28 Use a percentual calculation to see if a new buffer should get allocated. See #480 2012-07-30 14:18:34 +02:00
norman
d772e3cc74 Fix class name, seems like eclipse did not rename it correctly. See #480 2012-07-30 14:04:33 +02:00
norman
d2fa983d32 Rename class to better reflect its usage. See #480 2012-07-30 13:57:33 +02:00
norman
3070247ca7 Optimize ByteBuffer usage for receiving bytes from the channel. See #480 2012-07-30 13:52:56 +02:00
norman
236b0da210 Allow to set Expires attribute to a date in the past. This may break the behavior of old implementations, so it need some notes in the announcement of the version. See #479 2012-07-30 11:13:42 +02:00
norman
5706d6a2ec Mark not used queue impls as @deprecated as these are not needed anymore. See #477 2012-07-30 11:10:00 +02:00
Norman Maurer
26b513236f Replace usage of QueueFactory with ConcurrentLinkedQueue and LinkedBlockingQueue. See #477 2012-07-28 21:35:48 +02:00
norman
5189bb1f3f Don't close the Selector if no keys are registered. See #471 2012-07-24 15:22:19 +02:00
norman
96182f97e8 Fix race-condition which could lead to a NPE or Exception while register a Channel with a Worker. See #469 2012-07-23 11:21:32 +02:00
norman
36acda0be9 Remove System.err.pritnln(..) statements. See #468 2012-07-23 10:19:35 +02:00
Norman Maurer
a76e8a8e36 Merge pull request #468 from fredericBregier/3
Fix issue when SSL is used on top of the Multipart. See #468
2012-07-23 01:18:22 -07:00
Frédéric Brégier
458f983d9d Fix to standard support with no more forceChunk 2012-07-23 11:11:45 +03:00
Frédéric Brégier
666bf1ffe4 Revert SSL issue on Multipart to force Chunk mode if isMultipart is true 2012-07-23 11:07:26 +03:00
norman
055434dbe1 Merge branch '3' of ssh://github.com/netty/netty into 3 2012-07-23 09:25:47 +02:00
norman
54ad935ec5 Fix race-condition which could lead to a NPE or Exception while register a Channel with a Worker. See #469 2012-07-23 09:25:26 +02:00
Trustin Lee
cb2b2830b2 Fix an infinite loop in CompositeChannelBuffer.setBytes()
.. which occurs when a channel is closed during I/O
2012-07-23 15:33:14 +09:00
norman
c059d13108 Fix race-condition which could lead to a NPE while register a Channel with a Worker. See #469 2012-07-23 07:48:03 +02:00
Frédéric Brégier
258f5b00fa Fix for SSL 2012-07-22 19:38:54 +03:00
Frédéric Brégier
b60a9f6532 Fix for SSL example 2012-07-22 19:36:36 +03:00
Frédéric Brégier
2d6dbd5a92 Fix for SSL example 2012-07-22 19:35:18 +03:00
Frédéric Brégier
a78318149e Fix for ssl example 2012-07-22 19:33:58 +03:00
Frédéric Brégier
c370fab6fb Fix issue when SSL is used on top of the Multipat, specially when using Post of a file, since it can change the overall size and therefore giving a real chunk message while it was supposed to not be chunked.
Proposal is to allow the user to force chunk mode.
2012-07-22 16:16:22 +03:00
Norman Maurer
7f0f687965 Merge pull request #467 from fredericBregier/3
Fix decodeAttribute in HttpPostRequestDecoder to take into account exception from bad format from URLDecoder.decode
2012-07-22 04:40:14 -07:00
Frédéric Brégier
0b2c43f04e Fix decodeAttribute in HttpPostRequestDecoder to take into account exception from bad format from URLDecoder.decode 2012-07-22 10:59:26 +03:00
Trustin Lee
4e5041d355 Fix typo in test samples 2012-07-19 20:41:35 +09:00
norman
2b7185f10f Remove unused buggy code 2012-07-18 09:17:15 +02:00
norman
37375708c1 Revert "Use reflection to instance java.util.concurrent.LinkedTransferQueue to make Android not fail. See #458"
This reverts commit 7a87a18c9b.
2012-07-18 09:11:53 +02:00
Norman Maurer
7a87a18c9b Use reflection to instance java.util.concurrent.LinkedTransferQueue to make Android not fail. See #458 2012-07-17 21:09:21 +02:00
norman
6c181af6b9 Make sure CompactObjectInputStream fall back to old behavior so make it compatible with older versions of netty which are used on the other end. See #452 2012-07-13 07:19:46 +02:00
Trustin Lee
629cf073e1 [#453] IndexOutOfBoundsException in HttpPostBodyUtil 2012-07-13 13:07:55 +09:00
Trustin Lee
2f3e0fddf2 [#452] Make ObjectDecoder work with JDK 5 again 2012-07-13 13:04:01 +09:00
Trustin Lee
1843094461 [#452] CompactObjectInputStream fails to resolve interfaces 2012-07-13 13:01:29 +09:00
Norman Maurer
d579a5a38f Fix a bug which lead to a NPE when deserialize interfaces. See #452 2012-07-12 21:14:00 +02:00
norman
c7e276efe0 Check for null values 2012-07-12 07:51:15 +02:00
norman
bd1bc534d8 Add helper method that allows to create a ChannelBuffer out of a hex dump String. See #449 2012-07-11 09:41:31 +02:00
Trustin Lee
ab43b9aa11 Add more constructors to NotSslRecordException 2012-07-11 00:43:42 +09:00
Jeff Pinner
fa4ea1894a Fix for issue #442: SpdyFrameEncoder compressor state race condition 2012-07-10 01:44:17 -07:00
Jeff Pinner
4493e9683f Fix for issue #444: Http compression error 2012-07-09 11:00:46 -07:00
Norman Maurer
f648aae747 Fix ArrayIndexOutOfBoundsException in ReplayDecoderBuffer which could happen when calling getByte(..) or getUnsignedByte(..). See #445 2012-07-08 11:24:26 +02:00
norman
02c0c5b5e9 Revert "Only parse the packet length one time per packet. See #382" as this makes no sense after thinking more about it and just makes it harder to read
This reverts commit 784722eff4.

Conflicts:

	src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
2012-07-06 13:57:55 +02:00
norman
6421bd3885 Fix a race which could lead to have channelDisconnected event not fired. See #440 2012-07-06 07:39:41 +02:00
norman
9ba1878b73 Fix javadoc warnings 2012-07-05 10:47:09 +02:00
norman
b089f0c59b Fix javadoc warnings 2012-07-05 10:42:26 +02:00
norman
e0f139c5d7 Optimize SslHandler's detection of supressable exceptions, so it will not break on different OS's or jdk impls. See #79 2012-07-05 09:32:34 +02:00
norman
3385f85f5c Remove unused import 2012-07-04 14:28:08 +02:00
norman
243f1bb7ee Add testcsae for #433. Thanks 2012-07-04 14:21:39 +02:00
norman
d464e86733 Fix a bug where HttpChunk.isLast() return true if the connection was closed and nothing was left in the internal buffer but the received content was not complete. See#433 2012-07-04 09:44:01 +02:00
norman
9a1344c3ae Throw a special SSLException if a non SSL/TLS record was detected. See #437 2012-07-04 08:26:18 +02:00
norman
18fb438949 Correctly format cookies. This fix some bug which lead to expiring of cookies to not work. See #426 2012-07-04 07:40:39 +02:00
norman
f499348267 Fix checkstyle 2012-07-04 07:39:07 +02:00
Frederic Bregier
1936df2e4d fix example (cookie) 2012-07-03 20:44:55 +02:00
Frederic Bregier
f74a96ca20 Fix for issue #434 to provide the ability to stop even if no CRLF is
provided since some clients as Adobe Flash will not finish the closing
delimiter with a CRLF.
2012-07-03 15:02:40 +02:00
norman
f16c7472de change default from 1000 -> 1024 2012-07-03 10:40:49 +02:00
norman
b0742950b9 Fix misleading comment 2012-07-03 08:39:35 +02:00
norman
d8880efe61 Use 1000 as default value for the max composite buffer components. This safe a lot of byte copies. See #413 2012-07-03 08:36:59 +02:00
norman
91d5c9a0a6 Use 1000 as default value for the max composite buffer components. This safe a lot of byte copies and so speed up every decoder that extends FrameDecoder. See #435 2012-07-03 08:32:06 +02:00
Norman Maurer
bf23828734 Minimize byte copies by using a CompositeChannelBuffer to concat the chunks. See #413 2012-07-01 14:52:58 +02:00
Norman Maurer
a746b5d3fe Use FrameDecoder.setMaxCumulationBufferComponents(Integer.MAX_VALUE) for Decoders that needs to handle big frames. See #424 2012-06-29 13:42:43 +02:00
Norman Maurer
28a1992bf4 Add getters for the specified timeout values. See #418 2012-06-29 13:38:51 +02:00
Norman Maurer
70bfaf4454 Fix checkstyle 2012-06-29 13:38:20 +02:00
Norman Maurer
e53be94773 Make sure the readerIndex is updated after the ChannelBuffer was sliced out. See #412 2012-06-29 13:10:27 +02:00
Norman Maurer
076a6a9239 Backport getBuffer(..) method in CompositeChannelBuffer. See #414 and #415 2012-06-29 13:04:15 +02:00
Jaen Saul
e9212afef9 Fix SpdyHttpHeaders.setScheme setting the wrong header 2012-06-28 13:45:56 +03:00
Norman Maurer
83148869aa Slice the buffer if possible to reduce memory copies when reading the content. See #412 2012-06-28 09:24:32 +02:00
Trustin Lee
215180511d Add more cookie decoding test case 2012-06-27 12:41:16 +09:00
Trustin Lee
fe6b71c1f0 Deque from the acceptEncodingQueue even if it's not gonna be encoded 2012-06-27 10:27:43 +09:00
Trustin Lee
59a1095c23 Add FrameDecoder.maxCumulationBufferComponents 2012-06-25 11:25:40 +09:00
Trustin Lee
8650cfbc53 Fix #263 No way to pass unfold=true to decoder superclass
- Allow modifying unfold property until the decoder is added to a
  pipeline
2012-06-24 22:19:17 +09:00
Trustin Lee
1311a2edc1 Simplify FrameDecoder and ReplayingDecoder 2012-06-24 22:12:08 +09:00
Trustin Lee
7f21daed77 Merge pull request #390 from gbehrmann/feature/zerocopyframedecoder
ZeroCopyFrameDecoder to avoid excessive buffer copies in FrameDecoder when using large frames
2012-06-24 03:14:05 -07:00
Trustin Lee
76db244fed Fix #406: HttpContentCompressor compresses compressed content
- Do not compress if the content encoding is not identity
2012-06-24 19:01:20 +09:00
Trustin Lee
b2d8813bf3 Fix #218: CookieDecoder.decode() throws StackOverflowError
- Rewrote key-value decoder not using a regular expression
2012-06-24 19:01:20 +09:00
Norman Maurer
2721d1e9c7 Remove misleading comment 2012-06-24 10:17:23 +02:00
Trustin Lee
e3a8805259 Fix #397: Allow all cookie names that conform to the RFC
- lenient flag is not needed anymore
2012-06-24 14:16:03 +09:00
Trustin Lee
9ae847c33a Fix test failures 2012-06-24 13:41:54 +09:00
Trustin Lee
3fc7730b2c Fix #403 - Contradictory JavaDoc in setWriteBufferHighWaterMark 2012-06-24 13:04:20 +09:00
Trustin Lee
fa886dbc80 Fix #405: CookieEncoder should refuse to encode more than one cookie
.. if on server mode
2012-06-24 12:58:33 +09:00
Gerd Behrmann
e329cc3524 ZeroCopyFrameDecoder: Optimize cumulation buffer compaction
Avoid calling CompositeChannelBuffer.decompose. A more efficient
frame deocder specific implementation is used that avoids some
of the cost of decomposing a CompositeChannelBuffer.

Added setMaxUnusedBufferCapacity to set a threshold. If a
cumulation buffer wastes more space than the threshold, the
decoder will resort to copying the buffer to free up the unused
space. The semantics are different from FrameDecoder's
setMaxCumulationBufferCapacity in that the threshold is for
unused space, not buffer capacity. This allows the copy of
large buffers to be avoided if only a small amount of space
is to be gained.

If a copy is invoked, only the actual fragment is copied, not
the complete cummulation buffer. This reduces the cost of
copying the buffer.
2012-06-19 22:41:47 +02:00
Gerd Behrmann
0086eb3e1d ZeroCopyFrameDecoder: Follow checkstyle rules 2012-06-19 22:38:39 +02:00
Gerd Behrmann
a3f46b5359 Merge remote-tracking branch 'upstream/3' into feature/zerocopyframedecoder 2012-06-19 19:10:42 +02:00
Trustin Lee
7aceb7ae8e Rename NativeZlibEncoder to JdkZlibEncoder 2012-06-19 09:55:41 +09:00
Jeff Pinner
db181f1120 Use java.util.zip in HttpContentCompressor if possible 2012-06-18 11:39:25 -07:00
Frédéric Brégier
bab98ab969 Damn ! Fix typo and type needed for fix #399 for issue #398 2012-06-15 20:40:44 +03:00
Frédéric Brégier
1f696fa2f1 Change back to FileChannel but by block 2012-06-15 11:04:22 +03:00
Frédéric Brégier
7c34781672 Proposal to fix issue #398 by replacing FileChannel.transferTo by manual loop to prevent usage of mmap unde the wood by the JVM, while the optimization will be less efficient. 2012-06-15 09:14:37 +03:00
norman
df11cfab25 Introduce a FrameDecoder.setMaxCumulationBufferCapacity(..) setter which allows to configure how bug the capacity of the cumulation buffer can be before the FrameDecoder tries to optimize memory usage with byte copies. Related to #390
This allows the users to set a threshold that matches best their needs. Use Integer.MAX_VALUE to disable copies at all at the cost of bigger memory usage.
2012-06-13 11:22:37 +02:00
norman
cb8fc7af4a Use a different ThreadLocal for ChannelExecutionEvents to prevent false-positives on deadlock detection. See #387 2012-06-13 08:07:43 +02:00
Trustin Lee
fed2f640ee serverID -> serverId (#393 Ensure all fields follow naming convention) 2012-06-12 21:20:36 +09:00
Trustin Lee
c3e70186f8 StreamID -> StreamId (#393 Ensure all fields follow naming convention) 2012-06-12 20:57:34 +09:00
Trustin Lee
95d8e782e3 ID -> Id (#393 Ensure all fields follow our naming convention) 2012-06-12 20:31:45 +09:00
Trustin Lee
178d24a16d Do not use the deprecated methods (#393) 2012-06-12 20:27:14 +09:00
Trustin Lee
9464396719 ID -> Id (#393 Ensure all fields follow our naming convention) 2012-06-12 20:24:51 +09:00
Trustin Lee
d159a43a49 ID -> Id (#393 Ensure all fields follow our naming convention) 2012-06-12 20:19:52 +09:00
Trustin Lee
a6f5af6116 Remove 'public' modifier which is unnecessary 2012-06-12 20:07:47 +09:00
Trustin Lee
65111fce1d getPersist(ed) -> isPersist(ed) (#393) 2012-06-12 20:05:27 +09:00