* Issue #2439 - Remove HTTP/2 data copy.
Implemented reference counting for the network buffer, with the
semantic that calling succeeded() on callbacks decrements the
reference count.
Introduced interface Retainable, used by the client when notifying
multiple application content listeners.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
+ Adding removeThread(Thread) to allow instrumentation
libraries to track removal of threads from Pool.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Fixes#2468 - EWYK concurrent production.
Fixed the case when a task throws an exception, which causes
the thread that ran the task to continue production, even
when it should not.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Now explicitly using a _mappedBuffer field in
CachedContentFactory.CachedHttpContent.
Deprecated BufferUtil.isMappedBuffer().
Signed-off-by: Simone Bordet <simone.bordet@gmail.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
```
Changed Request.MultiPartInputStream to an interface called MultiParts where there is an implementation for both the HTTP and UTIL parsers.
Resolved some issues with default charsets in regards to request.setCharacterEncoding and the _charset_ part for issue #2398.
Changed HTTP parser to operate the same as UTIL parser in situtions with parts not of type form-data or without name field. HTTP parser was ignoring these parts, UTIL parser was throwing exceptions.
Replaced the context attribute with a field in MultiParts.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This allows Eclipse to continue to make use of jetty-* bundles
without requiring the presence of Apache Aries.
This fixes a problem introduced by the resolution to #2164 and
the same solution is used as in 10cdf16
See also the discussion at Eclipse:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=532294
Signed-off-by: Mat Booth <mat.booth@redhat.com>
Fixed method, added Javadocs and cleaned up code with a few renamings
to better comply with AtomicLong naming.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Modified tests in new MultiPartInputStreamTest which were failing because they didn't comply with RFC.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
the --task was not protected with a memory barrier, so different producing threads could contend on the field.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
For #2284 no longer parse the optional detail of the java version.
Parse failures will result in a guessed JVM platform 8
Signed-off-by: Greg Wilkins <gregw@webtide.com>