* 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>
* 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>
+ 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>
Introduced:
* Request Request.headers(Consumer<HttpFields.Mutable>).
This allows applications to modify the headers, and chain calls.
It also delegates the precise semantic of put/add/remove/clear to HttpFields, so there is no API duplication.
* HttpRequest.header(HttpField) to efficiently add fields while normalizing the request (only used in implementation).
* HttpResponse.header(HttpField) to efficiently add fields while parsing the response (only used in implementation).
This pairs with HttpResponse.trailer(HttpField).
* HttpResponse.headers(Consumer<HttpFields.Mutable>) to modify the fields after they have been populated (only used in tests).
Removed:
* Request.[set,add,put,remove], replaced by headers(Consumer<HttpFields.Mutable>).
Deprecated:
* Request.header(String, String)
* Request.header(HttpHeader, String)
Both replaced by headers(Consumer<HttpFields.Mutable>) with clearer semantic for add/put/remove.
All the rest is code cleanup to remove the usage of the deprecated header() methods.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Made HttpURI, HttpFields and MetaData immutable. The first two follow the same builder pattern and MetaData is constructor injection only.
* Immutable version of HttpFields
Preserve API and usage of HttpFields class while providing a read only interface and immutable implementation.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable version of HttpFields
Use an ArrayList in HttpFields. While slightly slower than the array, it will mostly be used as a builder pattern for an Immutable
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable version of HttpFields
Fixed exception type.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable version of HttpFields
asImmutable method
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
Made HttpURIU immutable with a builder pattern.
MetaData immutable and working within http module.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
Fixes from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
Passing tests upto and including jetty-server
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
Cleanup of HttpURI.Builder API as suggested in PR.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
Added builder for MetaData.Request
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
more api fixes
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
WIP making HttpFiels itself immutable. Currently working up to jetty-servlet.
Need to consider if content-length really is meta data and how much and when can we trust it.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
WIP
Need to consider if content-length really is meta data and how much and when can we trust it. Also need to consider difference between h2 and h1 authority in metadata.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
jetty-client and jetty-servlet passing tests.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
Better align the style of immutability between `HttpFields` and `HttpURI`.
They both now have static build() and from() methods, plus Builder and Immutable implementations.
Potentially `Builder` could be renamed as `Mutable`
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
http2-server tests passed
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
http2-client tests passed
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
cleann build?
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
fix
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
more test fixes
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
Cleanups, mostly using EMPTY when appropriate.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
Cleanups, use immutable
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
No trailers for connect
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
Fix CONNECT path handling
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
fixed rewrite query handling
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
rename Builders to Muttables
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
misc cleanups
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
Revert to using arrays due to garbage generated by streams and iterators (12% of a simple benchmark!).
Even if this garbage is an artifact of the JIT being disabled by observation, it can hide other allocations, so best to just use simple arrays!
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
More optimizations and better test coverage.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable Metadata
various cleanups
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
More optimizations
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
review changes
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
changes after review:
+ less usage of Mutable
+ more usage of EMPTY
+ restored fragment handling
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
changes after review:
+ less usage of Mutable
+ less usage of asImmutable
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData WIP
changes after review:
+ less usage of Mutable
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
changes after review:
+ better handling of URI in ContextHandler
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
changes after review:
+ downcast in test to access mutable response headers.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Immutable MetaData
changes after review:
+ use put instead of add for one time headers
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* private
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Implemented selector recovery by transferring
all keys to a newly created selector.
Updated code so that it does not assume that the
SelectionKey never changes.
* Use HandlerList instead of HandlerCollection
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Use HandlerList instead of HandlerCollection
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Fixed XML files.
Restored ServletContextHandler.setGzipHandler() and
deprecated it in case it's used from user's XML files.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #4656 generalise XmlConfiguration elements
Extended the use of Id, Class elements
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4657 Validation in XmlConfiguration
Default to validate if xerces is in the name
Fixed test harness to prepend DTD.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4657 Validation in XmlConfiguration
WIP on adding validation to XMLs
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4656 - Fix bad xml id attribute usage in jetty-maven-plugin
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Introducing jetty-slf4j-impl
* Make Jetty use org.slf4j
* Removed most of org.eclipse.jetty.util.log classes
* Left org.eclipse.jetty.util.log.Log and
org.eclipse.jetty.util.log.Logger but as
simple bridge classes that are deprecated
* Migrated code using org.eclipse.jetty.util.log.StacklessLogging
to org.eclipse.jetty.logging.StacklessLogging found in
the jetty-slf4j-impl
* Moved logging start modules from jetty-util to jetty-home
* Simplified logging start modules
* Updated code that was using StdErrLog directly
* Updating module-info.java for org.slf4j
* removing org.eclipse.jetty.util.log.class references
* jetty-start supports manually declared default provider
+ and we use it to default "logging" to the "logging-jetty" provider
* Cleaning up jetty-maven-plugin and IT testing for Logging
* Using old slf4j for it testing
* Updating compiler config to show Xlint:exports warnings
* Updating console-capture and logging-noop
* Adding slf4j bridge (capture) jetty modules
* Updates to jetty logging module locations
* Changing reference to slf4j dependent mod
* Process requested enabled modules in topological order
* Limiting inclusions in shaded jetty-start
+ Also adding note to jetty-util classes that are used by
jetty-start
* Default logging level on baseline logging config is INFO (not DEBUG)
* Changing from system to server classes in logging
* Updating other modules to use new logging names
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Introduced Request.Content with a reactive model to provide
request content.
Introduced RequestContentAdapter to wrap ContentProviders
into Request.Content.
Updated implementation to use the reactive model rather than
the old pull model.
Reimplemented all ContentProviders in terms of Request.Content.
Converted most of the tests from ContentProvider to Request.Content.
Updated proxy servlets and documentation.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Clean up CustomRequestLog and fix the handling of the %u code.
* Add test for logging of remote user with %u and %{d}u
* update javadoc to clarify that %u is only for servlet auth
* remove the prepended '?' when deferred authentication is checked
* Issue #4161 - TestCase that can replicate problem on OSX
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4161 - Naming Server threadpool (to help with debugging)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4161 - bumping up test file size to 10 MB
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4161 Write LifeCycleViolation
Do not callback on write completion until after state has been changed and notifications made.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4161 Write LifeCycleViolation
Added a unit test that replicated the problem.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4161 - `EofException: request lifecycle violation` in stderr.
Moved notifications of commit and content listeners back to succeeded().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #4161 - Improved Logging for test-integration
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4161 - Reducing size of test file
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4203 - Updating test to verify report on Transfer-Encoding
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Fixes#4203 - Transfer-Encoding + Content-Length is 400 Bad Request
+ Fixing validation to not be header order dependent.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4203 - Fixing hasTransferEncoding reset and testcase assumption
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4204 - Transfer-Encoding RFC7230 behaviors
+ More test cases and implementation.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4204 - Transfer-Encoding RFC7230 behaviors
+ Adjusting HttpParser to handle the case where we have multiple
Transfer-Encoding headers and none declare the 'chunked' token.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4204 - Transfer-Encoding RFC7230 behaviors
+ Making changes from PR review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #4203 Transfer Encoding
request with TE and no chunking is a Bad Request
Signed-off-by: Greg Wilkins <gregw@webtide.com>
+ Adds onSelectFailed(Throwable)
+ Adds startSelector()
+ Unit test to demonstrate behavior on both execution
strategies
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Applying XML restyling
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Reformatting pom.xml files
* Fixed empty string from line wraps
* Update intellij style to not do expression relative formatting. Reformatted code based on that.
* Increasing line split on Eclipse IDE Formatter to 512
* Restoring setting on internal default value.
+ IntelliJ will not export settings on things that set to their
internal default values.
We want to keep those values as a hedge against future default
value changes in future releases of IntelliJ.
* Fixing intellij codestyle
* do not allow single line simple methods
* misc checkstyle fixes
* re-exported with correct name and all values
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3661 - review of exposed classes in jetty-websocket-server
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3762 - cleanups of jetty-websocket-server
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>