From 9939c00541193977b599b4837bc28045f1326f69 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 21 Jul 2014 06:27:30 +0200 Subject: [PATCH] Use the correct memoryAddress size when do a gathering write. Part of [#2680] --- .../main/java/io/netty/channel/epoll/EpollSocketChannel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java index a06d869278..33b5e08f81 100644 --- a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java +++ b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java @@ -144,7 +144,7 @@ public final class EpollSocketChannel extends AbstractEpollChannel implements So private boolean writeBytesMultiple( EpollChannelOutboundBuffer in, int msgCount, AddressEntry[] addresses, - int addressCnt, int expectedWrittenBytes) throws IOException { + int addressCnt, long expectedWrittenBytes) throws IOException { boolean done = false; long writtenBytes = 0; int offset = 0; @@ -323,7 +323,7 @@ public final class EpollSocketChannel extends AbstractEpollChannel implements So AddressEntry[] addresses = epollIn.memoryAddresses(); int addressesCnt = epollIn.addressCount(); if (addressesCnt > 1) { - if (!writeBytesMultiple(epollIn, msgCount, addresses, addressesCnt, epollIn.addressCount())) { + if (!writeBytesMultiple(epollIn, msgCount, addresses, addressesCnt, epollIn.addressSize())) { // was not able to write everything so break here we will get notified later again once // the network stack can handle more writes. break;