Permalink
Browse files

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

…owse/JGRP-1502)

Conflicts:

	src/org/jgroups/protocols/pbcast/NakAckHeader2.java
  • Loading branch information...
1 parent 476aff5 commit 9f9821e9b42e9d5df3008f3aa803fc86c559a92a Bela Ban committed Aug 16, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/org/jgroups/protocols/pbcast/NAKACK.java
@@ -866,7 +866,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));
}
@@ -880,7 +882,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();

0 comments on commit 9f9821e

Please sign in to comment.