Commit Graph

4026 Commits

Author SHA1 Message Date
Greg Wilkins 3d19f61122
Issue #4193 - Fix InetAccess port control (#4206)
* issue exclude/include con name InetAccesHandler - add better unit test

this logic:

        String name =
baseRequest.getHttpChannel().getConnector().getName();
        return _names.test(name) && _addrs.test(addr);

Is not correct. it's treating the connector name exactly like the
filter. But that's not what it's intended to do. It's supposed to tell
what connectors are applicable to this filter. And what connectors are
not affected.

For example in the unit test there exists 2 connectors:

http
tls

We want to restrict the http connector, but we want to leave tls
connector alone.

So we would specify:

include = 192.168.1.1-192.168.1.254
includeConnector = http

The way the logic is above, it is treating the connector name as if it's
the filter itself. Which is not what I intended.

What i need in psuedo-code is this:


   if (there are no "include connectors" OR if this connector is
included) AND (if this connector is not in the excluded list)
     ---> Then apply the IP filter.

Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>

* exclude should take precedence over include

Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>

* Issue #4193 InetAccessHandler

reverted changes to IncludeExcludeSet

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

* Issue #4193 InetAccessHandler

updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-18 09:03:28 +11:00
Greg Wilkins 894fc9b115
Issue #4208 - Content-Length in 304 (#4211)
* Issue #4208 Content-Length in 304

Added tests for RFC7230 section 3.3.2 for 304 and HEAD responses with content length.
Fixed HttpGenerator to set content-length in 304 response
Fixed insufficient content written check for 304

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

* Issue #4208 Content-Length in 304

Use contentLengthField

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-17 14:26:19 +11:00
Simone Bordet 329b819d72 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-10-16 23:36:47 +02:00
Simone Bordet 869184c827
Merge pull request #4200 from eclipse/jetty-9.4.x-4190-deadlock_httpoutput_close
Fixes #4190 Jetty hangs after thread blocked in SharedBlockingCallbac…
2019-10-16 23:35:52 +02:00
Joakim Erdfelt 8c928e0fd1
Merge branch 'jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java
2019-10-16 15:31:09 -05:00
Greg Wilkins 7cc552013e Issue #4191 Min GzipSize
updates from review from OP.
reverted static DEFAULT_MIN_GZIP_SIZE

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 22:07:51 +11: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 031df2bd2e simplified javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 18:19:22 +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 f4d9223762 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 14:16:44 +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
Jan Bartel 92c8bb8dd5
Issue #4158 Re-enable support for duplicate session cookies. (#4168)
* Issue #4158 Re-enable support for duplicate session cookies.

Signed-off-by: Jan Bartel <janb@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 14:08:51 +11:00
Greg Wilkins 8f1975cc04 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 14:00:22 +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 fa25d560b3
Fixing typo
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-10-15 13:52:39 -05:00
Simone Bordet 6b26ac9ee9 Fixes #4190 Jetty hangs after thread blocked in SharedBlockingCallback.block() called by HttpOutput.close.
Now releasing the buffer when in CLOSING state.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-15 15:47:03 +02:00
Simone Bordet a0e90bab96 Fixes #4190 Jetty hangs after thread blocked in SharedBlockingCallback.block() called by HttpOutput.close.
Now handling correctly the CLOSING case in HttpOutput.close().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-15 12:45:10 +02: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 f09e03c586
Issue #4156 - Session Already in Cache during forwarding (#4159)
* Issue #4156 - Adding test to replicate issue

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4156 Session already in cache

+ check validity of sessions in getSession(SessionHandler)
+ do not replace session in doScope if SessionHandler is the same.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-14 11:18:37 +11:00
Simone Bordet 20e70c147b Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-10-10 12:45:53 +02:00
Simone Bordet ec56739d3c
Merge pull request #4180 from eclipse/jetty-9.4.x-4179-SendCallback-gc
Issue #4179 SendCallback GC
2019-10-10 12:45:30 +02:00
Simone Bordet 4e69122537 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-10-10 11:02:32 +02:00
Greg Wilkins ce41c122a6
Issue #4176 setHeader after sendError (#4181)
* Issue #4176 setHeader after sendError

