Commit Graph

1508 Commits

Author SHA1 Message Date
Joakim Erdfelt abbccc65d6 Updating to version 9.4.23.v20191118 2019-11-18 13:09:44 -06:00
Greg Wilkins b24c6ce68d
Issue #2340 ServletContext cleanup (#4307)
* Issue #2340 ServletContext cleanup

A minor cleanup of the ServletContext implementation classes.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2340 ServletContext cleanup

cleanup after review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-14 11:52:03 +11:00
Joakim Erdfelt 1ed13b6b30 Updating to version 9.4.23-SNAPSHOT 2019-10-22 09:19:41 -05:00
Joakim Erdfelt b1e6b55512 Updating to version 9.4.22.v20191022 2019-10-22 08:20:50 -05:00
Greg Wilkins 2ee874a8ac Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-4191-min-gzip-size
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 22:00:52 +11:00
Greg Wilkins 1881683726 Issue #4191 Min GzipSize
updates from review in absence of OP.
Make break even size a warning rather than a hard limit.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 16:22:14 +11:00
Greg Wilkins 73924d2774
Issue #4188 Spin in close of GzipHandler (#4198)
* 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>
2019-10-16 14:12:52 +11:00
Greg Wilkins 2eb251a4b8 fix logging defaults to INFO
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 13:53:57 +11:00
Joakim Erdfelt 9c49b03806
Adding missing license header
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-10-15 13:32:59 -05:00
Joakim Erdfelt 0fbb507841
Issue #4191 - GzipHandler.minGzipSize cannot be lower then 23.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-10-14 13:21:01 -05:00
Greg Wilkins 1c5a53a512 test async gzip close
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-08 18:14:17 +11:00
Joakim Erdfelt 7d533bdabc
Adding missing copyright header.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-10-01 17:30:24 -05:00
Joakim Erdfelt 0a5c710bdd
Fixes #4141 - Servlet not async + async Filter + wrapped request
+ Fixing ClassCastException

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-10-01 17:24:27 -05:00
Joakim Erdfelt 7807eafad9 Updating to version 9.4.22-SNAPSHOT 2019-09-26 10:46:28 -05:00
Joakim Erdfelt 72970db61a Updating to version 9.4.21.v20190926 2019-09-26 09:59:15 -05:00
Joakim Erdfelt 39c230f294
Merge pull request #4083 from eclipse/jetty-9.4.x-97-Unavailable
Issue #97 ServletHolder unavailable handling
2019-09-13 09:58:09 -05:00
Greg Wilkins ae0ab46066 Issue #97 Unavailable handling
Added test for servlet component lifecycle
Fixed bug where we were destroying listeners before calling them.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-13 11:40:11 +10:00
Greg Wilkins d48c258deb Issue #97 ServletHolder unavailable handling
Took the opportunity to do a major cleanup of the Holders.
ServletHolder now uses wrapping to achieve optional behaviour rather than lots of if statements.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-12 17:56:09 +10:00
Joakim Erdfelt 43e10f8a5e
Merge pull request #4056 from eclipse/jetty-9.4.x-testing-embedded-examples
Unit Testing the Embedded Examples
2019-09-11 09:20:10 -05:00
Jan Bartel f90a07371c Issue #4022 Add extra ServletRegistration tests & checkstyle fixes 2019-09-10 10:24:58 +10:00
dreis2211 597458df7c Tolerate multiple Accept-Encoding headers in GzipHandler
Signed-off-by: dreis2211 <christoph.dreis@freenet.de>
2019-09-08 01:44:05 +02:00
Joakim Erdfelt 7618eae915 Issue #4064 - MinimalServlets test and ServletHolder fix
+ Also made ContextHandler warning message about features
  that are unimplemented (and you should use ServletContextHandler)
  more clear. (this helped with diagnosing where the bug was
  in ServletHolder)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-06 09:26:06 -05:00
