Enable gathering writes support for 3.5.x . See #271 and #269

This commit is contained in:
norman 2012-04-27 10:25:09 +02:00
parent 4b1e226b64
commit 681c5dd0d0
2 changed files with 7 additions and 6 deletions

View File

@ -277,11 +277,10 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer {
public int getBytes(int index, GatheringByteChannel out, int length) public int getBytes(int index, GatheringByteChannel out, int length)
throws IOException { throws IOException {
// Disable till 3.5.0.Final
/*
if (DetectionUtil.javaVersion() >= 7) { if (DetectionUtil.javaVersion() >= 7) {
return (int) out.write(toByteBuffers(index, length)); return (int) out.write(toByteBuffers(index, length));
}*/ }
// XXX Gathering write is not supported because of a known issue. // XXX Gathering write is not supported because of a known issue.
// See http://bugs.sun.com/view_bug.do?bug_id=6210541 // See http://bugs.sun.com/view_bug.do?bug_id=6210541

View File

@ -24,8 +24,10 @@ import java.nio.channels.GatheringByteChannel;
import java.nio.channels.WritableByteChannel; import java.nio.channels.WritableByteChannel;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.CompositeChannelBuffer;
import org.jboss.netty.channel.DefaultFileRegion; import org.jboss.netty.channel.DefaultFileRegion;
import org.jboss.netty.channel.FileRegion; import org.jboss.netty.channel.FileRegion;
import org.jboss.netty.util.internal.DetectionUtil;
final class SocketSendBufferPool { final class SocketSendBufferPool {
@ -66,11 +68,11 @@ final class SocketSendBufferPool {
return EMPTY_BUFFER; return EMPTY_BUFFER;
} }
// Disable till 3.5.0.Final
/*
if (src instanceof CompositeChannelBuffer && DetectionUtil.javaVersion() >= 7) { if (src instanceof CompositeChannelBuffer && DetectionUtil.javaVersion() >= 7) {
return new GatheringSendBuffer(src.toByteBuffers()); return new GatheringSendBuffer(src.toByteBuffers());
}*/ }
if (src.isDirect()) { if (src.isDirect()) {
return new UnpooledSendBuffer(src.toByteBuffer()); return new UnpooledSendBuffer(src.toByteBuffer());
} }