Alternative Handler architecture.
All Handlers are Processors, which now return a boolean to indicate the request has been accepted.
The request/response/callback are no longer modal, so there is no race with the boolean return.
Optimized PathMappings.
Avoid iterations if only ServletPathSpec instances
Avoid tests for empty mappings.
Better reset implementation
Improve suffix matching
Improve exact matching
Renamed HttpStream.getNanoTimeStamp() to getNanoTime().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
The problem was that sometimes content bytes generated randomically ended with \r, confusing the multipart parser.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Improved locking for HttpReceiver.ContentSource.
Improved response failure code path.
Now either responseFailure() must be called, or exchange.responseComplete() followed by HttpReceiver.abort().
Fixed failAndClose() for HTTP/2 and HTTP/3: the connection must not be closed, stream.reset() is sufficient.
Fixed flaky test HttpClientDemandTest.testTwoListenersWithDifferentDemand().
Fixed DistributionTests.testVirtualThreadPool().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Extracted some non controversial cleanups from another mega PR:
+ TypeUtil class shortname used more often and includes trailing digits
+ Fixed direct stopping/starting of a nested ContextHandler
+ Fixed null path handling in nested context
+ more tests for all of the above
* Extracted some non controversial cleanups from another mega PR:
Fixed nested doStart and doStop
* Extracted some non controversial cleanups from another mega PR:
Fixed DistributionTests
* Cleanup ContextHandler
Extracted some of the goodness from #8793:
+ Clear enter/exit scope methods rather than opaque suppliers and Runnables
+ Removed overloading of "Context" class name to avoid accidental usage of wrong type.
+ Less holding onto request/response as fields
* Cleanup ContextHandler
fixed test with no server
* Updates from review.
* Rewrite RuleProcessor
This decouples the rewrite module from the `WrapperProcessor` class, which is being considered for significant refactoring or removal.
Having a module specific version of that class allows better code readability and a more appropriate API that avoids duplication request instances.
* Fixed javadoc
* Updates from review.
* Updates from review.
Make the MimeTypes available from the server mutable.
Context MimeTypes are now wrappers over the server MimeTypes, so configuration at the server level is inherited by all contexts.