Commit Graph

3584 Commits

Author SHA1 Message Date
Joakim Erdfelt 1984d2de11
Issue #7277 - Allow `Request.getLocalName()` and `.getLocalPort()` to be overridden (#7357)
* Issue #7277 - Allow `Request.getLocalName()` and `.getLocalPort()` to be overridden (#7316)

* Introduce `HttpConfiguration.setServerAuthority(HostPort)`
  to influence `ServletRequest.getServerName()` and `ServletRequest.getServerPort()`
* Introduce `HttpConfiguration.setLocalAddress(SocketAddress)`
  to influence `ServletRequest.getLocalName()`, `ServletRequest.getLocalPort()`, and `ServletRequest.getLocalAddr()`
* Correcting Request URI logic on abs-uri without authority
* Adding test cases

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-01-06 08:01:08 -06:00
dependabot[bot] 6de526e808
Bump maven-scm-provider-jgit from 1.10.0 to 1.12.2 (#7347)
Bumps maven-scm-provider-jgit from 1.10.0 to 1.12.2.

---
updated-dependencies:
- dependency-name: org.apache.maven.scm:maven-scm-provider-jgit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 10:11:34 -06:00
Simone Bordet 3d6578deee Issue #6728 - QUIC and HTTP/3
Updates after merge of #7100.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00
Simone Bordet 4eaff8e880 Issue #6728 - QUIC and HTTP/3
- Moved ExecutionStrategy from ServerQuicConnection to QuicConnection.
  For the server the produced task is declared as BLOCKING, but for the
  client the produced task is NON_BLOCKING.
- Fixed race condition in QuicSession.process(...).
- Updated quic-quiche pom.xml.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00
Simone Bordet a803dfa44f Issue #6728 - QUIC and HTTP/3
- Improved configuration of client and server.
- Started implementation of HttpClientTransportOverHTTP3.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00
Ludovic Orban 4c66c02176 WIP: implementation of server's upper layers input and output
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Simone Bordet 43551487ee Issue #6728 - QUIC and HTTP/3
- Implemented data support.
- Implemented trailer support.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00
Joakim Erdfelt c7cec39ff5
Issue #7063 - Remove logging requirement from Password / Credential (#7227)
* Issue #7063 - Remove logging requirement from Password / Credential

+ Adding testcase for Password command line
+ Moved hex/string methods from TypeUtil to StringUtil
   so that they can be reused in non-logging applications.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2021-12-16 07:05:30 -06:00
Ludovic Orban 4068901c14 #7243 ByteBufferPool and RetainableByteBufferPool now reset the buffer's endianness on release
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-09 12:44:12 +01:00
Simone Bordet b2203115e2
Fixes #7240 - Clarify and javadoc InvocationType. (#7241)
* Fixes #7240 - Clarify and javadoc InvocationType.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-09 09:29:11 +01:00
Jan Bartel 2165b74b91
Issue #6327 Re-enable and rename ContainerLifeCycleListenerTest (#7147) 2021-12-06 10:39:29 +11:00
Simone Bordet cb25a83667
Issue #6728 - Prepare for QUIC and HTTP/3 (#7100)
* Issue #6728 - QUIC and HTTP/3

Modifications to Jetty to prepare for QUIC/HTTP3.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-01 09:39:51 +01:00
Lachlan Roberts 63069ad28a Issue #7124 - deprecate AbstractLifeCycleListener
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-11-25 10:01:52 +11:00
Olivier Lamy e279e2f449
use jgit to avoid issue on machine with git not in the path (#7142)
Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>
2021-11-24 16:27:20 +10:00
Joakim Erdfelt cd1f146867
Issue #7131 - use Charset object instead of String (#7137)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2021-11-19 16:17:28 -06:00
Joakim Erdfelt 7321d54915
Close Resources opened from java.nio.file.Files API calls (#7048) (#7050)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2021-10-27 05:53:10 -05:00
Joakim Erdfelt cfc67f86d2 Updating to version 10.0.8-SNAPSHOT 2021-10-06 14:51:32 -05:00
Joakim Erdfelt da8a4553af Updating to version 10.0.7 2021-10-06 14:32:37 -05:00
Simone Bordet 0412bdc3d9 Fixes #6938 - module-info.java file do not use the canonical order for the elements
Changed order of entries in module-info.java to be canonical

(cherry picked from commit 02691171d5)
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-10-01 09:25:55 +02:00
Greg Wilkins d9d8919e9a
Fix #6870 Encode control characters (#6874) (#6895)
Fix #6870 URIUtil.encodePath encodes control characters

* Better test for wider range of characters
* Encode all control characters

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2021-09-23 15:37:35 +10:00
Greg Wilkins 9a14de058d
Fix #6860 IPv6 Format (#6861) (#6885)
Fix #6860 IPv6 format by adding an extensible HttpChannel method

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
2021-09-22 21:03:23 +10:00
Simone Bordet e2690cc420
Fixes #6603 - HTTP/2 max local stream count exceeded (#6639) (#6682)
* Fixes #6603 - HTTP/2 max local stream count exceeded (#6639)

Made MAX_CONCURRENT_STREAMS setting work on a per-connection basis.
Updated Pool javadocs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
(cherry picked from commit 525fcb3119)
2021-09-01 10:27:40 +02:00
Lachlan Roberts 7569e4b07a Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-10.0.x-6566-WebSocketMessageSinks 2021-08-27 17:21:53 +10:00
Joakim Erdfelt c5a33e27d2
Issue #5684 - Windows test overhaul (#6581)
Issue #5684 - Window's test overhaul

+ Migrate from @DisabledOnOs(WINDOWS) to assumptions on capabilities instead.
+ Fix other outstanding windows testing issues.
+ Cleanup FileBufferedResponseHandlerTest expectations on Windows.
+ PathWatcher scan interval is variable on windows
+ If unable to start testcase based on assumption,
  the stop shouldn't fail testcase
+ Increase various wait timeouts
+ Make tests less strict due to system speed issues
+ Disable Sni tests due to TLS behaviors differences in Windows
  + Windows TLSv1.3 seems to introduce this difference
  + If we restrict to TLSv1.2 this passes.
  + On Linux TLSv.13 on client side will always return a
  + javax.net.ssl.SSLHandshakeException in those test cases that expect it.
  + However, on Windows, Only the TLSv1.2 implementation will return a javax.net.ssl.SSLHandshakeException,
  + All other TLS versions on Windows will result in a
  + javax.net.ssl.SSLException: Software caused connection abort: recv failed
+ Disable ConcurrentStreamCreationTest
  + Not possible to create all of these streams.
+ Fixing DeploymentTempDirTest
  + Using unique workdir per testcase.
  + Don't expect to delete files / directories between tests
    (not supported on windows due to file locking anyway)
 + Fixing line ending difference on windows
 + InvalidPathException is a 404 Not Found
 + Cannot reuse test directory between runs due to memory mapped files that are still in use from previous run.
 + java.nio.file.FileSystemException: C:\code\jetty.project\jetty-webapp\target\tests\welcome#\index.html: The requested operation cannot be performed on a file with a user-mapped section open.

	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:235)
	at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
	at java.base/java.nio.file.Files.newOutputStream(Files.java:220)
	at org.eclipse.jetty.webapp/org.eclipse.jetty.webapp.WebAppDefaultServletTest.prepareServer(WebAppDefaultServletTest.java:84)

 + As is typical on windows, we are often unable to delete a file due to file locking issues.
 + Use a unique resource base between tests.
   This is to avoid file locking behaviors that prevent the
   resource base from being reused too quickly on windows.
 + Prevent test run if symlinks not supported
 + Allowing for Windows slosh char as well in asserts
 + SelectorUtils is File.separator dependent
 + Regex is now FS.separator independent
 + Using SelectorUtils from plexus correctly for include/exclude
 + Turning off mapped files for testing reasons.
 + Fix and re-enable RFC2616NIOHttpsTest
 + Issue #6552 - Fix test failures due to slf4j dep
 + Issue #6552 - upgrade testcontainers
 + Issue #6552 - move to assumption based docker existence
 + Issue #6552 - Fix enforcer rule violation on jna.
  Addresses the following side effect of upgrading testcontainers.

[WARNING] Rule 3: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for net.java.dev.jna:jna:5.6.0 paths to dependency are:
+-org.eclipse.jetty:infinispan-remote-query:10.0.7-SNAPSHOT
  +-org.testcontainers:testcontainers:1.16.0
    +-com.github.docker-java:docker-java-transport-zerodep:3.2.11
      +-net.java.dev.jna:jna:5.6.0 (managed) <-- net.java.dev.jna:jna:5.8.0

 + use annotation to disable test when docker not available and needed
 + Disabling FileSessionDistributionTests.stopRestartWebappTestSessionContentSaved on Windows
 + Using TLS basic
 + Programmatic removal of memory mapped behavior during testing
 + Fixing slf4j warning

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Olivier Lamy <oliver.lamy@gmail.com>
2021-08-26 11:26:46 -05:00
Lachlan Roberts 83f2265653 Issue #6642 - never shutdown output after generating a request.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-08-26 14:18:28 +10:00
Simone Bordet 2689cf75d1
Fixes #6646 - Propagate callback invocation type to avoid deadlock in SmallThreadPoolLoadTest
Fixed occurrences of Callbacks that did not override getInvocationType() to properly declare whether they block or not.

Added test case for blocking writes for both client and server.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
(cherry picked from commit 9897c1b06e)
2021-08-26 09:28:33 +10:00
Simone Bordet e8beb58baf Fixes #6652 - Improve ReservedThreadExecutor dump. (#6653)
Fixes #6652 - Improve ReservedThreadExecutor dump.

Filtering out non-reserved threads in dump() and doStop().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
(cherry picked from commit b2a023675c)
2021-08-25 10:18:04 +02:00
Simone Bordet 9f896c6390 Fixes #6624 - Non-domain SNI on java17
Java 17 only allows letter|digit|hyphen characters for SNI names.

While we could bypass this restriction on the client, when the SNI bytes arrive to the server they will be verified and if not allowed the TLS handshake will fail.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
(cherry picked from commit 693663a4ce)
2021-08-19 13:56:29 +02:00
Lachlan Roberts 38a2d04d67 Add from(Callback) utility method in Callback.Completable
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-08-18 10:58:54 +10:00
Greg Wilkins a5b1845e60
Disable ipv6 test for #6624 (#6625) (#6629)
Temp disable of test that is breaking the build.
2021-08-17 16:15:00 +10:00
Ludovic Orban 7867d51c91 #6327 replace Await helper with awaitility
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-08-12 10:47:24 +02:00
Jan Bartel 90a72b0798
Issue #6556 Ensure context classloader set when operating on memcache. (#6557)
* Issue #6556 Ensure context classloader set when operating on memcache.

Signed-off-by: Jan Bartel <janb@webtide.com>
2021-08-02 10:04:51 +10:00
Greg Wilkins 6201d3b107
Non blocking ReservedThreadExecutor (#6535) (#6559)
A call to offer must never block, nor even yield, since to do so give an opportunity for the allocated CPU core to change, defeating the whole purpose of the class.
There is also some reasonable level of diagnostic warnings if a reserved thread misses too many offers consecutively, based on tracking the state of the reserved thread.

Remove the stack data structure entirely.  ReservedThreads all poll the same SynchronousQueue and tryExecute does a non blocking offer.

Added test for busy shrinking

Remember last time we hit zero reserved threads

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2021-07-30 09:08:36 +10:00
Ludovic Orban d8a890f71e #6541 improve testConcurrentAccess perf
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-07-29 11:11:54 +02:00
Ludovic Orban 9e047ab412 #6541 improve testTake perf
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-07-29 11:11:54 +02:00
Joakim Erdfelt fdc210f382
Remove unused imports
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2021-07-27 08:03:00 -05:00
Joakim Erdfelt 92b6f336b6
Merge pull request #6503 from eclipse/release-10.0.6
Merge Release 10.0.6
2021-07-07 08:21:20 -05:00
Greg Wilkins 8945a58ffc
Reduce header cache memory usage on non persistent requests (#6494)
Delay creating a header cache until a second request on a parser.
Refactored cache code into subclass

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2021-07-07 12:51:06 +10:00
Joakim Erdfelt c245a70893 Updating to version 10.0.7-SNAPSHOT 2021-06-29 10:51:22 -05:00
Joakim Erdfelt 37e7731b4b Updating to version 10.0.6 2021-06-29 10:27:56 -05:00
Lachlan 3c32afa05c
Issue #6473 - canonicalPath refactor & fix alias check in PathResource (Jetty-10) (#6478)
Issue #6473 - canonicalPath refactor & fix alias check in PathResource

* Reverted %-escape handling for URI query parts.
* Performing canonicalization in ServletContext.getResource(),
  and improving alias checking in ContextHandler.getResource().
* Performing canonicalization checks in Resource.addPath() to avoid
  navigation above of the root.
* Test added and fixed.
* Various cleanups.
* Improved javadoc and comments
* Compliance mode HttpURI uses UriCompliance.Violation

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
2021-06-29 15:42:39 +02:00
Lachlan d233f3be02
Issue #6447 - Deprecate support for UTF16 encoding in URIs (#6457)
Deprecate support for UTF16 encoding in URIs.
Add compliance mode to allow UTF16 encodings.
Improve testing.
2021-06-23 22:58:49 +10:00
Simone Bordet b8d6e3f010
Fixes #6410 - Use SocketAddress instead of InetSocketAddress. (#6414)
* Fixes #6410 - Use SocketAddress instead of InetSocketAddress.

Removed usages of InetSocketAddress in method signatures where possible.
Deprecated old methods, and added new methods with SocketAddress.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-06-17 10:18:08 +02:00
Greg Wilkins a415606e01
Rename EWYK The AdaptiveExecutionStrategy (#6353)
Rename EWYK to AdaptiveExecutionStrategy, which better represents the nature of the strategy.

Updated the documentation 
Refactored substrategy selection for code clarity.
Added notes about chaining strategies and thread starvation

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2021-06-16 17:22:08 +10:00
Joakim Erdfelt 9d2d1e29b7 Updating to version 10.0.6-SNAPSHOT 2021-06-11 09:42:42 -05:00
Joakim Erdfelt dc21b2d73c Updating to version 10.0.5 2021-06-11 09:18:00 -05:00
Jan Bartel 900c71902c
Issue #6327 Remove DisabledOnJre or test where appropriate (#6386)
Signed-off-by: Jan Bartel <janb@webtide.com>
2021-06-10 21:26:16 +10:00
Joakim Erdfelt 987066aac1 Updating to version 10.0.5-SNAPSHOT 2021-06-04 13:28:47 -05:00
Joakim Erdfelt 5523480c54 Updating to version 10.0.4 2021-06-04 13:09:44 -05:00
Greg Wilkins e3faf81860
Fix #6114 Deploy symlink webapps (#6317)
* Fix #6114 Deploy symlink webapps

Use Path.toRealPath rather than getCanonicalPath in the Scanner
Make following symlinks configurable

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2021-06-04 15:10:54 +02:00