+ Introduce new Resource.fromReferences to help with
parsing delimited resource reference lists.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ More tests for both relative and absolute path references
+ More testing that will trigger quirks on Windows builds
so that we can catch regressions faster
+ Reworked WebInfConfiguration to be glob aware in a way
similar to how WebAppClassLoader behaves.
+ Reworked Resource.newResource(String) to delegate
canonical path resolution to PathResource
+ Guarded PathResource's usage of Path.toAbsolutePath()
to ignore valid conditions where the Path cannot be
resolved to an absolute path (yet)
+ Normalize resolved paths in PathResource
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
On the client:
* Origin.Address.host is passed through HostPort.normalizeHost(),
so that if it is IPv6 is bracketed.
Now the ipv6 address passed to an `HttClient` request is bracketed.
* HttpRequest was de-bracketing the host, but now it does not anymore.
On the server:
* Request.getLocalAddr(), getLocalName(), getRemoteAddr(),
getRemoteHost(), getServerName(), when dealing with an IPv6 address,
return it bracketed.
The reason to return bracketed IPv6 also from *Addr() methods is that
if it is used with InetAddress/InetSocketAddress it still works, but
often it is interpreted as a URI host so brackets are necessary.
* DoSFilter was blindly bracketing - now it does not.
Added a number of test cases, and fixed those that expected
non-bracketed IPv6.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #5088 Review ContextHandler locking
The locking was primarily as a memory guard for the availability status, which was already volatile.
Have instead using an AtomicReference with a simple state machine layered on top of start/stop lifecycle.
There was also protection for AttributesMap, which is no longer needed as AttributesMap is now concurrent.
* Issue #5088
updates from review
* Issue #5088
updates from review (better this time)
* Issue #5093 Static UrlEncoded
Updated UrlEncoded to static only class with no synchronization
* Fixed additional tests
* fixed formatting
Signed-off-by: gregw <gregw@webtide.com>
* Replaced relevant usages of synchronized with AutoLock.
* Made AutoLock serializable since classes that use it may be stored in the HttpSession.
* Added convenience methods to AutoLock to execute lambdas with the lock held.
* Introduced AutoLock.WithCondition to use a Lock and a Condition together.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #4741 HttpServletMapping
This completes the refactoring started in #4851, using
the HttpServletMapping field to avoid having the servletPath field
in the Request and instead have a pathInContext field.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4741 HttpServletMapping
reverted ResourceService changes
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4741 HttpServletMapping
fixed gzip handler
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4741 HttpServletMapping
Fixed several TODOs left in the code
removed _contextPath field and used an attributes lookup for include
replaced setContextPaths with setContext
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4741 HttpServletMapping
Used the same pattern from the contextPath changes for servletPath and pathInfo. Now the servletPathMapping is always set on the request and only if the dispatch is an include do the effected methods look deeper for the source values.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4741 HttpServletMapping
Improved javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* remove slow mongo maven plugin which was forking an external process and now run mongodb in a container so we can even now test with different version using -Dmongo.docker.version
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* Spun out from #4814 Improve Attributes Handling
Improve attribute handling to reduce garbage and improve lookup.
Introduced a Wrapper so that request can remove any layers on reset.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4814 - Exposing AttributeMap.getAttributeNameSet() on Attributes.
The underlying AttributesMap already has a .getAttributeNameSet()
method, expose it on the Attributes interface.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Allow a set to override a secure attribute.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4814 - Attributes.getAttributeNames() is now defaulted
The Attributes.getAttributeNames() will use the
.getAttributeNameSet() by default now.
Updated all Attributes.Wrapper impls to use this new behavior
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
If SNI is required, wrap the KeyManagers with SniX509ExtendedKeyManager.
Updated the main keystore file to only have one certificate (instead of two),
since there never was the need for two certificates in the tests.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #4713 Async dispatch with query.
+ Preserve the entire URI with query when startAsync(req,res) is used.
+ merge any query string from dispatch path with either original query or preserved query from forward
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4713 asyncDispatch with query parameters
Signed-off-by: Greg Wilkins <gregw@webtide.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>
* Moved implementation of UpgradeTo from HTTP2ServerConnection
to HTTP2Connection, since now also the client connection
can be upgraded to.
* Split HTTP2Session.newStream(), since now the client must
be able to create the implicit stream 1 corresponding to
the HTTP/1.1 upgrade request, so that the HTTP/2 response
after the upgrade finds the stream.
* The HTTP/1.1 upgrade mechanism has been generalized.
Before it was based on HttpConnectionUpgrader and a hook
in HttpChannelOverHTTP.exchangeTerminating().
Now it is based on UpgradeProtocolHandler that when sees
a 101 response it will trigger the upgrade mechanism.
* Introduced ConnectionPool.accept(Connection) to transfer
a connection from the HTTP/1.1 connection pool to the
HTTP/2 connection pool after the upgrade.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Explicitly removing the idled out thread from the stack,
rather than calling tryExecute().
Side benefit is that we are now removing idled out threads
that are least recently used.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixes#4575 Stopping Reserved Thread by removing the `isRunning` check
from `reservedWait`. The main run loop is also simplified to improve
`isRunning` checks before the thread is put on the stack. Javadoc
improved to explain each step.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Checkstyle fixes ...
+ Log.__loggers now Log.LOGGERS
+ Log.__props now Log.PROPS
+ StdErrLog.__tagpad now StdErrLog.THREADNAME_PADDING
+ StdErrLog.__source now StdErrLog.SOURCE
+ StdErrLog.__long now StdErrLog.LONG_CLASSNAMES
+ StdErrLog.__escape now StdErrLog.ESCAPE_CONTROL_CHARS
+ Removed redundant "public" modifier on Log interface methods
New code ...
+ New Log.getProperty(String key, String defaultValue)
Used by JavaUtilLog, JettyLogHandler, and StdErrLog
+ New StdErrLog.getConfiguredLevel()
+ New StrErrLog.println(String) used to write StringBuilder
to configured PrintStream
Removed code ...
+ Removed deprecated prop check in StdErrLog initialization
Cleanup and Corrected code ...
+ StdErrLog.setDebugEnabled(boolean) cleanup
+ StdErrLog._stderr is now used and is never null
+ Only one StdErrLog.format() method entry point
+ StdErrLog.format(StringBuilder, Throwable) now called .formatCause(StringBuilder, Throwable, String)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
- Replicate problems from WS close deadlock with test cases
- use FutureCallback instead of SharedBlockingCallback for WS blocking methods
- add timeout to the blocking callbacks for WS for (idleTimeout + 1000ms)
- Core throws ClosedChannelException instead of ISE if send after closed
Must be package private because it uses TimeNSize
in method signatures, that is also package private.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #4376 Async Content Complete
Added test harness to reproduce unready completing write.
Fixed test by not closing output prior to becoming READY
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Async Write Complete
Test harness to reproduce unready when closing/completing.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Async Write Complete
test both PENDING and UNREADY
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Async Write Complete
test cleanups
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Async Close Complete
Cleanups of write
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* WIP
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Work in progress
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Added async close to HttpWriter and ResponseWriter
Always use async close, with blocker if necessary.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Working async close complete!
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
invert test as we can now call complete when not ready!
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
fixed transition to ERROR state
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
async close after onError
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
minor cleanups
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Fix for proxy tests
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Fix write loop to handle clear of p=0,l=0 rather than p=l
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Removed old close on all content mechanism
Cleanups and some more TODOs
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
a reworking of HttpOutput to separate out API state.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Soft close for Dispatcher
release buffer in onWriteComplete
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Set _onError in onWriteComplete
NOOP callback instead of null
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
failure closes HttpOutput
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Moved closedCallback handling to onWriteComplete
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Additional test of complete during blocking write.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
reimplemented blocking close to sometimes be async
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
ascii "art"
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Code cleanup. Use a CLOSE state rather than non null closedCallback to be clearer that it is a state.
Renamed close(Callback) to complete(Callback)
Renamed and simplified closed() to completed()
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Do not dispatch
Better ascii art
improved close impl to be similar to complete
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
More test cases
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
retain execute behaviour in 9.4. review in 10.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Improved javadoc and ascii art
* Improved CLOSING
Switch to CLOSING state as soon as last write is done, even if several non last channelWrites will be done. This allows a subsequent call to close to know that nothing needs to be written and can avoid some EOF exceptions. Now onWriteComplete acts only on the passed in last parameter.
Added test for sendContent
* WIP
Aggregate within lock
pipeline test debug
* Avoid creating ignored exception when Idle or Failed.
* Try a parse without fill to avoid unconsumed input debug
* fixed pipeline size
* release buffer before callback
* turn off debug
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Better javadoc
refactored onWriteComplete logic to be simpler
fixed bug with flush of last written byte
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Completely reworked test harness for better coverage.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4331 Close Complete
Reworked order of ifs to match logic above in onWriteComplete
Signed-off-by: Greg Wilkins <gregw@webtide.com>
+ Plus fleshing out the testcases more for Base / Client / Server
with and without certificates that will trigger SNI requirement
and ISE.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Avoid creating listener list for rarely used requestAttributeListener
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964
Keep a list of EventListeners in the AbstractConnector to make it
more efficient to add and iterate over them.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
Use addEventListener rather than bespoke listener methods.
Support getEventListenerBeans at Container level for fast lookup
improve javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
fixed test
more javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
fixed tests
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964
Don't use null for empty lists of listeners
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* fix merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
Resolve differences between eventListeners added as beans and beans
added as EventListeners. The behaviour should now be the same
regardless of how they listener is added and all listeners are now
beans.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
Add only SelectorManager listeners to manager from connector
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
Fixed javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
removed old TODO
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
connector cannot be null
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964
AbstractConnector keeps a specific list of HttpChannel.Listeners
to avoid Connection.Listeners and MBean listeners being added to
the HttpChannel listener list.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
fixed merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* fixed javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
removed the ability to set/clear context listeners
Instead just remove non-durable ones.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964 Listeners
Simplified listener handling by avoiding null connector, previously
only needed for testing.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* fixed bad merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964 Listeners
Fixed test that assumed HttpChannel listeners were not cleared by a recycle
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964 Listeners
Separated out durable vs cyclic HttpChannel.Listeners, so as to
simplify handling.
Deprecated cyclic HttpChannel.Listeners, as I'm not sure the channel is
the right place for them.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* removed deprecated cyclic HttpChannel listeners
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* removed deprecated cyclic HttpChannel listeners - import
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4003 Cleanup quickstart
* Fixed tests that scan for "Started" on console
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* updates from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3863 - Enforce use of SNI.
Introduced SslContextFactory.rejectUnmatchedSNIHost (default false)
so that if no SNI is sent, or SNI does not match a certificate,
then the TLS handshake is aborted.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #3863 - Enforce use of SNI.
Updates after review.
Introduced SslContextFactory.SNISelector to allow application to write
their custom logic to select a certificate based on SNI information.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #3863 Enforce SNI
Added two sniRequired fields - one at SslContextLevel and the other at the SecureRequestCustomizer. This allows rejection either at TLS handshake or by 400 response.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3863 Enforce SNI
cleanups from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3863 Enforce SNI
improved comments
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3863 Enforce SNI
syntax sugar
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3863 SNI
Updates from review. Extra test for sniSelector function
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Made method reportDifferences(...) private since it was exposing
package private class TimeNSize and no code outside of jetty-util
could have used it.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* issue exclude/include con name InetAccesHandler - add better unit test
this logic:
String name =
baseRequest.getHttpChannel().getConnector().getName();
return _names.test(name) && _addrs.test(addr);
Is not correct. it's treating the connector name exactly like the
filter. But that's not what it's intended to do. It's supposed to tell
what connectors are applicable to this filter. And what connectors are
not affected.
For example in the unit test there exists 2 connectors:
http
tls
We want to restrict the http connector, but we want to leave tls
connector alone.
So we would specify:
include = 192.168.1.1-192.168.1.254
includeConnector = http
The way the logic is above, it is treating the connector name as if it's
the filter itself. Which is not what I intended.
What i need in psuedo-code is this:
if (there are no "include connectors" OR if this connector is
included) AND (if this connector is not in the excluded list)
---> Then apply the IP filter.
Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>
* exclude should take precedence over include
Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>
* Issue #4193 InetAccessHandler
reverted changes to IncludeExcludeSet
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4193 InetAccessHandler
updates from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4188 Spin in close of GzipHandler
Cleanup and simplify code
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4188 Spin in close of GzipHandler
Fix slice code. Added unit test for it.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4188 Spin in close of GzipHandler
Fixed last slice.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* cleanup from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
There is a race between the doStop clearing the key map and the watching thread
checking isRunning before iterating over the key map.
While more sophisticated approaches could be used, I think that is best to defer
until this class is reworked entirely. For now just using a ConcurrentHashMap will
avoid the exception and the closing of the pathwatcher will prevent watching forever.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Fixed setting of host/port in AbstractConnectorHttpClientTransport
and HttpProxy so that the creation of SSLEngine can use the proper
host/port pair, and can be subsequently used in TLS components.
Introduced SslContextFactory X509ExtendedKeyManagerWrapper and
X509ExtendedTrustManagerWrapper as utility classes used internally
and in tests.
The test case for this issue required 3 keystores, so other test
classes have been refactored to use the new keystores.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Several QTP fixes:
* #4105 Threads without jobs now check if they should idle die before waiting rather than before, this allows idling under steady load. 3ad6780
* #4121 ThreadFactory behaviour supported by doing thread config within newThread call. 7b306d7
* #4122 Always clear the interrupted status. c37a4ff
task = queue.poll(timeout);
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4105 - starting a thread in QTP now increments idle count
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #4105 - improve comments in test
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Added test to reproduce issue
Fixed bug from #2772 where output was shutdown on DONE without checking for END.
Fixed aggregation logic to aggregate last write if aggregation already started
Improved comments and clarify conditions
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Now using the _size AtomicInteger to resolve the race between stopping
and adding to the stack.
A _size of -1 now means no more threads can be added to the stack, and
the loop in doStop() will now only exit if it can set the size to -1.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Introduced a Response.DemandedContentListener to explicitly separate
the will to request more content from the notification that the content
has been consumed.
Updated all transports to follow the new semantic: rather than waiting
for the callback to complete before delivering more content, now they
wait for the demand to be positive to deliver more content.
Since now the content may be unconsumed but there can be more demand,
all transport implementation had to be changed to use RetainableByteBuffer
to retain content buffers that were not consumed.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #4003 Fix quickstart.
Modes:
AUTO: use quickstart xml if present, start normally otherwise
GENERATE: re/generate quickstart xml
QUICKSTART: use a pregenerated quickstart xml, fail otherwise
Signed-off-by: Jan Bartel <janb@webtide.com>
* Issue #4003 Cleanup quickstart
Removed TerminateException in favour of Server.setDryRun(boolean)
and AbstractLifeCycle.StopException
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Removes the Locker class, replaced by AutoLock.
Removed usages of Locker.isLocked() from the session code
since it was not necessary.
Took the chance to do a little code cleanup.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Code cleanups and reformatting.
Fixed logic for SETTINGS frame replies: they are not subject to rate control.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Issue #3964
* Avoid creating listener list for rarely used requestAttributeListener
* AbstractConnector keeps a specific list of HttpChannel.Listeners
to avoid Connection.Listeners and MBean listeners being added to
the HttpChannel listener list.
* Simplified listener handling by avoiding null connector, previously
only needed for testing.
* Fixed test that assumed HttpChannel listeners were not cleared by a recycle
* Separated out durable vs cyclic HttpChannel.Listeners, so as to
simplify handling.
* Deprecated cyclic HttpChannel.Listeners, as I'm not sure the channel is
the right place for them.
* Added improved method to combine multiple HttpChannel Listeners
into a single Listener.
* Fixed MockConnector
* Added benchmark
* Improved benchmark
* Updates from review
* Removed benchmark and alternate implementations.
* Updated javadoc
* Updates from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3806 async sendError
Avoid using isHandled as a test withing sendError as this can be
called asynchronously and is in a race with the normal dispatch of the
request, which could also be setting handled status.
The ErrorHandler was dispatching directly to a context from within
sendError. This meant that an async thread can call sendError and be
dispatched to within the servlet container at the same time that the
original thread was still dispatched to the container.
This commit fixes that problem by using an async dispatch for error
pages within the ErrorHandler. However, this introduces a new problem
that a well behaved async app will call complete after calling
sendError. Thus we have ignore complete ISEs for the remainder of
the current async cycle.
Fixed the closing of the output after calling sendError. Do not
close if the request was async (and thus might be dispatched to an
async error) or if it is now async because the error page itself is
async.
* updates from review
* better tests
* revert ignore complete
* added some TODOs
* more TODOs
* fixed rename
* cleanup ISE and more TODOs
* refactored to call sendError for uncaught exceptions rather than onError
* more of the refactor
* extra tests for sendError from completing state
Reworked HttpChannelState and sendError so that sendError is now
just a change of state. All the work is done in the ErrorDispatch
action, including calling the ErrorHandler. Async not yet working.
Additional tests
Converted ERRORED state to a separate boolean so it can be used for
both Sync and Async dispatches.
Removed ASYNC_IO state as it was just the same as DISPATCHED
The async onError listener handling is now most likely broken.
WIP making sendError simpler and more tests pass
WIP handling async and thrown exceptions
WIP passing tests
Improved thread handling
removed bad test
Implemented error dispatch on complete properly
more fixed tests
sendError state looks committed
- Added resetContent method to leave more non-content headers during sendError
- Fixed security tests
- simplified the non dispatch error page writing. Moved towards being able to write async
* fixed gzipHandlerTest
* Updated handling of timeout errors. According to servlet spec,
exceptions thrown from onTimeout should not be passed to onError, but
just logged and ignored:
If an exception is thrown while invoking methods in an AsyncListener,
it is logged and will not affect the invocation of any other AsyncListeners.
* This changes several tests.
* Dispatcher/ContextHandler changes for new ERROR dispatch handling. Feels a bit fragile!
* Fixed tests in jetty-servlets
* Fixed tests in jetty-proxy
* more test fixes
* Fixed head handling
reverted unnecessary changes
Improved reason handling
WIP on fully async error handling.
Simplified HttpChannelState state machines to allow for async actions
during completing
more WIP on fully async error handling.
sendError and completion are not both non-blocking, without using
a startAsync operation. However we are lacking unit tests that actually
exercise those code paths.
* Simplified name of states
Added test for async completion
* Cleanups and javadoc
* Cleanups and javadoc
* remove snake case
* feedback from review
* Write error page into fixed pooled buffer
Use the response to get/release a pooled buffer into which the error
page can be written. Make it a fixed sized buffer and if it overflows
then no error page is generated (first overflow turns off showstacks
to save space).
The ErrorHandler badly needs to be refactored, but we cannot change
API in jetty-9
* More test fixes for different error page format
* minor cleanups
* Cleanup from Review
* Fixed javadoc
* cleanups and simplifications
* Cleanup from Review
* renaming and some TODOs
* Cleanup from Review
* Checkstyle fixes
* Cleanup from Review
* Code cleanups and simplifications
* fixed debug
* Cleanup from Review
* Ensure response sent before server shutdown
* removed unnecessary optimisation
* fixed duplicate from merge
* Updates from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
+ Adding SameFileAliasChecker to help with environments
where the Alias and the Path point to the same file,
by relying on the FileSystem and Path implementation
to make the determination if the two Path references
truly point to the same file.
+ Minor cleanup of FileSystemResourceTest
+ Additional DefaultServletTest for this UTF-8 differences
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ OSX File is `swedish-å.txt`
+ OSX has NFD form UTF-8 characters. `swedish-a%CC%8A.txt`
+ HTTP uses normal form UTF-8. `swedish-%C3%A5.txt`
+ A HTTP GET request should work against the resource
being requested, regardless of UTF-8 style used.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>