Skip to content

Commit

Permalink
Enable gathering writes support for 3.5.x . See #271 and #269
Browse files Browse the repository at this point in the history
  • Loading branch information
normanmaurer committed Apr 27, 2012
1 parent 4b1e226 commit 681c5dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Expand Up @@ -277,11 +277,10 @@ public void getBytes(int index, ChannelBuffer dst, int dstIndex, int length) {

public int getBytes(int index, GatheringByteChannel out, int length)
throws IOException {
// Disable till 3.5.0.Final
/*

if (DetectionUtil.javaVersion() >= 7) {
return (int) out.write(toByteBuffers(index, length));
}*/
}

// XXX Gathering write is not supported because of a known issue.
// See http://bugs.sun.com/view_bug.do?bug_id=6210541
Expand Down
Expand Up @@ -24,8 +24,10 @@
import java.nio.channels.WritableByteChannel;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.CompositeChannelBuffer;
import org.jboss.netty.channel.DefaultFileRegion;
import org.jboss.netty.channel.FileRegion;
import org.jboss.netty.util.internal.DetectionUtil;

final class SocketSendBufferPool {

Expand Down Expand Up @@ -66,11 +68,11 @@ private SendBuffer acquire(ChannelBuffer src) {
return EMPTY_BUFFER;
}

// Disable till 3.5.0.Final
/*

if (src instanceof CompositeChannelBuffer && DetectionUtil.javaVersion() >= 7) {
return new GatheringSendBuffer(src.toByteBuffers());
}*/
}

if (src.isDirect()) {
return new UnpooledSendBuffer(src.toByteBuffer());
}
Expand Down

0 comments on commit 681c5dd

Please sign in to comment.