SendError now makes the response immutable for headers and status.

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

* Issue #4176 setHeader after sendError

cleanup after review
better names

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

* Issue #4176 setHeader after sendError

better name

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

* Issue #4176 setHeader after sendError

even better name

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-10 19:35:28 +11:00
Greg Wilkins faac5d7f04 Issue #4179 SendCallback GC
The HttpConnection.SendCallback nulls it's reference to buffers and callbacks after completion to assist with easy GC, since the connection callback is a long lived instance.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-10 09:09:53 +11:00
Simone Bordet 783f3b49b0 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-10-09 10:22:18 +02:00
Greg Wilkins 31a0180133 Improve debug logging of gzip inflation
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-09 11:51:13 +11:00
Greg Wilkins 8087e29211 Reverted getSession(id) to public
This method is used by third party session handlers.
Reverts change made as part of #3913

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-09 11:46:43 +11:00
Simone Bordet bc663d2d63 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-10-02 10:18:40 +02:00
Simone Bordet 7810f2dec2 Reverted 82a00524d1.
The connection upgrade check is necessary both after the parsing and
after the handling. After the parsing covers HTTP/2 prior knowledge
"PRI * HTTP/2" case; after the handling covers the WebSocket case.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-02 10:18:06 +02:00
Simone Bordet 17b25ca74a Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-10-01 18:11:01 +02:00
Simone Bordet a380f6b7b9
Merge pull request #4081 from eclipse/jetty-9.4.x-HttpConnection_UpgradeCheck
Remove unnecessary Connection upgrade check
2019-10-01 18:10:23 +02:00
Lachlan Roberts af081459ee Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-09-25 15:06:17 +10:00
Greg Wilkins 11b60db4c3
Issue #4047 Graceful Write (#4100)
Added test to reproduce issue
Fixed bug from #2772 where output was shutdown on DONE without checking for END.
Fixed aggregation logic to aggregate last write if aggregation already started
Improved comments and clarify conditions

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-25 12:13:56 +10:00
Simone Bordet f10325ea50
Merge pull request #3959 from eclipse/jetty-10.0.x-3952-server_direct_heap_bytebuffers
Fixes #3952 - Server configuration for direct/heap ByteBuffers.
2019-09-23 15:24:47 +02:00
Simone Bordet 0eec727a09 After review, renamed *directBuffers to *directByteBuffers.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-17 12:16:10 +02:00
Simone Bordet 44e4633af0 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-09-17 11:37:47 +02:00
Simone Bordet f85382aa9d
Merge pull request #4086 from eclipse/jetty-9.4.x-1036-SchedulerThreads
Issue #1036 Configure Scheduler
2019-09-17 11:37:23 +02:00
Simone Bordet bee079c021 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-09-17 11:18:51 +02:00
Lachlan Roberts a0cd331327 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-HttpConnection_UpgradeCheck 2019-09-17 13:11:43 +10:00
Greg Wilkins bcf6b4c581 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-1036-SchedulerThreads 2019-09-17 12:36:23 +10:00
Simone Bordet 422b9bded5 Fixes #3747 - Make Jetty Demo work with JPMS.
Introduced module `jdbc` and made other modules that require JDBC depend on it.
Modified demo.ini to enable the `jdbc` module because some webapp descriptor
of the demo requires JDBC classes.

Now the demo can be run fine on the module-path just by adding --jpms.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-16 22:57:55 +02:00
Simone Bordet 1ef4a416b5 Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-3952-server_direct_heap_bytebuffers'. 2019-09-16 12:26:26 +02:00
Joakim Erdfelt 3861e9f9ca Merge branch 'jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java
#	jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
2019-09-13 10:02:05 -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 92e4d73dcb Issue #1036 Configure Scheduler
Allows scheduler configuration

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-13 09:52:28 +10:00
Simone Bordet 098f5029c8 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-09-12 15:51:23 +02:00
Lachlan Roberts 3068b4c8ae fix build issues
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-09-12 11:04:05 +10:00
Lachlan Roberts 82a00524d1 remove unnecessary connection upgrade check
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-09-12 10:52:06 +10:00
Greg Wilkins 905bf82f80 reformatting
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-12 10:14:58 +10:00
Simone Bordet d69a1f0f58 Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-3537-bootstrap_websocket_http2'. 2019-09-12 00:11:01 +02:00
Simone Bordet f942cd4687 Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-4058-autolock'. 2019-09-11 22:41:11 +02:00
Joakim Erdfelt 6ae7427d55 Merge branch 'jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	examples/embedded/pom.xml
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/FileServer.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/JarServer.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyContexts.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyHandlers.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/OneWebAppWithJsp.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithAnnotations.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithJNDI.java
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/WebSocketJsrServer.java
2019-09-11 09:42:56 -05: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 1722acafa8 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-09-11 09:36:59 +10:00
Jan Bartel a563cdca76
Issue #4025 Add flushOnResponseCommit mode to sessions. (#4049)
* Issue #4025 Add flushOnCommit mode to sessions.

Added flushOnCommit mode to write a session to the backing store as the
response commits, before any bytes are returned to the client.

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-09-11 09:10:35 +10:00
Jan Bartel b851af0a5b
Issue #4003 Fix quickstart (#4008)
* Issue #4003 Fix quickstart.

Modes:
AUTO: use quickstart xml if present, start normally otherwise
GENERATE: re/generate quickstart xml
QUICKSTART: use a pregenerated quickstart xml, fail otherwise

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

* Issue #4003 Cleanup quickstart

Removed TerminateException in favour of Server.setDryRun(boolean)
and AbstractLifeCycle.StopException

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-10 16:04:01 +10:00
Simone Bordet 692c017500 Fixes #4058 - Review Locker.
Removes the Locker class, replaced by AutoLock.
Removed usages of Locker.isLocked() from the session code
since it was not necessary.
Took the chance to do a little code cleanup.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-09 16:18:46 +02:00
Greg Wilkins 103a5065c9 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-09-09 15:14:39 +10:00
Greg Wilkins 17f4dd1a40
Merge pull request #4066 from dreis2211/tolerate-multiple-accept-encondings-gziphandler
Tolerate multiple Accept-Encoding headers in GzipHandler
2019-09-09 15:14:15 +10:00
dreis2211 82e8fc0b0e Simplify check for Accept-Encoding header
Signed-off-by: dreis2211 <christoph.dreis@freenet.de>
2019-09-09 07:06:40 +02:00
Jan Bartel ee13567c21 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-09-09 14:54:39 +10:00
tomoya yokota c904a14d6a fix Session#finishInvalidate throwsConcurrentModificationException (#4036)
* fix Session#finishInvalidate throws java.util.ConcurrentModificationException
* Change constructor _attribute field must assigned to ConcurrentHashMap

