-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
HttpClientRequest handle correctly Buffers with a readerIndex > 0 #1951
Comments
can you provide a reproducer ? |
thanks |
it seems due to this change in Netty : netty/netty@9306333#diff-7191c076eacd4a1a53d60604a5d2a251R219 previous version of duplicate called by |
Thanks for investigation! What are there the next steps for this issue? pending.addComponent(buff).writerIndex(pending.writerIndex() + buff.READABLEBYTES()); Or even more use |
@TanyaGaleyev actually the buffer we obtain is via |
I think it will be fixed in 3.4.2 with improvements in |
|
I pushed a fix based on your suggestion with a test, would you mind to check it's fine on your side ? |
@vietj cachedChunks.addComponent(buff).writerIndex(cachedChunks.writerIndex() + buff.writerIndex()); |
@vietj |
good catch, I'll try to make a test for this one. you can get the snapshots from the Sonatype OSS snapshot repository https://oss.sonatype.org/content/repositories/snapshots/ |
@TanyaGaleyev the computation of the content-length needs also to be fixed |
I fixed those in |
@vietj |
When 3.4.2 will be released? |
around May, we aim to start the release process early may and conclude before june |
not saying it's a slow process, just saying that we shall do it peacefully :-) |
Thanks for info. |
We are using code similar to example. And IndexOutOfBoundsException was observed. After debugging for a while I found a reason of the problem.
In proxy code we have something like:
In file
HttpClientRequestImpl
there is a code:And if
buff
hasreaderIndex
not equal to 0 then call towriterIndex
fails with reasonable IndexOutOfBoundsException.Current workaround is using
Buffer.slice()
before passing buffer read by http server to http client. But I think that buffers with non 0readerIndex
should be handled properly byHttpClientRequestImpl
.The text was updated successfully, but these errors were encountered: