Author: toad
Date: 2007-09-08 00:02:08 +0000 (Sat, 08 Sep 2007)
New Revision: 15029

Modified:
   trunk/plugins/UPnP/UPnP.java
Log:
Avoid confusing logging

Modified: trunk/plugins/UPnP/UPnP.java
===================================================================
--- trunk/plugins/UPnP/UPnP.java        2007-09-07 23:55:53 UTC (rev 15028)
+++ trunk/plugins/UPnP/UPnP.java        2007-09-08 00:02:08 UTC (rev 15029)
@@ -403,7 +403,7 @@
                        return false;

                // Just in case...
-               removeMapping(protocol, port, fp);
+               removeMapping(protocol, port, fp, true);

                Action add = _service.getAction("AddPortMapping");
                if(add == null) {
@@ -429,7 +429,7 @@
                } else return false;
        }

-       private boolean removeMapping(String protocol, int port, ForwardPort 
fp) {
+       private boolean removeMapping(String protocol, int port, ForwardPort 
fp, boolean noLog) {
                if(isDisabled || !isNATPresent())
                        return false;

@@ -448,7 +448,8 @@
                        portsForwarded.remove(fp);
                }

-               System.err.println("UPnP: Removed mapping for "+fp.name+" 
"+port+" / "+protocol);
+               if(!noLog)
+                       System.err.println("UPnP: Removed mapping for 
"+fp.name+" "+port+" / "+protocol);
                return retval;
        }

@@ -543,7 +544,7 @@
                                // Ignore, we've already complained about it
                                continue;
                        }
-                       removeMapping(proto, port.portNumber, port);
+                       removeMapping(proto, port.portNumber, port, false);
                }
        }
 }
\ No newline at end of file


Reply via email to