Changeset 1cdcf1c


Ignore:
Timestamp:
May 7, 2014 4:00:38 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b4e03fa9
Parents:
56b6992
Message:

i2ptunnel: Display warning for duplicate client ports (ticket #1265)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java

    r56b6992 r1cdcf1c  
    491491                       _("Warning - ports less than 1024 are not recommended") +
    492492                       ": " + port + "</font>";
     493            // dup check, O(n**2)
     494            List<TunnelController> controllers = _group.getControllers();
     495            for (int i = 0; i < controllers.size(); i++) {
     496                if (i == tunnel)
     497                    continue;
     498                if (port.equals(controllers.get(i).getListenPort()))
     499                    return "<font color=\"red\">" +
     500                           _("Warning - duplicate port") +
     501                           ": " + port + "</font>";
     502            }
    493503            return port;
    494504        }
Note: See TracChangeset for help on using the changeset viewer.