Introduced ClientConnector and refactored HttpClient transports,
removing duplicated code that was connect() to a remote host.
Refactored also HTTP2Client to reference ClientConnector.
Refactored tests accordingly to the changes introduced in the
implementations.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Updating SslContextFactory configuration for tests, since
the change in the default endPointIdentificationAlgorithm
makes the test failing as the certificates are not valid
for the local host, which is different depending on where
the tests are run (locally, jenkins).
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Introduced ClientConnector and refactored HttpClient transports,
removing duplicated code that was connect() to a remote host.
Refactored also HTTP2Client to reference ClientConnector.
Refactored tests accordingly to the changes introduced in the
implementations.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Improve on #3167 with major refactor of the context initialization of
websocket:
+ The Javax and Jetty sides are more symmetric - both use shared
filter and mapping.
+ Regularised usage of beans rather than attributes for ws components
+ Customization is now part of the mapping, so ws are configured by
how they were mapped and not by who does the upgrade.
+ Filter still can be configured to customize defaults
+ Servlet can be configured to customize any ws mappings added via the
servlet
There is still some strangeness as the WebSocketServlet is mostly
generic, yet can only map Jetty API websockets.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Deletes the deprecated NcsaRequestLog classes
Updates modules to use CustomRequestLog by default
Move jetty-customrequestlog.xml from home to base
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Updated module-info.java to reference the "jetty.servlet.api" module.
* Updated POMs to reference the o.e.j.toolchain:jetty-servlet-api artifact.
* Removed references to jetty-schemas.jar.
* Updated attribute "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern"
to match the new Jetty Servlet API jar.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixes#2978 - Add module-info to relevant Jetty modules.
Added module-info.java for Jetty modules that are not test modules.
Moved jetty-http test utility classes to new module "jetty-http-tools".
Removed generation of test-jar from websocket-core.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixes Issue #3103 - HttpClient buffer leak found by dump improvements
The leak problem was an additional, unnecessary, call retain() in ResponseNotifier.notifyContent() that was leaking `ByteBuffer`s.
* Adding more todos
* More websocket test updates
* Adding more information to exception about mismatched hash
* AcceptHash improved testing
* Prevent duplicate request headers
* Removing ability to use LocalFuzzer entirely (until its fixed)
* JSR356 HandshakeResponse header modifications are now allowed during Configurator
* Correcting MessageSink creation
* Using proper sub-protocol
* Metadata remembers OnMessage.maxMessageSize now
* Minor test updates
* Issue #2172 - Fixing JSR-356 Decoder discovery and OnMessage wiring
* More websocket test updates
* Update for null/empty payload
* Partial String Message Sink fix
* More websocket fixes around InputStream handling
* Moving proposed Abstract FrameHandler hierarchy into core main
* More testing fixes, along with a change to use the new core Abstract*FrameHandler
* Adding WebSocket URI validation
* Updating copy found in other API with improvements made in first API.
* More websocket test updates
* Fixing compilation
* WebSocket test fixes
* Fixing ContinuationTest assertions
* fixed package
* Added some better examples of QuotedCSV
I think this test is trying to use QuotedCSV in the wrong way, as it often is offering values when it should be testing parameters.
I have added some examples to show that QuotedCSV is capable of handling the quotes, spaces and embedded commas of the tests, but only
for parameters and not for values. The question is, is this sufficient for websocket?
* Improve close handling
The handling of a Close Frame may close the endpoint, so parsing should not continue
* moved old AbstractFrameHandler to test
* implement ingoing and outgoing frame sequence checking
* More work on javax.websocket parameterized server
* Bumping up pom plugin versions to jetty-9.4.x standards
* Merging up Jenkinsfile to attempt to fix CI build issues
* JSR356 @PathParam testing
* More WebSocket testing updates
* More WebSocket testing updates
* WebSocket Idle Timeout from FrameHandler specific policy
* WebSocket/JSR Pong support
* WebSocket/JSR Correcting MessageHandler.Whole<PongMessage> handling
* URL Decode UriTemplatePathSpec values
* Fixing test expectations
* Fixing AbstractWholeMessageHandler buffer flip
* More websocket test fixes
* Updated ALPN version for JDK 8u181.
* Removing QuotedUtil from WebSocket-core
+ Moved to QuotedCSV for most usages
+ Introduced HeaderUtil to satisfy remaining use cases
* Review of HttpClient names and Thread names.
+ Javax WebSocket Server = "Javax-WebSocketServer@####"
+ Javax WebSocket Client = "Javax-WebSocketClient@####"
* added OpCodeTest.java
* Minor Frame cleanup
* MessageOS cleanup
* Made the OpCode of WebSocket Frame immutable.
Frames can no longer be set as a continuation and should now be copied using the ContinuationFrame constructor
DataFrames can no longer be created without one of the subclasses as the public constructor was removed in favour of newDataFrame method
* Chat test
* Work on Chat Test
Moved implementation of assertValid to WebSocketFrame
Removed getFinRsvOp
* removed constructors for DataFrame using a basedOn Frame
instead use constructors with opCode, payload and fin bit
* refactor of WebSocket Frames WIP
* WIP: resolved failing tests
* CloseStatus rework, now use CloseStatus.toFrame to create Close Frames
new DelegateFrame class which ReadOnlyFrame extends
trim utf8 byte array in CloseStatus to utf8 character boundaries only
* working on test to test socket io erros in websocket-core
* renaming for clarity
Gave up on maintaining old names, as this is a different package anyway so some adaption will be needed regardless.
* Moved AbstractFrameHandlers to common
Only have a AbstractTestFrameHandler in core
* Close uses CloseStatus
Reduced the parsing and generation of CloseStatus when closing
* merge
* work on WebSocketTest
* cleanup log
* wip
* files missing comment header
jetty-jmh was using 9.4.12-SNAPSHOT now using 10.0.0-SNAPSHOT
* thread names
* remove sequence check from parser
* minor cleanups
* Call frameHandler externally to parser
* OpCode.check now throws ProtocolException instead of returning boolean
changed ProtocolException messages in OpCode.check
* removed Frame.Type and use OpCode instead
separated out FrameValidation for parser into method in WebSocketChannel
* moved remaining frame validation checks into WebSocketChannel
* referenced counted buffer
* cleanups
* wip on demand side
* First attempt at demandable
* demand control
* clean up reference counting
* clean ups
* WebSocketServerTest
* wip
* fixed auto fragmentation
* simple demand test
* test demand and retain
* Added validation back into the Parser
split up validation in WSChannel into methods for incoming and outgoing
fixed various tests in websocket-core
* more tests
* fixed remaining tests failing due to the changes to frame validation
* cleanups
* more autobahn refixes
* adjust mask for auto fragments
* clear mask
* fully close on unrecoverable error and not wait for close response
* Removed the CoreFuzzer and ContinuationTest
These tests are now covered elsewhere.
* remove declared exception onClosed
* Test delay close
* Test handler close
* fixed test dependency
* moved the frame sequence check from OutgoingState from after the ExtensionStack to channel.sendFrame
changed error handling to fail the callback of invalid/outOfSequence frames
added WebSocket Close tests revealing some problems with demand in state ICLOSE
* cleanup
* timing issues with WebSocketCloseTest
* test cleanups
* Cancel demand on close
* removed frame validation from generator
* finished close testing
* Issue #2901 - Moving Http Upgrader to Http Conversation
+ Solves for Authentication and Redirect
* changes from #2902 to jetty-10.0.x
* Validation Extension
introduced a ValidationExtension to do frame validation in the ExtensionStack
added the WebSocketChannel to ExtensionStack.connect to set it on the Extensions
* added parameters for ValidationExtension to choose what to validate
* ValidationExtension Cleanup
ValidationExtension now uses the Validation methods from its WebSocketChannel
simplified the parameter passing to the ValidationExtension
* core cleanup
* Fixed intermittent test failures
* clean up duplicates and imports
* simplified package structure
* many cleanups, simplifications and duplication removal
* cleanup
* added utf8 validation for text frames into ValidationExtension
added tests for utf8 validation
* create ValidationExtensionTest
* cleanup
* merge with jetty-10
update websocket to junit5
* fix to autobahn client report directory
* Fixes and cleanup
Fixed initial buffer too large for websocket buffer
less verbose debug
better debug
* Removed behavior from policy
* cleanup after merge from hell
* bug fixes and cleanups
* refactor packages with JPMS in mind
* unit test for TextMessageHandler
* cleanups
* more cleanups
* provided client/server dependencies
* fixed bad refactor
* use lambdas for TextMessageHandler
* cleanup
* cleanup
* cleanups
* cleanup of websocket-common framehandlers
* reverting to jetty websocket api from 9.4
* better chat
* renamed websocket common to util
* save wip on jetty-websocket-tests
* giving up on jetty-websocket-tests as mostly duplicated tests
* renamed websocket-util back to websocket-common
* moved InvalidWebSocketException to javax common
* reworked TextMessageHandler to MessageHandler
now handles binary messages as well
* implemented getByteBufferPool in remaining DummyChannel classes
* Moved the abstract Frame and Message handlers out of websocket-common
* replaced usages of AbstractWholeMessageHandler with CoreMessageHandler
renamed MessageHandler to CoreMessageHandler
* removed AbstractFrameTypeHandler
* cleanup
* jetty-websocket-common passing tests without websocket-common dependency
* fixed compile errors
* renamed MessageHandler
* Removing reference to websocket-server (no longer exists)
* Removing, Extensions now exist in websocket-core
* Do not append an empty ByteBuffer
* NPE Fix for empty/unused UTF-8 String Builder
* NPE Fix for SendPartialBinaryFrameHandler test
* Punching holes in WebAppContext needed for JSR356 use
* Updating "9.x.x" to "10.x.x"
* Removing Bad URI test case that is ignored
* Fixing test expectation now that we moved to QuotedCSV
* Adding TODO about onOpen failure requiring onError + onClose.
* Throwing JSR356 DeploymentException on addEndpoint() failure
* Test cleanup (for better error messages)
* Adding some comments to explain wrapNonVoidReturnType()
* cleanup methodHandle return type filtering
* test fixes
* Fix change return type to Void
* Fixed test by wiring up MessageHandler
* test cleanups
removed changeReturnType for MethodHandle as filterReturnValue already changes to return type of the filter
* fixed MessageReceivingTest.testPartialBinaryFrameHandler
* Core BatchMode replaced by boolean
* fixed LargeContainerTest.testEcho by allowing the policy to be set on the WSServer as an attribute
* acquire batchBuffer before calculating batchSpace in FrameFlusher
* Deprecated WebSocketPolicy
* Fixing MessageReceivingTest
* Refactoring out websocket-servlet
+ WebSocketPolicy removed from websocket-servlet
+ websocket-common is removed
+ Migrating back up to APIs
* WIP removing core policy
* added missing copyright headers
* customize client session
* customize cleanup
* wip
* wip
* Removing WebSocketPolicy usage within websocket-core
* Allowing DummyCoreSession to have a Behavior
* Removing core WebSocketPolicy.clonePolicy() - no longer used
* Jetty Native WebSocket now compiles / tests
* Remember WebSocketServletFactoryImpl as Context Attribute
* JSR356 codebase now compiles
* updated websocket servlets
* fix handling for no max message size
* Fixed LargeContainerTest.testEcho
Changed WebSocketServletFactoryImpl.defaultAutFragment to true
only check the incoming frame size if autoFragment is false
* Added WebSocketConstants to avoid duplicate default locations
* applications extensions discovered via headers
* fixed ConfiguratorTest.testNoExtensionsConfigurator
* cleaned up extension negotiation
* cleaned up extension negotiation
* cleanups
* Convert exceptions to API versions
* cleanup imports
* convert requestURI to a WebsocketURI in Negotiated
* fixed SessionTrackingTest
* moved session tracking management to be done by the JavaxWebSocketFrameHandler
* Cleanup dump for jdk11 classloaders
* fix to ConfiguratorTest
added the EchoSocket endpoint on the ServerContainer instead of using server.registerWebSocket
* Simplify websocket-servlet
fixed jetty websocket chat example
fixes for javax websocket chat example
fixed Upgrade response header issues
Set default configurations
improved dump
depends on javax server impl
do not expose core classes
fix javadoc
removed FrameHandlerFactory self reference
* Removed -impl from javax client and server
* Fixed common tests for onClosed event
* Improve creation of JavaxWebSocketServerContainer
Better handling of executor and httpClient as managed beans
* Fixed MessageOutputStream using empty buffers and looping forever
no longer enforce maxTextMessageBufferSize on partial messages
* Updates after review
reintroduced WebSocketServletFactory
reverted other API changes
* Ignored TextStreamTest tests incorrectly assuming no frame fragmentation
When message fragmentation is implemented in PartialStringMessageSink
then update these tests to check on the server side for no buffers
larger than the maxTextMessageBufferSize.
* fixed check for previous WebsocketUpgrade filter
Disable the AltFilterTest until problems of the WebSocketUpgradeFilter
attributes on the ServletContext are fixed.
* fixed flaky SessionTrackingTest by waiting for Sessions to open
* remove payload length check for outgoing frames
fix bug sending frames after they have failed validation checks
* reverted maven coords for javax client and server
* updated to latest jetty-10 dump changes
* Fix to WebSocketUpgradeFilter Attributes on the ServletContext
Removed deprecated method
WebSocketUpgradeFilter.configureContext(ServletContext)
Changed return type of
WebSocketUpgradeFilter.configureContext(ServletContext) to void.
WebSocketUpgradeFilter.configureContext was checking the ServletContext
for a WebSocketUpgradeFilter set as an attribute before creating a new
one. The FilterHolder from web.xml is being set as an attribute in init
which is called which happens after configureContext.
So instead of checking the attribute in
WebSocketUpgradeFilter.configureContext, we are now searching through
the filters on the ServletHandler to see if a WebSocketUpgradeFilter
has been registered with the CONTEXT_ATTRIBUTE_KEY.
* cleanup and identifying problems with FrameHandlerMetadata
* properly cache Metadata and copy MessageMetadata
properly cache Metadata in the FrameHandlerFactory using the metadataMap
copy the MessageMetadata from Metadata to prevent mutating the MethodHandle
* added new WebSocketServerContainerExecutorTest
removed DelayedStartClientOnServerTest which doesnt seem to be a valid
test when executors are shared
removed last check for executor==null in JavaxWebSocketServerContainerInitializer
as the threadPool is always created in the server
* reformatted websocket code
* reformat code
* Rervert unnecessary changes from 10.0.x
* Rervert unnecessary changes from 10.0.x
* fix build issues testing Hazelcast sessions
* QuotesDecoderTest sessions not being closed
* Fixed CookiesTest
CookiesTest.testCookiesAreSentToClient was failing due to the
Assertion being caught and logged by the upgrade request
the response is now captured by a FuturePromise and the assertions are
done in the main test
the reason the assertion was failing was due to lowercase "set-cookie"
instead of "Set-Cookie"
* fixed maven coords
* javadoc fixes
* fixed javadoc
* revert maven artifact names
* cleanup after review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Issue #3018 improve logging and handling of slow data rates.
* Slow data rates now result in aborted channels, but exception is still thrown. Test for 408 in requestLog
* Updated many RequestLog usages to use Server.setRequestLog rather than a RequestLogHandler
* Fixed javadoc
* removed BadRequestLogHandlerTest (tested in RequestLogTest)
* added JMH to show the future of request logging for #113
* copyright header.
* Updates from review
* Revert to throwing BadMessageException
* BME ensures a 408 is logged rather than a 500
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Cleanup the dump implementation
* improved the clarity of utility methods for dump and updated most dump methods
* fixed upgrade filter dump
* Improved dump after review
* Moved dumpObjects to Dumpable
* implemented dumpBeans with dumpObjects
* less verbose dump
* Dump streams
* fixed dump test
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Reviewed other possible places where max local stream count may
overflow.
Fixed handling of HTTP/2 stream idle timeouts.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
First pass at making Jetty 10.x require JDK 11.
* Removed JDK 8 modules (in particular ALPN and ALPN *.mod files).
* Removed profiles targeting JDK 8, 9 and 10.
* Updated dependencies to newer versions that support JDK 11.
* Temporarily commented out the Jetty Maven Plugins due to
maven-plugin-plugin not working with JDK 11.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Introduced --jpms option in jetty-start to run Jetty from the module-path.
Introduced [jpms] sections in *.mod files, to specify JPMS command line
options that needs to be added to the command line generated by jetty-start.
Bumped java.transaction-api to 1.3 because it has Automatic-Module-Name.
Fixed ASM version lookup using ManifestUtils.
Fixed WebInfConfiguration.findAndFilterContainerPaths() to properly
scan the module-path, which may contain both files and directories.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
- this will be a formal release once this issue has been
resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
due to bug https://github.com/junit-team/junit5/issues/801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration
junit 4 | junit 5 / jupiter
------------ | -----------
@Before | @BeforeEach
@After | @AfterEach
@BeforeClass | @BeforeAll
@AfterClass | @AfterAll
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
- this will be a formal release once this issue has been
resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
due to bug https://github.com/junit-team/junit5/issues/801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration
junit 4 | junit 5 / jupiter
------------ | -----------
@Before | @BeforeEach
@After | @AfterEach
@BeforeClass | @BeforeAll
@AfterClass | @AfterAll
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Issue #2711 - TLS 1.3 compliance.
Disabled few tests that are TLS 1.2 specific.
Renegotiation in SslConnection is now skipped for TLS 1.3.
Replaced SNI keystore DSA certificate with RSA certificate.
First full build achieved with JDK 11+28.
Small changes after review.
Modified the test case to pass in JDK 8, where the implementation
throws SSLException, while in later JDKs throws SSLHandshakeException.
Minor cleanup
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #2468 - Remove SoLinger.
For non-blocking sockets, StandardSocketOptions#SO_LINGER javadocs
report that the behavior is undefined. In JDK 11 setting SoLinger
for non-blocking sockets will be ignored.
As such, there is no point in allowing SoLinger to be configured
in Jetty that only uses non-blocking sockets.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Tests in SaveOptimizeTest were checking if the last time the SessionData had been saved was greater than it was before
if the second save occured on the same millisecond as the first it failed the assertion
now counting how many times the SessionData has been saved instead of when it was saved
Added memory barriers to TestContextScopeListener and TestSessionDataStore as they are being accessed from multiple different threads in the test
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Fixes#2616 - Trailers preventing client from processing all the data.
Trailer handling was erroneously firing the response success event
before all the response content events happened.
Now the trailer handling uses a poison-pill DATA frame to make sure that
all response content events happen before the response success event.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
HttpClient was confused by servers that responded
with two 100 Continue in the same HTTP conversation.
Now, whether the 100 Continue response has been handled
already is stored per-request, not per-conversation.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Support root base or home for quickstart #2446
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2446 - Root as base for quickstart
+ Adding more tests for differences we have to resolve
with windows vs linux root path differences.
and URI's that have an authority vs those without an authority.
without authority examples:
file:/code/
file:/C:/code/
with authority examples:
file:///code/
file:///C:/code/
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Using the canonical URI passes all the tests on linux, but I still have some concerns with the whole approach
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* minor cleanups
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Handle windows URIs
Because a windows like `file:///F:/` has a path of `/F:/`, then it is OK to strip the trailing `/`, so the
expected normalized value can be `file:///F:`.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
## SearchPattern
New class which does a fast search for patterns within strings and arrays of bytes using an implementation of the Boyer–Moore–Horspool algorithm. This was written to be used in the new MultiPartParser class to search for delimeter boundaries.
## MultiPartParser
New class which uses the SearchPattern to parse a MultiPart Mime given a ByteBuffer. Written in a non-blocking style so can be used asynchronously (although not currently be being used this way).
## MultiPartFormInputStream
New class which uses the MultiPartParser to parse a MultiPart Mime input stream into a Collection of Parts. This class is in org/eclipse/jetty/http and is designed to replace org/eclipse/jetty/util/MultiPartInputStreamParser.
## MultiPartInputStreamParser and Non Compliances
This class has been deprecated and replaced by org.eclipse.jetty.http.MultiPartFormInputStream. It accepts formats non compliant with the RFC that the new MultiPartFormInputStream does not accept. When this occurs violations are recorded by the method getNonComplianceWarnings().
## MultiParts
New interface to allow switching between the different implementations. This allows MultiParts to function in two different modes. The LEGACY implementation using the UTIL parser which may parse forms containing non compliances with the RFC, and the RFC7578 implementation using the new and faster HTTP parser. This file contains the implementations of MultiParts for HTTP and UTIL parsers as nested classes which are used by Request.
## Request
Changed to use the new MultiParts interface instead of the MultiPartInputStreamParser class. with a method called newMultiParts which will construct a MultiPart using one of the HTTP or UTIL implementations depending on what compliance mode is set.
## Jetty Test Webapp Dump Servlet
Code added to display parts while running the dump test webapp if MuliPart form is submitted.
## MultiPartBenchMark
JMH Benchmark of the HTTP multipart parser vs the UTIL multipart parser.
testLargeGenerated parses a 10MB file of random binary data.
testParser parses a series of small multipart forms captured by a browser.
```
# Run complete. Total time: 00:02:09
Benchmark (parserType) Mode Cnt Score Error Units
MultiPartBenchmark.testLargeGenerated UTIL avgt 10 0.252 ± 0.025 s/op
MultiPartBenchmark.testLargeGenerated HTTP avgt 10 0.035 ± 0.004 s/op
MultiPartBenchmark.testParser UTIL avgt 10 0.028 ± 0.005 s/op
MultiPartBenchmark.testParser HTTP avgt 10 0.015 ± 0.006 s/op
```
* Issue #2231 WIP
* Issue #2231 Add tests for FileSessionDataStore and MongoSessionDataStore.
* Issue #2231 create unit tests for every SessionDataStore
Signed-off-by: Jan Bartel <janb@webtide.com>
* Issue #2231 Refactor session tests
Signed-off-by: Jan Bartel <janb@webtide.com>
* Issue #2231 Refactor and cleanup session tests.
Signed-off-by: Jan Bartel <janb@webtide.com>
* hazelcast tests faster
Signed-off-by: olivier lamy <olamy@webtide.com>
* make hazelcasts tests even faster
Signed-off-by: olivier lamy <olamy@webtide.com>
* cleanup comments
Signed-off-by: olivier lamy <olamy@webtide.com>
* run mongodb test in embdedded mode
Signed-off-by: olivier lamy <olamy@webtide.com>
* mongodb embedded test enabled per default
Signed-off-by: olivier lamy <olamy@webtide.com>
* Issue #2231 more session tests
Signed-off-by: Jan Bartel <janb@webtide.com>
* fix mongodb embedded tests
Signed-off-by: olivier lamy <olamy@webtide.com>
* cleanup code
Signed-off-by: olivier lamy <olamy@webtide.com>
* use Logger rather than System.err.println
Signed-off-by: olivier lamy <olamy@webtide.com>
* Issue #2231 Add test for DefaultSessionCache
Signed-off-by: Jan Bartel <janb@webtide.com>
* Issue #2231 Redisable mongo tests by default.
Signed-off-by: Jan Bartel <janb@webtide.com>
* fix issue with empty local repo build
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* jenkins should run mongodb tests
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* build this plugin last so we should not hit the maven invoker plugin
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* build test first for this one
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* use invoker plugin 3.0.2-SNAPSHOT as there is a fix for https://issues.apache.org/jira/browse/MINVOKER-191
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* temporary use of apache snapshots repository because of maven-invoker-plugin 3.0.2-SNAPSHOT
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Introduced ConnectionPool.Multiplexable for connection pools that support multiplexing.
Reworked RoundRobinConnectionPool to support multiplexing.
Moved tests to test RoundRobinConnectionPool with both HTTP/1.1 and HTTP/2.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
- Speculative fix to ensure that the users of the jetty-distribution
do not require the test artifacts to utilize the tarball / zip files
- Also disabled the snapshot repository as it causes false success
- Adding now unreferenced dependency
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ Testing deploy modes: [Initial, Delayed]
"Initial" is a deploy where the webapps exist
in the monitored directory at startup.
"Delayed" is a deploy where the Server is already
started when a new webapp is added to the monitored
deployment directory.
+ Webapp types: [Unavailable: True, False]
This is the WebAppContext.isThrowUnavailableOnStartupException
setting.
+ New DeploymentManager Node[FAILED] to assign to webapps that
fail the deployment during the "Delayed" deployment scenario.
Useful as a binding for hooking into failed deployments.
There are still problems with this impl (some client tests ignored) and there is still a work around for the JNR bug 50, however this impl is already much better than the unix socket support that is already in the release. So will merge for now and put more effort in once there is a JNR fix.
* WIP add unix domain sockets support in HttpClient
* move unix socket client part to unix socket module #2014
* some cleanup #2014
* add missing headers #2014
* add TODO
* UnixSocket client refactor
* cleanup test and pom
* minor changes, use LOG.isDebugEnabled() before using debug method
* add UNIX SOCKET http client test with all other tests, push this to see what happen on Jenkins
* fix some unit tests
* fix more tests
* fix load test
* UnixSocket client
* Demonstrate JNR bug
* Worked around JNR bug 50
* close channel on client side as well
* more details in log
* log file path as well
* #2014 disable test per default as doesn't work on some environement
* Revert "#2014 disable test per default as doesn't work on some environement"
* test only on unix
* Allow test of specific transport(s)
* Move unix socket to /tmp
* move test socket to /tmp
* move test socket to /tmp
* ignore failing tests for now
* fix bean name and possible to use sys prop org.eclipse.jetty.http.client.AbstractTest.Transports with mvn cli
* test isBlank as surefire props is not null
* correctly create tmp file with @Before
* do not delete file
* use /tmp as build directory doesn't seem to work within docker...
* do not delete sock file on client as it is own by the server
* file must not exist when binding unix socket
* #2014 fix license header
* network specific tests assumed
* Fixed to handle null selector keys
* add assume for tests that assume a network connector
Signed-off-by: olivier lamy <olamy@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
+ AbstractLifeCycle.setFailed(Throwable) is now protected, so
that the odd usages from WebAppContext.doStart() can be supported
+ The AbstractLifeCycle.doStart() now checks for state == FAILED
* Scalable scheduler changes for #1918
* Added HttpChannel.destroy to destroy CyclicTimer
* fixed rebase with HttpConnectionOverFCGI
* renamed to acquire
* Destroying the HttpChannel consistently in all transports.
* updated headers
* cleanup after final review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Removed the distinction between pushed and non-pushed channels; only
non-pushed channels are released and recycled if they're not failed.
Properly resetting HttpReceiverOverHTTP2.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Issue #2081 No idle timeout exception when dispatch is delayed
* Delegate the readtimeout handling to HttpChannel so that a delayed dispatch can be ended.
* Added unit test for delayed dispatch idle
* Now using HttpInput.onIdleTimeout() to fail the HttpInput, and then dispatching the request in case it has not been dispatched yet. This ensure consistent behavior independently of the value of HttpConfiguration.delayDispatchUntilContent.
* Fixed for both HTTP/1.1 and HTTP/2.
* Added tests for non-blocking reads.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Code cleanups.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Improved test case handler.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Improved exception message.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #1973 - Implement minimum response data rate.
Implemented response content data rate control in HttpOutput.
Introduced a WriteFlusher.Listener interface that produces events
for every flush(). These events are forwarded to the Connection
and from there to the HttpOutput so that the data rate control can
be enforced.
Both HTTP/1.1 and HTTP/2 are implemented.
Data rate control for HTTP/1.1 is approximate because it will count
also headers bytes and the chunk bytes, while for HTTP/2 is precise.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #1973 - Implement minimum response data rate.
Addressed review comments.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: olivier lamy <olamy@webtide.com>
use a randomized map name to store sessions in order to avoid conflicts
Signed-off-by: olivier lamy <olamy@webtide.com>
reduce hazelcast logging noise
Signed-off-by: olivier lamy <olamy@webtide.com>
clarify onlyClient mode
Signed-off-by: olivier lamy <olamy@webtide.com>
Session.getMaxInactiveInterval should return a negative number if the
the session is configured with a negative maxInactiveInterval. It was
being rounded up to 0 by mistake.
Signed-off-by: Dan Smith <upthewaterspout@apache.org>
Made sure that when compiling with JDK 9 we actually use a JDK 8 runtime.
Updated the Maven Compiler Plugin to latest version, with support for
JDK 9 --release command line.
Removed unnecessary Maven Compiler Plugin declarations in POMs.
Idle timeout have a special meaning in that they become a no-operation
if the application is dispatched but idle (neither reading nor writing).
HttpChannelOverHTTP2 now forwards the idle timeout to HttpInput, which
will only change its state if it is interested in reading.
HttpInput.consumeAll() has been modified to consume all input even if
it's already failed.
Failures caused by the other peer (e.g. I/O failures or stream resets)
are now retained and will eagerly consumed any queued data to free up
the flow control windows.
Introduced ConnectionPool.Factory and HttpClientTransport.connectionPoolFactory.
This allows applications to create a ConnectionPool given the HttpDestination.
Introduced ConnectionPool.Factory and HttpClientTransport.connectionPoolFactory.
This allows applications to create a ConnectionPool given the HttpDestination.
Changed the semantic of null or empty address to refer to the local host.
Any address is specified with 0.0.0.0.
Commented out JmxIT tests as they are broken.
Improved attempt to send a response in case of a failure while trying
to perform the error dispatch.
Fixed tests to use AbstractHandler.ErrorDispatchHandler.
+ Fixing HashLoginService to track its Config via File reference only
(dropping support for URL reference)
+ Adding new `this.web-inf.path` property that jetty-web.xml can use
Fixed by calling tryFillInterested() rather than fillInterested() to
cope with the race between reads scheduling read interest and
setWriteListener() that also executes code in
HttpChannelState.unhandle() that wants to schedule read interest.
+ Upgrading to jetty-test-helper 4.0
+ Removing use of org.eclipse.jetty.toolchain.test.SimpleRequest
+ Removing use of org.eclipse.jetty.toolchain.test.http.SimpleHttpParser
+ Removing use of org.eclipse.jetty.toolchain.test.http.SimpleHttpResponse
+ Updating long since deprecated (and now removed) known quirky methods
in jetty-test-helper and the test classes.
* Updated Maven plugins to versions that support JDK 9.
* Added jdk9 profiles to the build files.
* Introduced modules jetty-alpn-java-client and jetty-alpn-java-server
containing a pure JDK 9 implementation of ALPN.
* Wired ALPN connection factories (client and server) to use the proper
ALPN implementation based on the JDK platform version (8 or 9).
Removed wake() call from within pollContent
Instead the EOF status is evaluated :
- when setReadListener is called
- when read returns -1
- when run() is called before calling either onDataAvailable or onAllDataRead
Squashed commit of the following:
commit 6a345356998331a90e60c7ee8ee590920464c72f
Merge: 92bc0e9 60d9001
Author: Greg Wilkins <gregw@webtide.com>
Date: Mon Nov 7 09:46:23 2016 +1100
Merge branch 'jetty-9.4.x' into jetty-9.4.x-issue-1074
commit 92bc0e9f3aafdce2f4aa7b2fde31affc942be042
Author: Greg Wilkins <gregw@webtide.com>
Date: Sat Nov 5 18:24:00 2016 +1100
Issue #1074
Do not do async IO callbacks if completed
commit ee220a12d1e6c5f6e39b4597a209c5043aa775cf
Author: Greg Wilkins <gregw@webtide.com>
Date: Sat Nov 5 16:22:55 2016 +1100
Issue #1074
Turned off debug
improved proxy test to be able to run with debug on
commit e2fb0b9ef1ec422a2c82cb388820581e359234ba
Author: Greg Wilkins <gregw@webtide.com>
Date: Sat Nov 5 15:37:27 2016 +1100
Issue #1074
Improved test cases
Handle early EOF
commit 3c47c022fe7e48f82e41d9a208073b64cfeb5af7
Author: Greg Wilkins <gregw@webtide.com>
Date: Sat Nov 5 12:28:15 2016 +1100
provisional implementation
Removed a lot of bad tests that incorrection assumed it was OK to mix Paths and URIs like:
jar:file:${jetty.base}/webapps/some.war!/some/path
refactored to keep PathAttributes and URIAttributes separate