*/
private void handleResendingOfFirstMessage(Address sender, long seqno) {
if(log.isTraceEnabled())
log.trace(local_addr + " <-- SEND_FIRST_SEQNO(" + sender + ")");
SenderEntry entry=send_table.get(sender);
AckSenderWindow win=entry != null? entry.sent_msgs : null;
if(win == null) {
if(log.isErrorEnabled())
log.error(local_addr + ": sender window for " + sender + " not found");
return;
}
long lowest=win.getLowest();
Message rsp=win.get(lowest);
if(rsp == null)
return;
// We need to copy the UnicastHeader and put it back into the message because Message.copy() doesn't copy
// the headers and therefore we'd modify the original message in the sender retransmission window
// (https://jira.jboss.org/jira/browse/JGRP-965)
Message copy=rsp.copy();
Unicast2Header hdr=(Unicast2Header)copy.getHeader(this.id);
Unicast2Header newhdr=hdr.copy();
newhdr.first=true;
copy.putHeader(this.id, newhdr);
if(log.isTraceEnabled()) {
StringBuilder sb=new StringBuilder();
sb.append(local_addr).append(" --> DATA(").append(copy.getDest()).append(": #").append(newhdr.seqno).
append(", conn_id=").append(newhdr.conn_id);
if(newhdr.first) sb.append(", first");
sb.append(')');
log.trace(sb);
}
down_prot.down(new Event(Event.MSG, copy));
if(++lowest > seqno)
return;
for(long i=lowest; i <= seqno; i++) {
rsp=win.get(i);
if(rsp != null)
down_prot.down(new Event(Event.MSG, rsp));
}
}