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:
parent
bf2a99518c
commit
9e1e4f79c7
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user