Use the correct ChannelBufferFactory when creating new ChannelBuffers. See #335

Conflicts:

	handler/src/main/java/io/netty/handler/ssl/SslHandler.java
This commit is contained in:
norman 2012-05-18 08:11:45 +02:00 committed by Trustin Lee
parent ed357181c0
commit 1226cdacfb

View File

@ -702,11 +702,6 @@ public class SslHandler extends FrameDecoder
outNetBuf.flip(); outNetBuf.flip();
int remaining = outNetBuf.remaining(); int remaining = outNetBuf.remaining();
msg = ChannelBuffers.buffer(remaining); msg = ChannelBuffers.buffer(remaining);
// Transfer the bytes to the new ChannelBuffer using some safe method that will also
// work with "non" heap buffers
//
// See https://github.com/netty/netty/issues/329
msg.writeBytes(outNetBuf); msg.writeBytes(outNetBuf);
outNetBuf.clear(); outNetBuf.clear();
@ -845,8 +840,14 @@ public class SslHandler extends FrameDecoder
if (result.bytesProduced() > 0) { if (result.bytesProduced() > 0) {
outNetBuf.flip(); outNetBuf.flip();
<<<<<<< HEAD
ChannelBuffer msg = ChannelBuffers.buffer(outNetBuf.remaining()); ChannelBuffer msg = ChannelBuffers.buffer(outNetBuf.remaining());
=======
ChannelBuffer msg = ctx.getChannel().getConfig().getBufferFactory().getBuffer(outNetBuf.remaining());
>>>>>>> d2ec45e... Use the correct ChannelBufferFactory when creating new ChannelBuffers. See #335
// Transfer the bytes to the new ChannelBuffer using some safe method that will also // Transfer the bytes to the new ChannelBuffer using some safe method that will also
// work with "non" heap buffers // work with "non" heap buffers
// //