Signed-off-by: tomoya-yokota <tomoya-yokota@cybozu.co.jp>
2019-09-09 14:52:48 +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
Greg Wilkins 02ec06ead9 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-09-06 14:45:55 +10:00
Greg Wilkins 894f31e612
Issue #4048 Multiple proxy ports (#4063)
Support multiple proxy port values.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-06 14:45:00 +10:00
Chris Walker f7a0156961
Merge 9.4.x 2019-09-05 13:20:19 -04:00
康智冬 3a6b26d292 fix typo (#4055)
Signed-off-by: KangZhiDong <worldkzd@gmail.com>
2019-09-05 13:17:30 -04:00
Chris Walker 189ba7a671
Merge from 9.4.x 2019-09-02 14:49:33 -04:00
康智冬 49ba6d1acb fix typo and grammar (#4045)
Signed-off-by: KangZhiDong <worldkzd@gmail.com>
2019-09-02 14:29:50 -04:00
Joakim Erdfelt ebc6a8e143 Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
2019-08-29 07:24:16 -05:00
Joakim Erdfelt 2fcb311c56 Issue #4033 - Addressing Lenient URIUtil decode behavior change in test
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-28 16:32:19 -05:00
Jan Bartel 758d5be6fa Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-28 11:12:20 +10:00
Jan Bartel 37712d75a2
Issue #4027 Ensure AbstractSessionDataStore started or throws exception. (#4028)
* Issue #4027 Ensure AbstractSessionDataStore started or throws exception.

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-28 11:08:42 +10:00
Jan Bartel 23c0bcaf89 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-08-28 11:05:53 +10:00
Jan Bartel a2fc9b113b Fix and enhance session invalidation tests.
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-28 11:04:31 +10:00
Joakim Erdfelt eef2481b59 Adding cookie parsing test for excessive semicolon (reported as CVE in other projects) 2019-08-27 14:09:06 -05:00
Greg Wilkins a09a8f94c6 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 19:04:05 +10:00
Greg Wilkins 2564a08150 fix checkstyle
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 18:43:33 +10:00
Greg Wilkins 6038d75153 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 17:47:41 +10:00
Greg Wilkins 83463c2a23
Issue #3964 - Listener behavior cleanup (Jetty 9.4.x) (#3965)
Issue #3964
* Avoid creating listener list for rarely used requestAttributeListener
* AbstractConnector keeps a specific list of HttpChannel.Listeners
to avoid Connection.Listeners and MBean listeners being added to
the HttpChannel listener list.
* Simplified listener handling by avoiding null connector, previously
only needed for testing.
* Fixed test that assumed HttpChannel listeners were not cleared by a recycle
* 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.
* Added improved method to combine multiple HttpChannel Listeners
into a single Listener.
* Fixed MockConnector
* Added benchmark
* Improved benchmark
* Updates from review
* Removed benchmark and alternate implementations.
* Updated javadoc
* Updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 17:38:20 +10:00
Greg Wilkins d890748f3a More merge fixes
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 16:19:07 +10:00
Olivier Lamy 5403a30b32 session#getLastAccessedTime should throw IllegalStateException if session has been invalidated (#4023)
* per servlet api javadoc getLastAccessedTime should throw IllegalStateException if session has been invalidated

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

* isInvalid test should be done within lock

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-27 13:13:18 +10:00
Olivier Lamy b51d770807
session#getLastAccessedTime should throw IllegalStateException if session has been invalidated (#4023)
* per servlet api javadoc getLastAccessedTime should throw IllegalStateException if session has been invalidated

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

* isInvalid test should be done within lock

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-27 13:03:28 +10:00
Greg Wilkins 15e2f72264 updated after merge to fix tests
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 11:33:06 +10:00
Greg Wilkins 5164f7bb41 fixed merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 10:52:27 +10:00
Greg Wilkins af8587c108 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 08:15:41 +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
Jan Bartel 9534940578 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-26 15:55:08 +10:00
Jan Bartel 0f8230c05b
Issue #3936 Provide write-through modes for the NullSessionCache (#3984)
* Issue #3936 Provide write-through modes for the NullSessionCache

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-26 15:22:20 +10:00
Joakim Erdfelt 36ef975353 Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterTest.java
#	jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java
#	jetty-util/src/test/java/org/eclipse/jetty/util/resource/FileSystemResourceTest.java
2019-08-23 08:52:52 -05: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
Joakim Erdfelt f15ca7765e
Merge pull request #3994 from eclipse/jetty-9.4.x-3985-cookie-parsing
Fixes #3985 - Updates to CookieCutter to reject no-equal cookies
2019-08-23 07:27:23 -05:00
olivier lamy 80d513e979 junit failure after bad merge
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-23 10:56:24 +10:00
Joakim Erdfelt 318045cd87 Issue #3985 - Applying PR Review to CookieCutter
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-22 12:46:23 -05:00
olivier lamy a36af67abf Merge branch 'jetty-9.4.x' into jetty-10.0.x 2019-08-22 20:45:57 +10: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 88e37b177c Issue #4000 - Name change to isSameName
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-21 17:11:44 -05:00
Joakim Erdfelt c1c241349e Issue #3985 - Applying PR Review to CookieCutter
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-21 12:54:26 -05:00