Changeset 3361d14 for router


Ignore:
Timestamp:
Jun 11, 2018 11:56:22 AM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
a1bf2b8
Parents:
e687e1d
Message:

UPnP: Change port names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/UPnPManager.java

    re687e1d r3361d14  
    5959    // It expires after 31 minutes.
    6060    private static final long RESCAN_LONG_DELAY = 14*60*1000;
     61    // make these generic so we don't advertise we're running I2P
     62    private static final String TCP_PORT_NAME = "TCP";
     63    private static final String UDP_PORT_NAME = "UDP";
    6164
    6265    public UPnPManager(RouterContext context, TransportManager manager) {
     
    209212            String style = entry.style;
    210213            int port = entry.port;
    211             int protocol = -1;
    212             if ("SSU".equals(style))
     214            int protocol;
     215            String name;
     216            if ("SSU".equals(style)) {
    213217                protocol = ForwardPort.PROTOCOL_UDP_IPV4;
    214             else if ("NTCP".equals(style))
     218                name = UDP_PORT_NAME;
     219            } else if ("NTCP".equals(style)) {
    215220                protocol = ForwardPort.PROTOCOL_TCP_IPV4;
    216             else
     221                name = TCP_PORT_NAME;
     222            } else {
    217223                continue;
     224            }
    218225            if (_log.shouldLog(Log.DEBUG))
    219226                _log.debug("Adding: " + style + " " + port);
    220             ForwardPort fp = new ForwardPort(style, false, protocol, port);
     227            ForwardPort fp = new ForwardPort(name, false, protocol, port);
    221228            forwards.add(fp);
    222229        }
Note: See TracChangeset for help on using the changeset viewer.