Commit Graph

1700 Commits

Author SHA1 Message Date
Olivier Lamy 9b7afd8a03
Happy new year!! (#3232)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-01-01 11:52:16 +10:00
Greg Wilkins 89e1dd033a
Jetty 9.4.x 3117 retainable byte buffer (#3118)
* Move RetainableByteBuffer to jetty-io=
use RetainableByteBuffer
use RetainableByteBuffer - changes from review.
Reviewed and applied small changes.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-11-22 11:31:05 +01:00
Simone Bordet 910665a55a Fixes #3133 - Logging of key.readyOps() can throw unchecked CancelledKeyException.
Introduced safeInterestOps() and safeReadyOps() to catch exceptions
they may throw and using them in relevant places to fix the issue.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-11-21 17:37:37 +01:00
Greg Wilkins 8c4ee8496f
Jetty 9.4.x 3038 ssl connection leak (#3121)
Issue #3038 - SSL connection leak.

Fixed SSL spin caused when fill had NEED_WRAP, but a flush/wrap
produced 0 bytes and stayed in NEED_WRAP

Removed check of isInputShutdown prior to filling that allowed EOF to
overtake data already read.

Fix for leak by shutting down output in HttpConnection if
filled -1 and the HttpChannelState was no longer processing
current request.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-11-20 13:53:42 +01:00
Joakim Erdfelt 29fd18e046 Updating to version 9.4.15-SNAPSHOT 2018-11-14 16:42:40 -06:00
Joakim Erdfelt c4550056e7 Updating to version 9.4.14.v20181114 2018-11-14 15:19:10 -06:00
Joakim Erdfelt a903017f5f Updating to version 9.4.14-SNAPSHOT 2018-11-11 21:06:50 -06:00
Joakim Erdfelt 49123a3313 Updating to version 9.4.13.v20181111 2018-11-11 20:02:42 -06:00
Simone Bordet f814354bb5 Issue #3085 - Restore Dump methods for backwards compatibility reasons.
Restored removed methods to maintain backwards compatibility.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-11-09 17:47:46 +01:00
Greg Wilkins d455ac6aca Issue #3060 WriteFlusher fails callback on all Throwables
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-11-06 09:29:43 +01:00
Greg Wilkins 4a9265d4b4 backports from 10.0.x websocket refactor
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-11-03 17:53:32 +01:00
Greg Wilkins 15e1c73f9c
Cleanup the dump implementation (#2998)
* Cleanup the dump implementation
* improved the clarity of utility methods for dump and updated most dump methods
* fixed upgrade filter dump
* Improved dump after review
* Moved dumpObjects to Dumpable
* implemented dumpBeans with dumpObjects
* less verbose dump
* Dump streams
* fixed dump test

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-10-22 11:53:59 +11:00
Greg Wilkins 319766a70c Merge remote-tracking branch 'origin/jetty-9.3.x' into jetty-9.4.x 2018-10-05 18:56:49 +10:00
Greg Wilkins 166eeaa1f6
Jetty 9.3.x #2954 report cause (#2959)
Issue #2954 Report badmessage cause

Pass BadMessageException from parser to HttpReceiverOVerHTTP

This change has already mostly been made in 9.4, so essentially this is a back port.  However the
primary signature of HttpParser.Handler for badMessage has not been changed and a default method
used to handle the cause. This avoids breaking any usages of the interface.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-10-05 18:36:35 +10:00
Joakim Erdfelt a3f1592c50 Issue #2431 - Upgrade to Junit 5 (#2436)
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug https://github.com/junit-team/junit5/issues/801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@Before      | @BeforeEach
@After       | @AfterEach
@BeforeClass | @BeforeAll
@AfterClass  | @AfterAll

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2018-09-05 10:07:17 +10:00
Jesse McConnell 863a19bccf
Updating to version 9.3.26-SNAPSHOT 2018-09-04 17:23:31 -05:00
Jesse McConnell 3ce520221d
Updating to version 9.3.25.v20180904 2018-09-04 16:08:21 -05:00
Jesse McConnell dcf6a8fa9f
Updating to version 9.4.13-SNAPSHOT 2018-08-30 10:48:22 -05:00
Jesse McConnell 2720868475
Updating to version 9.4.12.v20180830 2018-08-30 08:56:44 -05:00
Simone Bordet 7cf027b98f Jetty 9.4.x 2711 tls 13 compliance (#2857)
Issue #2711 - TLS 1.3 compliance.

Disabled few tests that are TLS 1.2 specific.
Renegotiation in SslConnection is now skipped for TLS 1.3.
Replaced SNI keystore DSA certificate with RSA certificate.
First full build achieved with JDK 11+28.
Small changes after review.
Modified the test case to pass in JDK 8, where the implementation
throws SSLException, while in later JDKs throws SSLHandshakeException.
Minor cleanup

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-08-28 21:43:45 +10:00
Simone Bordet c5aa15bdd4 Merged branch 'jetty-9.4.x-2836-ssl_cannot_reuse_connection' into 'jetty-9.4.x'. 2018-08-22 16:17:28 +02:00
Simone Bordet 1a7eac5966 Fixes #2847 - Wrap Connection.Listener invocations in try/catch.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-08-22 16:11:20 +02:00
Greg Wilkins 0e2daba7a2 minor cleanup
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-08-22 18:08:33 +10:00
Greg Wilkins 38735f8457 ensure fill is always called if needed by flush
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-08-21 12:02:52 +10:00
Simone Bordet bc78778f02 Issue #2836 - Sequential HTTPS requests may not reuse the same connection.
WIP.
Tentative fix to avoid that onFillable() is called after the exchange
is completed.
Now DecryptedEndPoint.fillInterest.fillable() is called before other
methods that may advance the exchange processing.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-08-20 23:01:43 +02:00
Simone Bordet ddd80deeb9 Improved logging and exception handling.
Now IllegalStateExceptions are thrown with a message.
Methods needsFillInterest() and onIncompleteFlush() are now wrapped in
try/catch to make sure the connection is closed in case of exceptions.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-08-17 15:39:47 +02:00
Simone Bordet 13792a65d2 Improved logging after unwrap().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-08-16 20:49:07 +02:00
Kazuhiro Sera 96218e8bc4 Fix typos detected by github.com/client9/misspell
Signed-off-by: Kazuhiro Sera <seratch@gmail.com>
2018-08-10 23:52:16 +09:00
Simone Bordet 8eb11a56c8 Merged branch 'jetty-9.3.x' into 'jetty-9.4.x'. 2018-08-06 15:00:16 +02:00
Simone Bordet 289dc935f1 Merged branch 'jetty-9.2.x' into 'jetty-9.3.x'. 2018-08-06 12:55:09 +02:00
Simone Bordet da9c5fcae2 Fixes #2777 - Workaround for Conscrypt's ssl == null.
Isolated SSLEngine method calls and wrapped them into try/catch
blocks to ignore the NullPointerException thrown by Conscrypt.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-08-06 12:41:44 +02:00
Simone Bordet b561ee2734 Issue #2755 - ManagedSelector 100% CPU spin.
Now checking for thread interrupted only when select() reports 0 selected.
This will avoid the check in case of legit I/O wakeups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-08-02 13:13:54 +02:00
Simone Bordet 0a336230ef Issue #2755 - ManagedSelector 100% CPU spin.
Avoid race between doStart() and doStop() by waiting in doStart()
for _started=true.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-08-01 17:25:46 +02:00
Simone Bordet a090741a60 Issue #2755 - ManagedSelector 100% CPU spin.
Added check for thread interrupted.
If interrupted and ManagedSelector is not running, bail out.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-08-01 16:57:08 +02:00
Simone Bordet eceaff7bed Merged branch 'jetty-9.3.x' into 'jetty-9.4.x'. 2018-07-18 16:21:00 +02:00
Simone Bordet 37e4da24cb Merged branch 'jetty-9.2.x' into 'jetty-9.3.x'. 2018-07-18 16:15:27 +02:00
Greg Wilkins 17b6eee5ac
Jetty 9.4.x 2233 ssl flush try again 2 (#2726)
Major refactor of SslConnection to address #2233 and to simplify in preparation for java-11 support.

Made the `needFillInterest` and `onIncompleteFlush` methods the primary stateful methods with state for fill and flush side that does not reproduce state already held by the SslEngine itself.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-07-18 10:11:35 +02:00
Joakim Erdfelt 0b69f00665 Updating to version 9.4.12-SNAPSHOT 2018-07-11 17:32:16 -05:00
Joakim Erdfelt 260596dd10 Updating to version 9.4.12.RC0 2018-07-11 16:30:55 -05:00
Simone Bordet a557a84447 Fixes #2530 - Client waits forever for cancelled uploads.
Reworked implementation after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-07-10 11:34:56 +02:00
Simone Bordet 6553957278 Fixes #2530 - Client waits forever for cancelled uploads.
Added comment after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-07-09 17:26:05 +02:00
Simone Bordet 0c8b33e581 Fixes #2530 - Client waits forever for cancelled uploads.
After discussion on openjdk/nio-dev, we now wakeup the selector
after closing a socket, so that the SelectionKey can be removed
from the Selector and the TCP stack notified that the socket
has been really closed, so that it can send RST to clients.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-07-09 10:02:45 +02:00
Greg Wilkins 4f54447585
Jetty 9.4.x 2501 accept listener (#2511)
* Issue #2501 - Accept Listener
* Issue #2501 - Include accepting connections in connection limit.
* AcceptRateLimit minimal delay

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-06-19 09:03:54 +02:00
Simone Bordet 253c637742
Fixes #2663 - Guard Throwable.addSuppressed() calls. (#2665)
* Fixes #2663 - Guard Throwable.addSuppressed() calls.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-06-14 15:21:44 +02:00
Simone Bordet 4f1dd352d6
Issue #2468 - Remove SoLinger. (#2644)
* Issue #2468 - Remove SoLinger.

For non-blocking sockets, StandardSocketOptions#SO_LINGER javadocs
report that the behavior is undefined. In JDK 11 setting SoLinger
for non-blocking sockets will be ignored.

As such, there is no point in allowing SoLinger to be configured
in Jetty that only uses non-blocking sockets.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-06-09 13:21:24 +02:00
Greg Wilkins 482e207392
Merge pull request #2636 from lachlan-roberts/jetty-9.4.x-2592-WriteFlusher-Cleanup
Issue #2592 - WriteFlusher Cleanup
2018-06-09 09:56:04 +02:00
Lachlan Roberts da58c20d90 Issue #2592 - Rework of WriteFlusher
changes from review

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-06-09 10:24:43 +10:00
Joakim Erdfelt 3932b11e64 Merge remote-tracking branch 'origin/release-9.4.11' into jetty-9.4.x 2018-06-07 14:31:24 -05:00
Lachlan Roberts f2893fdd0b Issue #2592 - Rework of WriteFlusher
WriteFlusher.write() now requires the callback it is given is not null

the FAILED state of WriteFlusher is now a terminal state
any failure will now result in the callback being failed and a transition to the FAILED state

the WriteFlusher documentation and WriteFlusherTests have also been altered to reflect these changes

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-06-07 22:02:44 +10:00
Joakim Erdfelt df29e292af Issue #2135 - Correct testHelloWorld failure by backporting test from 9.4.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2018-06-06 14:24:53 -05:00