Commit Graph

15590 Commits

Author SHA1 Message Date
olivier lamy e6f02b578a add jdk10 in jenkinsfile
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2018-04-06 10:38:49 +10:00
Jan Bartel 09bfb77e5f
Issue #2409 Ensure no duplicate config classes in osgi (#2416)
Signed-off-by: Jan Bartel <janb@webtide.com>
2018-04-06 09:18:47 +10:00
Joakim Erdfelt be3c5a08d0 Reducing noise on test output 2018-04-05 16:33:40 -05:00
Joakim Erdfelt ab9c3f5f1d
Merge pull request #2395 from eclipse/jetty-9.4.x-issue-2391-json-slashuencoding
Issue #2391 - JSON string encoding fix
2018-04-05 10:40:39 -05:00
Joakim Erdfelt 46c5824e7a Issue #2391 - JSON Solidus is optional for escaping
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2018-04-05 09:13:37 -05:00
Joakim Erdfelt 4d7ac53d7f
Merge pull request #2414 from eclipse/jetty-9.4.x-issue-2413-server-timestamp
Issue #2413 - Using Instant.toString() to be consistent with timestamp
2018-04-05 05:39:07 -05:00
Jan Bartel 72404d15d6 Make mavenRepoPath system property optional for osgi tests 2018-04-05 14:02:38 +10:00
Joakim Erdfelt ceded0bbae Issue #2413 - Using Instant.toString() to be consistent with timestamp
Example output:

JDK 8:

2018-04-04 22:30:25.578:INFO:oejs.Server:main: jetty-9.4.10-SNAPSHOT; built: 2018-04-04T22:22:03.202Z; git: 2b32f82aeb64acc6105c08d8a7a141279f8b91d0; jvm 1.8.0_131-b11

JDK 9:

2018-04-04 22:29:39.035:INFO:oejs.Server:main: jetty-9.4.10-SNAPSHOT; built: 2018-04-04T22:22:03.202Z; git: 2b32f82aeb64acc6105c08d8a7a141279f8b91d0; jvm 9+181

JDK 10:

2018-04-04 17:29:07.568:INFO:oejs.Server:main: jetty-9.4.10-SNAPSHOT; built: 2018-04-04T22:22:03.202Z; git: 2b32f82aeb64acc6105c08d8a7a141279f8b91d0; jvm 10+46

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2018-04-04 17:32:20 -05:00
Joakim Erdfelt 5cab0ccd5f Issue #2391 - JSON string escaping fix + override
+ all string escaping now done in JSON.escapeString()
+ special override JSON.escapeUnicode() available for
  those that want to use optional Unicode escaping.
  javadoc indicates one way to accomplish this.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2018-04-04 12:40:07 -05:00
