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

SslHandler uses HeapBuffers #329

Closed
gcnaccount opened this issue May 16, 2012 · 1 comment
Closed

SslHandler uses HeapBuffers #329

gcnaccount opened this issue May 16, 2012 · 1 comment
Assignees
Labels
Milestone

Comments

@gcnaccount
Copy link

Hello,

We began to use a JCE provider that has specific optimizations through the JNI using direct byte buffers. However, even though our protocol messages were using direct byte buffers, by the time the data was passed to the cipher to be encrypted, it had turned into a heap byte buffer.

I did some digging and found this to be happening in SslHandler. The buffer was coming from SslBufferPool. I re-implemented SslBufferPool to return direct buffers (rather than heap buffers) but unfortunately this resulted in crashes. SslHandler calls .array() in a few places, which is unsupported for direct buffers.

Another problem I ran into was that SslBufferPool's methods were protected rather than public, which made it impossible to create a new implementation outside of the same package.

Note, I encountered this issue in Netty 3.2.7 Final, so I am not sure if it has been addressed in later releases.

Thanks,

Jason

@normanmaurer
Copy link
Member

Thanks for the report.. This was fixed (both things, see #336) and will be part of 3.5.0.Final :)

normanmaurer added a commit that referenced this issue May 31, 2012
…fers. See #329

Conflicts:

	handler/src/main/java/io/netty/handler/ssl/SslHandler.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants