Skip to content

Commit

Permalink
Set local address in ProtocolStack.insertXXX() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Mar 1, 2022
1 parent 2f7cb09 commit 437fd76
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/org/jgroups/stack/ProtocolStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ public void insertProtocolInStack(Protocol prot, Protocol neighbor, Position pos
prot.setDownProtocol(neighbor);
neighbor.setUpProtocol(prot);
}
Address local_address=getTransport() != null? getTransport().getAddress() : null;
if(local_address != null)
prot.setAddress(local_address);
}

private void checkAndSwitchTop(Protocol oldTop, Protocol newTop){
Expand Down Expand Up @@ -578,6 +581,9 @@ public void insertProtocolAtTop(Protocol prot) {
prot.down_prot=top_prot;
prot.up_prot=this;
top_prot=prot;
Address local_address=getTransport() != null? getTransport().getAddress() : null;
if(local_address != null)
prot.setAddress(local_address);
log.debug("inserted " + prot + " at the top of the stack");
}

Expand Down

0 comments on commit 437fd76

Please sign in to comment.