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
HttpOutput.write(ByteBuffer buffer) #6562
Labels
Bug
For general bugs on Jetty side
Comments
It is indeed a buglet! Thanks for noticing and your diagnosis! |
gregw
added a commit
that referenced
this issue
Jul 30, 2021
Fixes #6562 the last written bytebuffer calculation. Also fixed an associated issue with unnecessary flush of an empty when last calculation already signalled last. The code coverage is not complete, so more tests are needed for this use case. Also strange that `write(ByteBuffer)` does not appear to every commence aggregation?
gregw
added a commit
that referenced
this issue
Jul 30, 2021
Removed the last flush of an empty buffer as was no path to that code.
gregw
added a commit
that referenced
this issue
Jul 30, 2021
Restored the last flush of an empty buffer as is needed for 0 length empty write.
gregw
added a commit
that referenced
this issue
Aug 3, 2021
gregw
added a commit
that referenced
this issue
Aug 3, 2021
gregw
added a commit
that referenced
this issue
Aug 17, 2021
Fix flaky test from #6562 Signed-off-by: Greg Wilkins <gregw@webtide.com>
gregw
added a commit
that referenced
this issue
Aug 17, 2021
Fix flaky test from #6562 Signed-off-by: Greg Wilkins <gregw@webtide.com>
gregw
added a commit
that referenced
this issue
Aug 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jetty version 9.4.43
Java version 1.8.0_261
Question
I am using the methods
HttpOutput.write(ByteBuffer buffer)
andHttpOutput.write(byte[] b, int off, int len)
to send the response. Also I am using GzipHandler. I am testing with the same response data. When I use thewrite(byte[] b, int off, int len)
method, the Content-Length header is set in the response. When I use thewrite(ByteBuffer buffer)
method, the Transfer-Encoding: chunked header is set in the response. I only call the method once. I suspect thelast
variable is not being set correctly. Could this be just a misprint?HttpOutput.write(int b)
:https://github.com/eclipse/jetty.project/blob/735e97d5c7e41a39e759a5d76e45f0b5c1226209/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java#L1002
HttpOutput.write(byte[] b, int off, int len)
:https://github.com/eclipse/jetty.project/blob/735e97d5c7e41a39e759a5d76e45f0b5c1226209/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java#L796
HttpOutput.write(ByteBuffer buffer)
:https://github.com/eclipse/jetty.project/blob/735e97d5c7e41a39e759a5d76e45f0b5c1226209/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java#L926
The text was updated successfully, but these errors were encountered: