Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kostyantynnosach-mobius committed May 23, 2018
1 parent 87f5ea5 commit f833472
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,8 @@ public void modifyServerAssociation(String assocName, String peerAddress, Intege

for (FastMap.Entry<String, Association> n = this.associations.head(), end = this.associations.tail(); (n = n.getNext()) != end;) {
Association associationTemp = n.getValue();
if(assocName.equals(associationTemp.getName()))
continue;

if (peerAddress != null && peerAddress.equals(associationTemp.getPeerAddress()) && associationTemp.getPeerPort() == peerPort) {
throw new Exception(String.format("Already has association=%s with same peer address=%s and port=%d", associationTemp.getName(),
Expand Down Expand Up @@ -1674,6 +1676,8 @@ public void modifyAssociation(String hostAddress, Integer hostPort, String peerA
synchronized (this) {
for (FastMap.Entry<String, Association> n = this.associations.head(), end = this.associations.tail(); (n = n.getNext()) != end;) {
Association associationTemp = n.getValue();
if(assocName.equals(associationTemp.getName()))
continue;

if (peerAddress !=null && peerAddress.equals(associationTemp.getPeerAddress()) && associationTemp.getPeerPort() == peerPort) {
throw new Exception(String.format("Already has association=%s with same peer address=%s and port=%d", associationTemp.getName(),
Expand Down

0 comments on commit f833472

Please sign in to comment.