康智冬 49ba6d1acb fix typo and grammar (#4045)
Signed-off-by: KangZhiDong <worldkzd@gmail.com>
2019-09-02 14:29:50 -04:00
Jan Bartel 4251a3e092
Issue #4022 Prevent Servlet adding another Servlet (#4024)
* Issue #4022  Prevent Servlet adding Servlet and added unit tests.

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-28 12:29:14 +10:00
Greg Wilkins 1f189d4618 fixed test visibility for JPMS
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 14:30:03 +10:00
Jan Bartel 19980ceeb5
Issue #4009 ServletContextHandler setSecurityHandler broke handler chain (#4012)
* Issue #4009 ServletContextHandler setSecurityHandler broke handler chain

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-27 11:00:09 +10:00
Greg Wilkins bde86467f4
Issue #3806 - Make Async sendError fully Async (#3912)
* 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>
2019-08-26 17:55:58 +10:00
Joakim Erdfelt 1867d24ef7
Merge pull request #4001 from eclipse/jetty-9.4.x-4000-swedish-unicode-file-serving
Issue #4000 - new SameFileAliasChecker to help with NFC/NFD UTF-8 differences
2019-08-23 07:27:32 -05:00
Olivier Lamy fe3d3f7158
fix checkstyle in test sources (#4013)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-22 19:56:41 +10:00
Joakim Erdfelt 30bd3914cf Issue #4000 - SameFileAliasChecker to help with NFD/NFC
+ 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>
2019-08-21 12:21:04 -05:00
Joakim Erdfelt ef3f696a11 Issue #4000 - PathResource alias detection work around alt UTF-8 style
+ 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>
2019-08-19 13:52:22 -05:00
Joakim Erdfelt f1efc99918 Updating to version 9.4.21-SNAPSHOT 2019-08-13 17:34:20 -05:00
Joakim Erdfelt 84700530e6 Updating to version 9.4.20.v20190813 2019-08-13 16:13:21 -05:00
Greg Wilkins 699f832632 Fixed test for symlinked directory
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-12 17:21:49 +10:00
Greg Wilkins bf1ece938f Issue #3804
more review changes

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-09 08:20:27 +10:00
Greg Wilkins eb4be618ee Issue #3804
more review changes

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-08 19:03:59 +10:00
Simone Bordet 42815a781b Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Updated code to reflect reviews.
Now lookup of system properties and server attributes is done in
ContextHandler.doStart(), so that the getter always return the
actual value (and this is good for JMX too).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-02 19:12:49 +02:00
Simone Bordet 2629961e74 Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Changes after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-23 22:01:13 +02:00
Simone Bordet d939c9435a Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Fixed zero checks and exception messages.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-23 15:44:08 +02:00
Jan Bartel bb7fb48f08
Fix checkstyle warnings for tests. (#3846)
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-07-03 16:42:20 +02:00
Jan Bartel e26179e8e9
Issue #3799 Programmatic listeners from ServletContextListeners. (#3824)
* Issue #3799 Programmatic listeners from ServletContextListeners.

Ensure programmatic listeners added from ServletContextListeners are
called.

Signed-off-by: Jan Bartel <janb@webtide.com>

* Issue #3799 add distribution test

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-07-01 15:14:19 +02:00
Greg Wilkins 9706d70484
Jetty 9.4.x reformat (#3811)
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Applying XML restyling
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Reformatting pom.xml files
* Fixed empty string from line wraps
* Update intellij style to not do expression relative formatting. Reformatted code based on that.
* Increasing line split on Eclipse IDE Formatter to 512
* Restoring setting on internal default value.
+ IntelliJ will not export settings on things that set to their
  internal default values.
  We want to keep those values as a hedge against future default
  value changes in future releases of IntelliJ.
* Fixing intellij codestyle
* do not allow single line simple methods
* misc checkstyle fixes
* re-exported with correct name and all values

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-24 17:40:30 +02:00
Joakim Erdfelt 49ee5ac3c0 Merge branch 'jetty-9.4.x' into 'jetty-9.4.x-websocket-sci-from-embedded' 2019-06-14 08:23:42 -05:00
Joakim Erdfelt 40e9e053b9
Merge pull request #3768 from eclipse/jetty-9.4.x-3708-stringutil-replace
Issue #3708 - use StringUtil alternatives for known slow JVM impls.
2019-06-13 14:01:35 -05:00
Joakim Erdfelt 877815e195 Issue #3708 - Adding new methods and converting codebase to use them
+ StringUtil.replace(String, char, char)
+ StringUtil.strip(String, String)
+ URIUtil.encodeSpecific(String, String)
+ URIUtil.decodeSpecific(String, String)
+ TypeUtil.toClassReference(Class)
+ TypeUtil.toClassReference(String)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-12 09:56:41 -05:00
Joakim Erdfelt 776c093b70 Merge branch 'release-9.4.19' into jetty-9.4.x 2019-06-12 06:44:27 -05:00
Greg Wilkins 819c379975
Servlet Context/Handler/Holder cleanups (#3767)
Issue #3749 #3755 Servlet annotation cleanups
Cleanups when checking thread safety of lazy servlet/filter introspection.

 + Handle multiple holders for annotated servlets
 + Replaced duplicate code with common methods

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-12 08:00:01 +02:00
Joakim Erdfelt 33fe55c339 Issue #3708 - use StringUtil alternatives for known slow JVM impls.
+ StringUtil.replace()
+ StringUtil.replaceFirst()
+ StringUtil.sanitizeFileSystemPath()

Change existing usages of String.replace() to either
use new StringUtil.replace() or other methods elsewhere
that better suit that specific need.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-11 11:25:50 -05:00
Joakim Erdfelt ae21126cad Updating to version 9.4.20-SNAPSHOT 2019-06-10 13:40:17 -05:00
Joakim Erdfelt afcf563148 Updating to version 9.4.19.v20190610 2019-06-10 11:17:56 -05:00