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 bf2a99518c
commit 9e1e4f79c7

View File

@ -160,7 +160,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());
}
}