Skip to content
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

The Netty JerseyServerHandler does not reset entity stream between requests. #4575

Closed
everett1992 opened this issue Sep 21, 2020 · 0 comments · Fixed by #4623
Closed

The Netty JerseyServerHandler does not reset entity stream between requests. #4575

everett1992 opened this issue Sep 21, 2020 · 0 comments · Fixed by #4623
Labels

Comments

@everett1992
Copy link

JerseyServerHandler uses the same NettyInputStream across all messages and if a request does not close it's entity input stream a chunk of it's data will be visible to the next request on the same channel.

The handler tries to reset the inputStream between messages by calling nettyInputStream.clear

https://github.com/eclipse-ee4j/jersey/blob/master/containers/netty-http/src/main/java/org/glassfish/jersey/netty/httpserver/JerseyServerHandler.java#L83

However clear does not fully reset the NettyInputStream. It does not null out buffer or current so the next call to read will return data from buffer which is data from the previous call.

Clear should be fixed. It should null cause, reading, buffer, and current. It may be appropriate to notifyAll and cleanup buffers in isList. You could also or instead allocate a new NettyInputStream instead of reusing the same.

@jansupol jansupol added the netty label Sep 22, 2020
@senivam senivam linked a pull request Oct 26, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants