-
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
An omnibus PR for changes needed to support webfunctions #10563
An omnibus PR for changes needed to support webfunctions #10563
Conversation
Web functions are currently supported with servlets. These changes add/move utility classes to core to better support direct usage of core APIs
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java
Outdated
Show resolved
Hide resolved
*/ | ||
public boolean add(Chunk chunk) | ||
{ | ||
if (chunk.hasRemaining()) |
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.
Not sure about this check, I would add regardless.
The problem is that the caller has to check the return value (because otherwise nobody will release the chunk).
This method is currently used only within a test for hasRemaining()
and does not check the return value.
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.
It was really to avoid adding error chunks. I'll test that explicitly instead, although that will stop any optimizations of 1 chunk lists if empty chunks are added to it.
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.
Actually changed to do the retain in the method now, so this makes more sense.
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 an awkward API to use in general, see also comment below.
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ChunkAccumulator.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ChunkAccumulator.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/writer/AbstractOutputStreamWriter.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/writer/EncodingWriter.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/writer/Iso88591Writer.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/writer/Utf8Writer.java
Outdated
Show resolved
Hide resolved
jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ResponseWriter.java
Outdated
Show resolved
Hide resolved
protected final OutputStream _out; | ||
protected final ByteArrayOutputStream2 _bytes; |
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.
Make these private
. They either have getters or only used internally by inner classes.
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.
If I make them private I just have to add protected getters. I don't see the point?
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractOutputStreamWriter.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractOutputStreamWriter.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractOutputStreamWriter.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ChunkAccumulator.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ChunkAccumulator.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ChunkAccumulator.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ChunkAccumulator.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ChunkAccumulator.java
Show resolved
Hide resolved
jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ResponseWriter.java
Outdated
Show resolved
Hide resolved
@sbordet I've made Note I also looked at removing even the temporary buffering in the iso and utf8 versions.... as they could easily just call |
I have a green local build on GoogleCloudPlatform/functions-framework-java#235, so would be good to have this PR in the next release so I can progress next month. |
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ChunkAccumulator.java
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/QuietException.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/content/BufferedContentSink.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/WriteThroughWriter.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/WriteThroughWriter.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/test/java/org/eclipse/jetty/io/WriteThroughWriterTest.java
Outdated
Show resolved
Hide resolved
jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/Response.java
Outdated
Show resolved
Hide resolved
Do not persist a defaulted charset used in the request.
Do not persist a defaulted charset used in the request. Throw UnsupportedEncodingException from getReader
Do not persist a defaulted charset used in the request. Throw UnsupportedEncodingException from getReader Improve performance with asciiEqualsIgnoreCase HttpMethod is case-insensitive
Web functions are currently supported with servlets. These changes add/move utility classes to core to better support direct usage of core APIs: