* Added FragmentingFlusher to abstract the fragmentation of frames.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Handle failure case of Fragmenting Flusher
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Fragment outgoing frames before the ExtensionStack
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* update javadoc
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* separate frame size validation for incoming and outgoing frames
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* fix test
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* reimplement FragmentingFlusher with the new TransformingFlusher
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* rework ByteAccumulator to avoid unnecessary data copies
* use ByteAccumulator instead of BAOS for ws compression
* outgoing autoFragment working with permessage-deflate
* ByteAccumulator now uses fixed maxFrameSize and no ByteBufferPool
* rework deflate code and introduce TransformingFlusher
* use transforming flusher for outgoing compression
* general clean up CompressExtension and subclasses
* remove forward incoming method
* use flusher to fragment for the decompressing of incoming frames
* fix broken tests
* updates to TransformingFlusher
* tests for CompressExtension with no payload
* ByteAccumulator uses the BufferPool for the final buffer
* remove increased maxFrameSize from autobahn tests as we now autoFragment
* add test for gzip bomb
* fix typo
* use Throwable failure instead of canEnqueue
* changes to TransformingFlusher from review
* remove per frame deflate extension
* remove accumulation of data to maxFrameSize in CompressExtension
* race between finished being set and callback being completed
* cleanup of transforming flusher
* fix issues with the TransformingFlushers
* add internal parameters for deflate and inflate BufferSize
* missing licence header
* wip
* don't use same extension config instances in negotiated extensions
* changes to TransformingFlusher from review
* fix internal extensions requested by client
* javadoc update
* javadoc and cleanup from review
* remove ByteAccumulator
* fix module-info
* null out current on callback completion
* remove override of succeeded and failed
Signed-off-by: Lachlan Roberts <lachlan@webtide.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>
- do not select duplicate extensions in javax default Configurator
- correctly copy payload for ping frames in jetty & javax frame handlers
- add ByteBuffer to javadoc for onMessage in jetty api
- cleaned up some test logging for EventSocket
- add autoFragment and maxFrameSize settings to WebSocketPolicy
- fix early validation for multiple extensions in setExtensions
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3734 - throw ISE for WebSocket suspend after close
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3734 - suspend is error if onClose() has been called
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Outgoing frames will now go RemoteEndpoint->Session->ExtensionStack
instead of just RemoteEndpoint->ExtensionStack.
This will allow the Session to check whether it has been closed before
allowing the frame through the ExtensionStack.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3872 Javax Websocket Packaging
Moved JaxaxWebSocketConfiguration and SCI to config package.
Limited classpath exposure in JavaxConfiguration (more needed)
Updated tests with work around for those that needs more classes exposed
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3872 Javax Websocket Packaging
Moved all remaining classes from org.eclipse.jetty.websocket.javax.server
to org.eclipse.jetty.websocket.javax.server.internal.
This works when running on the classpath, but the tests fail when running
on the modulepath (eg in commandline mvn run). The issue appears to be
that the tests don't load test classes from WEB-INF/lib or WEB-INF/classes.
Instead the test classes were themselves in org.eclipse.jetty.websocket.javax.server,
which is no longer exported from module-info.java.
The hacked "fix" for this has been to create a org.eclipse.jetty.websocket.javax.server.tests
package which is exported and to move all the tests to that. A better fix is needed.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3872 Javax Websocket Packaging
improve comments
tighten exposed classes more
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3872 - fixing tests
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3872 - move ContainerDefaultConfigurator to config package
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3873 - fix javax websocket test classloader issues
move websocket endpoints for test webapps to com.acme.websocket package
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
+ This class is removed in Jetty 10 anyway.
+ If all you want is to access available extension names
then use the Factory.getAvailableExtensionNames() method
(which exists in Jetty 10.0.0 as well)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ The change in commit 30dc103a12
was done to allow the InflaterPool and DeflaterPool
to be managed by the Jetty lifecycle.
+ This restore the original abstract class ExtensionFactory.
+ Had to break the traditional LifeCycle usage for a more
non-traditional one in order to both, not break this existing
API, and not introduce jetty-util to the webapp classloader.
+ This will restore API / binary compatibility for other
projects, like spring-boot.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.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>