Joakim Erdfelt 2b32f82aeb
Merge pull request #2393 from eclipse/jetty-9.4.x-issue-2337-ws-subprotocols
Issue #2337 - slightly more efficient getSubProtocols() behavior
2018-04-04 06:22:17 -05:00
Joakim Erdfelt 9147e408c8
Merge pull request #2392 from eclipse/jetty-9.4.x-issue-2387-uriutils-jarfile
Issue #2387 - fixing URIUtil.equalsIgnoreEncoding() with jar:file:// uris
2018-04-04 06:16:35 -05:00
Greg Wilkins c41b6b7aab
Merge pull request #2332 from eclipse/jetty-9.4.x-1027-Multipart
## 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
```
2018-04-04 17:30:36 +10:00
Jan Bartel 16e625adde
Issue #2109 remove warnings for unused imports and exports (#2390)
Signed-off-by: Jan Bartel <janb@webtide.com>
2018-04-04 12:06:43 +10:00
Lachlan Roberts 92f44389b9 fixed value of public static String __MULTIPARTS
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-04-04 12:00:11 +10:00
Lachlan Roberts 4a0e4294b9 fixed path of MultiPartFormDataCompliance in jetty.xml
added some debug info
changes to jetty test webapp to display parts from multi-part forms

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-04-04 11:18:57 +10:00
Lachlan Roberts 379a8d6928 Merge remote-tracking branch 'eclipse/jetty-9.4.x-1027-Multipart' into jetty-9.4.x-1027-Multipart 2018-04-04 09:48:01 +10:00
Lachlan Roberts 1c35324f5b Fixed some javadoc errors and warnings
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-04-04 09:46:50 +10:00
Greg Wilkins 9397ae2d77 revert ResourceHandlerTest changes
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-04-04 09:10:57 +10:00
Greg Wilkins 85f300d264 fixed javadoc warning
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-04-04 08:50:03 +10:00
Greg Wilkins 6528b79fbd Merge branch 'jetty-9.4.x-1027-Multipart' of github.com:eclipse/jetty.project into jetty-9.4.x-1027-Multipart 2018-04-04 08:08:59 +10:00
Joakim Erdfelt 3b32e1c984 Issue #1027 - MultiPartCaptureTest cleanup
+ Regenerated many of the captures
  - Better SJIS Encoding Test Samples
+ Added more
  - file consisting of only random whitespace
  - file with 1 very long line
  - Jetty Http Client captures

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2018-04-03 14:55:38 -05:00
Lachlan Roberts 81ff77108c Moved the MultiParts interface and implementations from Request into new file MultiParts.java
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-04-03 23:55:08 +10:00
Lachlan Roberts 1eec234336 Minor changes after review by gregw.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-04-03 21:22:16 +10:00
Olivier Lamy 42d9da56c0
use maven annotations for jetty plugins #2404 (#2400)
* use maven annotations for jspc mojo

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* use maven annotation for jetty-maven-plugin

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2018-04-03 17:30:25 +10:00
Lachlan Roberts b3d5333d42 Implemented switch between LEGACY and RFC7578 modes. Added tests to check this worked correctly.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-04-03 16:13:19 +10:00
Lachlan Roberts 95cd6e0614 Merge remote-tracking branch 'eclipse/jetty-9.4.x-1027-Multipart' into jetty-9.4.x-1027-Multipart
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-04-03 15:33:56 +10:00
Lachlan Roberts 13b15e3566 Resolved Charset Issues and Reworked Request.MultiPartInputStream
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>
2018-04-03 15:24:54 +10:00
olivier lamy 8ec1504279 #2152 add servlet api sources as well
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2018-04-03 15:24:42 +10:00
Greg Wilkins 48edc7305b Merge remote-tracking branch 'lachlan/jetty-9.4.x-1027-Multipart' into jetty-9.4.x-1027-Multipart 2018-04-03 14:12:19 +10:00
Lachlan Roberts be2d6ebb29 Merge remote-tracking branch 'eclipse/jetty-9.4.x' into jetty-9.4.x-1027-Multipart 2018-04-03 12:36:54 +10:00
Mat Booth c316cf1cfe Make the requirement on "osgi.serviceloader.processor" optional (#2377)
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>
2018-04-03 12:25:50 +10:00
Greg Wilkins 87498220bc Added a multipart form-data compliance configuration
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-04-03 10:49:03 +10:00
Jan Bartel b53fbe01ab Issue #2401 Fix documentation for osgi webapp bundle 2018-04-03 10:35:34 +10:00
Greg Wilkins 426fb955f8 extra debug for #2205
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-04-03 08:59:56 +10:00
Lachlan Roberts b196596055 Replaced usages of MultiPartInputStreamParser to Request.MultiPartInputStream which provides runtime switching between old and new parser.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-03-30 19:16:59 +11:00
Simone Bordet 072442a5e5 Fixes #2225 - Test failure: StreamResetTest.testBlockingWriteAfterStreamReceivingReset.
The problem was caused by the reset arriving to the server
_before_ the commit callback was invoked.
Now waiting for the commit callback to complete before
sending the reset to the server.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-03-29 12:31:44 +02:00
Lachlan Roberts c418297db6 Minor cleanups
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-03-29 18:04:42 +11:00
Lachlan Roberts 8a8324cb18 Completed benchmark for UTIL vs HTTP multipart parser. Fixed some tests in MultiPartCaptureTest.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-03-29 16:29:48 +11:00
WalkerWatch e6eac94898 Fixed broken documentation links. 2018-03-29 00:13:34 -04:00
Simone Bordet d68c286499 Fixes #2145 - Enabled h2, http/1.1 + https failed with invalid preface.
Now using HttpVersion.HTTP_1_1::is, which is case insensitive,
to find the default protocol among the negotiated protocols.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-03-28 19:55:58 +02:00
Joakim Erdfelt 8bf695bf49 Issue #2337 - slightly more efficient getSubProtocols() behavior
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2018-03-28 11:16:10 -05:00
Joakim Erdfelt c5d4897a5f Issue #2387 - fixing URIUtil.equalsIgnoreEncoding() with jar:file:// uris
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2018-03-28 10:48:28 -05:00
Joakim Erdfelt 464b74ed60
Merge pull request #2385 from eclipse/jetty-9.4.x-issue-987-gzipcheck-disable
Issue #987 - move checkGzExists default to false
2018-03-28 07:13:41 -05:00
Jan Bartel b4e400f236 Jetty 9.4.x 2231 refactor session tests (#2382)
* 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>
2018-03-28 20:14:15 +10:00
Simone Bordet a28ec963d1 Issue #2388 - AtomicBiInteger.compareAndSet(long,int,int) not using encoded parameter.
Using capital 'L' for long literals to avoid confusion with '1'.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-03-28 11:36:50 +02:00
Simone Bordet 8cf15659be Issue #2349 - Review HTTP/2 max streams enforcement. (#2389)
* Issue #2349 - Review HTTP/2 max streams enforcement.

Changed the max concurrent remote streams enforcement algorithm.
It is now based on the stream count and the closing stream count,
updated atomically in a state machine in HTTP2Stream.

Fixed Javadoc.

Fixed close() method.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-03-28 13:10:11 +11:00
Greg Wilkins 56fc71a54a fix sign extension #2388
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-03-28 11:05:49 +11:00
Simone Bordet ef48bc6f58 Fixes #2388 - AtomicBiInteger.compareAndSet(long,int,int) not using encoded parameter.
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>
2018-03-28 00:37:21 +02:00
Joakim Erdfelt 23788dba65 Issue #987 - move checkGzExists default to false
+ Flag existing methods / fields as deprecated
+ Indicate removal in Jetty 10.x

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2018-03-27 12:37:12 -05:00
Olivier Lamy 6821506985 add list of supported packaging for run mojos #2372 (#2375)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2018-03-27 17:45:00 +11:00