Skip to content
Browse files

Copying NakackHeader before modifying it (https://issues.jboss.org/br…

  • Loading branch information...
1 parent f5826bc commit 66ba3a454674d0b11cb15272e8c896eb309d3bad @belaban committed Aug 16, 2012
View
8 src/org/jgroups/protocols/pbcast/NAKACK.java
@@ -878,7 +878,9 @@ private void sendXmitRsp(Address dest, Message msg) {
Message xmit_msg=msg.copy(true, true); // copy payload and headers
xmit_msg.setDest(dest);
NakAckHeader hdr=(NakAckHeader)xmit_msg.getHeader(id);
- hdr.type=NakAckHeader.XMIT_RSP; // change the type in the copy from MSG --> XMIT_RSP
+ NakAckHeader newhdr=hdr.copy(); // create a copy of the header: https://issues.jboss.org/browse/JGRP-1502
+ newhdr.type=NakAckHeader.XMIT_RSP; // change the type in the copy from MSG --> XMIT_RSP
+ xmit_msg.putHeader(id, newhdr);
down_prot.down(new Event(Event.MSG, xmit_msg));
}
@@ -892,7 +894,9 @@ private void handleXmitRsp(Message msg, NakAckHeader hdr) {
xmit_rsps_received.incrementAndGet();
msg.setDest(null);
- hdr.type=NakAckHeader.MSG; // change the type back from XMIT_RSP --> MSG
+ NakAckHeader newhdr=hdr.copy();
+ newhdr.type=NakAckHeader.MSG; // change the type back from XMIT_RSP --> MSG
+ msg.putHeader(id, newhdr);
up(new Event(Event.MSG, msg));
if(rebroadcasting)
checkForRebroadcasts();
View
2 src/org/jgroups/protocols/pbcast/NakAckHeader2.java
@@ -4,7 +4,6 @@
import org.jgroups.Address;
import org.jgroups.Global;
import org.jgroups.Header;
-import org.jgroups.util.SeqnoList;
import org.jgroups.util.Util;
import java.io.DataInput;
@@ -21,7 +20,6 @@
byte type=0;
long seqno=-1; // seqno of regular message (MSG)
- // SeqnoList missing=null; // range of msgs to be retransmitted (XMIT_REQ)
Address sender; // the original sender of the message (for XMIT_REQ)

0 comments on commit 66ba3a4

Please sign in to comment.
Something went wrong with that request. Please try again.