-
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
Pass special content to interceptors #7296
Pass special content to interceptors #7296
Conversation
c9e9cd7
to
d4445b6
Compare
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.
Can we add and example to the javadoc somewhere like:
@Override
public HttpInput.Content readFrom(HttpInput.Content content) {
if (content.hasContent())
processContent(content.getByteBuffer());
if (content.isEof())
endProcessing();
return processedContent();
}
@gregw I've added some javadoc to the |
c7f16da
to
1844b7d
Compare
jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java
Outdated
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java
Outdated
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContentProducer.java
Outdated
Show resolved
Hide resolved
jetty-server/src/test/java/org/eclipse/jetty/server/BlockingContentProducerTest.java
Outdated
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java
Outdated
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContentProducer.java
Outdated
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContentProducer.java
Outdated
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContentProducer.java
Show resolved
Hide resolved
jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContentProducer.java
Show resolved
Hide resolved
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.
Please fix redundant return
.
jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java
Outdated
Show resolved
Hide resolved
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 see 3 variables here:
- what type of input content (some content, empty content, EOF content, error content)
- what the interceptor does with the input content (full consume, partial consume, no consume)
- what type of output content (null, empty, non-empty, EOF, error, throw)
I would like, if possible, to have tests that cover all combinations of the 3 variables above.
I'd be happy to see tests for the most common cases.
Otherwise I'm good.
da59afc
to
18a1179
Compare
Doh! forced push!!!!! I can't review just the changes since my last review!!!! |
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
… interceptor and clarify its javadoc Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
18a1179
to
df1f1b6
Compare
Modify the
AsyncContentProducer
accordingly and updateGzipHttpInputInterceptor
to correctly handle the existingHttpInput.Content
contract.I have not modified the special contents (error and EOF) to make them return an empty buffer when
getByteBuffer()
is called as IMHO theContent
contract already is clear on that: callinggetByteBuffer()
whenisSpecial()
returnstrue
does throw ISE.So IMHO if there is some code out there that calls
Content.getByteBuffer()
without first checking the special flag, it is in breach of the contract as it was documented since 10.0.0; the fact that we never passed special content to interceptors should be irrelevant.