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
Issue with HttpPostRequestEncoder #1293
Comments
@xhh11 can you tell us which version you are using ? A test-case would also help.. |
I was using the snapshot build of 4/16. The client side :
and the server side:
|
@fredericBregier, can you take a look? |
I also see the same problem at master just in case it was unclear. |
I tried latest snapshot and the behavior is kind of different. First, the get request will trigger two messageReceived events, the first time a DefaultHttpRequest and the second an empty LastHttpContent. I remember this was fixed some time ago but somehow it comes back. Second, when uploading a file, the server generates a HttpPostRequestDecoder$NotEnoughDataDecoderException. |
I'm not enough still familiar with Netty 4.
The issue seems related to the HttpContent passed without corresponding POST/PUT/PATCH request. Probable chunk get request ? So it might be an issue of:
I may have some more time later on, but as I will be very busy in the following days (for one week at least), it might take too long... |
A note might not be related with this topic. When I tried the HttpUpload example, I saw a warning message : Is it recommended for Netty to work with Javassist? |
@xhh11, Yes. Javassist in the classpath is recommended. |
@fredericBregier Can you just fix it for us? I don't have much knowledge about multipart form requests nor the code itself. |
As I said, I will not be able to work on it before 1 week at least. If this is urgent, someone else could have a look. I suspect an automatic "chunk" that might be introduced in netty 4 code but no evidence right now. So might be something totally different. I've seen no difference until now between v4 and v3, except of course netty api, So the reason I point out my "lack" of v4 knowledge as also the possible different behavior on "chunk" operations. So if not urgent, I may work on it in 1 week at least. |
After looking more in depth, the issue seems to come from a major change in V4 by introducing the EMPTY_LAST_CONTENT in LastHttpContent, and probably in HttpObjectDecoder. I do not know how this HttpObjectDecoder is supposed to act, so I don't know how to fix it. It seems the behaviour is:
So I believe it should be handle as an "end" marker in the HttpPostRequestDecoder, but as I'm not sure, could someone explain to me what is the behind logic? |
@normanmaurer and @trustin I'm a bit limited here on this issue, since it will need me to go deep in the "new" logic of the HttpObjectDecoder and in particular the LastHttpContent behavior. |
@fredericBregier yeah... the LastHttpContent always mark the end of the request/response. So its like this: FullHttpContent implements HttpRequest and LastHttpContent to represent a full message. |
@normanmaurer ok, that's almost what I understood. Thank you! In the next days, I will try to go deep again and fix the V4 if I found how to do it. |
@fredericBregier too late... I just fixed it ;) |
Does your fix included in latest build (174)? I tried the build and the upload example is still not working. 10:25:32.818 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework WARNING: WELCOME TO THE WILD WILD WEB SERVERVERSION: HTTP/1.1 HEADER: Host=localhost COOKIE: another-cookie=bar Is Chunked: true BODY Attribute: Attribute: Mixed: info=first value BODY Attribute: Attribute: Mixed: secondinfo=secondvalue ���& BODY Attribute: Attribute: Mixed: thirdinfo=short text io.netty.buffer.IllegalBufferAccessException |
* Also let HttpPostRequestDecoder extends Iterator and let its Exceptiosn extend DecoderException
@xhh11 this is an other issue.. which I just fixed :) Please try again |
@normanmaurer Thank you!! I have not so much time available and going deep in would have been definitively too long for Netty, as you are so quick to fix issues ! Awesome ! |
If HttpPostRequestEncoder generates chunks, it won't work. Please try the HttpUpload example.
The text was updated successfully, but these errors were encountered: