Use the correct memoryAddress size when do a gathering write. Part of [#2680]
This commit is contained in:
parent
6f5cbf6221
commit
b5a192dea4
@ -144,7 +144,7 @@ public final class EpollSocketChannel extends AbstractEpollChannel implements So
|
|||||||
|
|
||||||
private boolean writeBytesMultiple(
|
private boolean writeBytesMultiple(
|
||||||
EpollChannelOutboundBuffer in, int msgCount, AddressEntry[] addresses,
|
EpollChannelOutboundBuffer in, int msgCount, AddressEntry[] addresses,
|
||||||
int addressCnt, int expectedWrittenBytes) throws IOException {
|
int addressCnt, long expectedWrittenBytes) throws IOException {
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
long writtenBytes = 0;
|
long writtenBytes = 0;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
@ -323,7 +323,7 @@ public final class EpollSocketChannel extends AbstractEpollChannel implements So
|
|||||||
AddressEntry[] addresses = epollIn.memoryAddresses();
|
AddressEntry[] addresses = epollIn.memoryAddresses();
|
||||||
int addressesCnt = epollIn.addressCount();
|
int addressesCnt = epollIn.addressCount();
|
||||||
if (addressesCnt > 1) {
|
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
|
// was not able to write everything so break here we will get notified later again once
|
||||||
// the network stack can handle more writes.
|
// the network stack can handle more writes.
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user