Fixes#6043 - Reimplement UnixSocket support based on Java 16.
* Introduced new module "jetty-server-unixdomain".
It uses reflection to access the Java 16 Unix-Domain classes to keep compatibility with the other modules and the build.
* Added Jetty module with only HTTP/1.1 support for now (requires review of the modules to reuse them with various connectors).
* Updated documentation to mention UnixDomainServerConnector.
* Updated client libraries to support Unix-Domain.
* Updated PROXY protocol implementation to support Unix-Domain.
* Replaced unix.socket.tmp with better named jetty.unixdomain.dir property.
Defaulted jetty.unixdomain.dir property to system property user.home under Windows.
Simplified code that runs Unix-Domain tests.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* use bom for junit and testcontainer dependencies
Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>
* remove some duplicate and redundant dependencies declaration as we now have the bom
Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>
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>
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>
Fixed logic in HttpDestination.RequestTimeouts, where now a timeout
is scheduled only when the expiration time is less than the existing one.
Various code cleanups.
Renamed HttpDestination.TimeoutTask to RequestTimeouts for clarity.
Improved javadocs, code comments and logging.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
(cherry picked from commit 5f23689aa7)
(cherry picked from commit da50e06b64)
(cherry picked from commit 88ac10439a)
* Fixes#6049 - Default provider [files] section always executed
Keeping only enabled modules when processing the modules,
so that default provider modules don't get processed.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Moved recording of bytes to fillRequestBuffer(),
so they are accounted also for async reads.
Added test case.
Fixed test that was too strictly comparing HttpConnection.bytesIn,
that now report a correct, but larger value.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
(cherry picked from commit aed20abcbe)
Decoration should not be delayed until onOpen it should be during the call to
the WebSocketUpgradeFilter or WebSocketServlet.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Added `before` section to a module to control ordering
rename `options` section to `after`
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Fixed mistakes in logging-jul-capture.mod.
Introduced java-util-logging-bridge.properties for the bridge module configuration.
Added [exec] sections to specify the jul config file.
Removed logging-jul-capture.xml, not necessary.
Added tests to verify that the fixed modules work fine.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
refactored the complete method to consider unrecoverable API states no matter what the httpout state
actually is. This avoid duplication of OPEN, CLOSING, CLOSED etc. handling.
Documented the Jetty start mechanism.
Reorganized the documentation to look better on the TOC.
Improved JettyIncludeExtension to support replacements, deletions and callouts.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Remove PMD from build
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Attempt to fix log4j2 distribution test
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Fixing jetty-start tests to use configured maven.repo.uri property
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Using ${env.MAVEN_REPO_URI} configured at Jenkins.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* no need of this
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Co-authored-by: olivier lamy <oliver.lamy@gmail.com>
* Fixes#5902 - Grab Jetty startup output in documentation.
Implemented an Asciidoctor extension that uses `JettyHomeTester` to run
Jetty and capture its output.
This extension is triggered by the `ServiceLoader` mechanism, so the
documentation jar is now in the plugin classpath.
Introduced `jetty-halt.xml` so that the JVM can be halted.
In this way, Jetty does not produce the "stopping" log lines and
therefore they won't be grabbed and included in the documentation.
Used the new `include::jetty[]` directive in the documentation.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
* Fixes#5880 - Move test-simple-webapp to demos.
Moved test-simple-webapp to demos under demo-simple-webapp.
Moved the JSP demos into their own module: out of demo-jetty-webapp into demo-jsp-webapp.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* enable spotbugs in CI
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
record issues
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
use warning new generation
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
activate errorprone
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
fix Jenkinsfile
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
do not run spotbugs for jetty-runner as we do not want to fix all dependencies bugs :)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
junit should allow empty results
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
maven console can be use only once...
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
one liner
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
recordissues only once
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
force id
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
aggregate results
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
configure a name for aggregated reports
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
mo more -T3 no need anymore of remote session test profile
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
I want to see what failing tests look like with new report.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
skip spotbugs for jetty-jmh
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
get rid of findbugs as we now have spotbugs
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Revert "I want to see what failing tests look like with new report."
This reverts commit df0d13e4c53d7461872e1f925ec06bd36e4a66c9.
activate errorProne parser
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
make pmd quiet for CI
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
remove -fae flag and do not display transfer progress
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
try junitParser() to see what it does
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
junit parser is a bad idea...
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
increase timeout
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
no -T2 for javadoc
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
fix skip spotbugs and pmd verbose
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* remove -T options
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
More cleanups in code adding more privateness, getting rid of unnecessary exceptions, making fields final, etc.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #5713 Remove dependency on derby
Signed-off-by: Jan Bartel <janb@webtide.com>
* use the mariadb client version from the property
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Co-authored-by: olivier lamy <oliver.lamy@gmail.com>
* Use File.list and File.walk within a try with resource
The API contract of File.list and File.walk requires them to be closed after use.
* Fix from review
Left out filter
* Fix from review
Factored out deleteFile with better debug
* Fix from review
Can delete files whilst walking
* Fix from review
Restored sweepFile
fixed minor code suggestions
* remote session tests are now executed per default, new profile to exclude then no-remote-session-tests
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* remove this no-remote-session-tests profile just use skipTests to skip that
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* Issue #5605 unconsumed input on sendError
Add Connection:close if content can't be consumed during a sendError. Processed after the request has returned to the container.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Update from review
+ Add close on all uncommitted requests when content cannot be consumed.
* Update from review
+ fixed comment
+ space comma
* Only consume input in COMPLETE if response is >=200 (ie not an upgrade or similar)
* Updated to be less adventurous
I do not think it was valid to always consumeAll in COMPLETE as this could break upgrades with both 101s and 200s
Instead I have reverted to having this consumeAll logic only:
+ in sendError once control has passed back to the container and we are about to generate an error page.
+ in front of all the sendRedirection that we do without calling the application first.
Extra tests also added
* Updated to be less adventurous
reverted test
* Testcase for odd sendError(400) issue.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Fix for odd sendError(400) issue.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Testcase for odd sendError(400) issue.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Always try to consumeAll on all requests
* Refinements after testing in 10
* Refinements after testing in 10
Fixed test
* Fixed comment from review
* Updates from review
+ added redirect methods that consumeAll
+ ensureContentConsumedOrConnectionClose renamed to ensureConsumeAllOrNotPersistent
+ ensureConsumeAllOrNotPersistent now handles HTTP/1.0 and HTTP/1.1 differently
* better consumeAll implementation
* update from review
+ better javadoc
+ filter out keep-alive
+ added more tests
* update from review
+ better javadoc
* update from review
+ fixed form redirection test for http 1.0 and 1.1
* update from review
+ HttpGenerator removes keep-alive if close present
+ Use isRedirection
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Introduced HttpDestination.send(Request, Response.CompleteListener) to send a request using the given destination.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Make EOF and errors be special content.
Transition to a much simplified FSM by using the needContent() / produceContent() model.
Implement blocking on top of async, this way there is only one FSM.
(Milestone 6)
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Moved jetty-dir.css from jetty-util to jetty-server,
so that it can be found by ResourceHandler when using JPMS.
Updated DefaultServlet to call a ResourceHandler method
to retrieve the stylesheet.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Fixes#5379 - Better handling for wrong SNI.
Reworked the SNI logic.
Added support for IP addresses in the SAN extension of certificates in the X509 class.
Fixed keystores to have CN=localhost and SAN with ip=127.0.0.1 and ip=[::1].
Fixed tests that were not using the correct Host header.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Reorg of /demos/ with focus on spec modules
* Reworking demo-mock-resources into /demos/ proper
* Removing old /tests/ modules that no longer have a reason for existing.
* Making demo-mock-resources a formal module
* demo-jndi and demo-spec now depend on it
* Restoring jetty-maven-plugin config lost in demo-jetty-webapp
* Fixing jetty-maven-plugin realm usage to be local
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #5357 - Updating to https://eclipse.org/
- Removing redundant <url> refs in pom.xml
- Correcting bad indenting from merge
- Correcting mailing list references
- Correcting bugs.eclipse.org references
- Correcting text file references
- Correcting html references
- Correcting further references
- Correcting download.eclipse.org reference
- Adding test for demo-base /proxy/current/
- Ensuring jetty-client is included in javadoc-proxy.war/WEB-INF/lib
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
- ProxyServletTest additions for server backend TLS
- Updating test-proxy-webapp testing
- Better class name for test
- More documentation on purpose of test.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ Enforcer mandates common version of junit-jupiter,
but the org.testcontainers:testcontainers brings in
an older version.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ Done to ease dependency / exclusions listing requirements
elsewhere in the reactor.
(Prevents accidental discovered components from
triggering actions during use of jetty-home
as a dependency)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ Cleanup of test-servlet-spec webapp
+ Removing unused methods
+ Commented System.err.println moved to java.util.logging
+ General checkstyle cleanup (empty lines, spacing, etc)
+ Eliminate bogus WebApp LIB ordering tests.
+ No ClassLoader has a order guarantee.
+ Moving HttpSessionListenerTest contents to existing SessionListenerTest
+ Cleanup of SessionListenerTest with eye to resource cleanup
+ Removing ServletContextListenerTest as it duplicates tests
+ Restoring WebAppClassLoaderTest test method
+ `ordering()` is now `testClashingResource()` and properly
tests assumptions when dealing with a ClassLoader.
The old test assumed guaranteed order from a ClassLoader,
which is not a feature of any Java ClassLoader.
Especially so for URLClassLoader.
+ Restoring clashing resource test
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>