Skip to content

Commit

Permalink
- Fixed incorrect FragmentedMessage.copyPayload
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Sep 27, 2023
1 parent c9df6d8 commit c088168
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/org/jgroups/FragmentedMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ public FragmentedMessage(Message original_msg, int off, int len) {
public Supplier<Message> 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;
Expand Down

0 comments on commit c088168

Please sign in to comment.