-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EagerContentHandler. #9051 #12077
EagerContentHandler. #9051 #12077
Conversation
@sbordet @lorban Your thoughts on doing this? If you think it is a good idea, can you contribute the h2 and h3 delayed dispatch handling to this branch. |
Implementation-wise, this looks alright assuming the same logic can be replicated in H2/H3 (but I doubt this is going to be troublesome). But could you summarize what benefits/drawbacks this has over the existing |
@lorban wrote:
The |
I've also taken the opportunity to cleanup lots of deprecation and TODOs in HttpConnection |
@lachlan-roberts Can you take over the handling of delayed multipart in this PR? |
…tty-12.1.x/delayedDispatch
Signed-off-by: Lachlan Roberts <[email protected]>
…ispatch' into experiment/jetty-12.1.x/delayedDispatch
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPartFormData.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DelayedHandler.java
Outdated
Show resolved
Hide resolved
…tty-12.1.x/delayedDispatch # Conflicts: # jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpConnection.java # jetty-core/jetty-tests/jetty-test-client-transports/src/test/java/org/eclipse/jetty/test/client/transport/AbstractTest.java # jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ServletTest.java # jetty-ee11/jetty-ee11-servlet/src/test/java/org/eclipse/jetty/ee11/servlet/ServletTest.java # jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletTest.java
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPartFormData.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnectionFactory.java
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DelayedHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpConnection.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/internal/HttpConnection.java
Outdated
Show resolved
Hide resolved
jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ServletTest.java
Outdated
Show resolved
Hide resolved
jetty-ee11/jetty-ee11-servlet/src/test/java/org/eclipse/jetty/ee11/servlet/ServletTest.java
Outdated
Show resolved
Hide resolved
jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletTest.java
Outdated
Show resolved
Hide resolved
I found several bugs in XmlConfiguration that prevented it being used with a Builder pattern. This PR now fixes them so we can build a MultiPartConfig in XML. Adding @lachlan-roberts to reviewers so he can check that. |
jetty-core/jetty-server/src/main/config/etc/jetty-eager-multipart-content.xml
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/FormFields.java
Show resolved
Hide resolved
jetty-core/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java
Show resolved
Hide resolved
…e used for setters with properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach much better.
Mostly nits, but few more important ones.
Documentation and DistributionTests are missing, but I can add them.
jetty-core/jetty-server/src/main/config/etc/jetty-eager-content.xml
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/config/etc/jetty-eager-content.xml
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/config/etc/jetty-eager-multipart-content.xml
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/config/modules/eager-content.mod
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/config/modules/eager-content.mod
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/EagerContentHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/EagerContentHandler.java
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/EagerContentHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/EagerContentHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/EagerContentHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/config/modules/eager-content.mod
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/config/modules/eager-content.mod
Outdated
Show resolved
Hide resolved
Signed-off-by: Simone Bordet <[email protected]>
The javadoc of the Servlet API says: > If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via getInputStream or getReader can interfere with the execution of this method. So there is no requirement to detect or ignore somebody reading before calling a parameter method
…tty-12.1.x/delayedDispatch
@gregw don't merge yet, I'm writing the documentation. |
Signed-off-by: Simone Bordet <[email protected]>
…patch'. Signed-off-by: Simone Bordet <[email protected]>
@lorban @lachlan-roberts please re-review |
Signed-off-by: Simone Bordet <[email protected]>
Signed-off-by: Simone Bordet <[email protected]>
# jetty.eager.multipart.location=/tmp | ||
|
||
## The maximum number of parts that can be parsed from the MultiPart content, or -1 for unlimited. | ||
# jetty.eager.multipart.maxParts=100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still a bit weird that you have -1 for default above and -1 for unlimited for these ones.
I do prefer -1 being unlimited not default, you said you can just set MAX_VALUE
for unlimited, but that is a bit more annoying because you don't know from here if its an int or a long.
…tty-12.1.x/delayedDispatch
Fix #9051 with EagerContentHandler to replace DelayedHandler
The make the
EagerContentHandler.RetainedContentLoader
work efficiently this PR adjusted the buffering strategy of h1, h2 and h3 to keep and reuse a retained buffer until it is mostly full.Also fixed several bugs in XmlConfiguration: