Fix SctpMessage.duplicate() behavior

Motivation:

SctpMessage.duplicate() copied message content that leads to additional buffer
allocation and memory copying.

Modifications:

Duplicate message content instead of copying it.

Result:

Better performace and less memory consumption.
This commit is contained in:
Sergey Polovko 2016-01-05 00:40:35 +03:00 committed by Norman Maurer
parent bdea94d807
commit 968ef8e0af

View File

@ -164,7 +164,7 @@ public final class SctpMessage extends DefaultByteBufHolder {
if (msgInfo == null) {
return new SctpMessage(protocolIdentifier, streamIdentifier, unordered, content().duplicate());
} else {
return new SctpMessage(msgInfo, content().copy());
return new SctpMessage(msgInfo, content().duplicate());
}
}