From c088168f9e43aa4cce6e11bd398b3b140a8e345e Mon Sep 17 00:00:00 2001 From: Bela Ban Date: Wed, 27 Sep 2023 13:55:18 +0200 Subject: [PATCH] - Fixed incorrect FragmentedMessage.copyPayload --- src/org/jgroups/FragmentedMessage.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/org/jgroups/FragmentedMessage.java b/src/org/jgroups/FragmentedMessage.java index c3b1f1d9c0f..63be9f9441a 100644 --- a/src/org/jgroups/FragmentedMessage.java +++ b/src/org/jgroups/FragmentedMessage.java @@ -37,6 +37,15 @@ public FragmentedMessage(Message original_msg, int off, int len) { public Supplier create() {return FragmentedMessage::new;} protected int sizeOfPayload() {return Global.INT_SIZE + length;} + @Override + protected Message copyPayload(Message copy) { + FragmentedMessage msg=(FragmentedMessage)super.copyPayload(copy); + msg.offset=this.offset; + msg.length=this.length; + msg.original_msg=this.original_msg; + return msg; + } + public void writePayload(DataOutput out) throws IOException { ByteArrayDataOutputStream bos=out instanceof ByteArrayDataOutputStream? (ByteArrayDataOutputStream)out : null; int size_pos=bos != null? bos.position() : -1;