diff --git a/apps/addressbook/java/src/net/i2p/addressbook/SubscriptionIterator.java b/apps/addressbook/java/src/net/i2p/addressbook/SubscriptionIterator.java index cf7b04fc0..b8b1df28b 100644 --- a/apps/addressbook/java/src/net/i2p/addressbook/SubscriptionIterator.java +++ b/apps/addressbook/java/src/net/i2p/addressbook/SubscriptionIterator.java @@ -26,6 +26,7 @@ import java.util.Iterator; import java.util.List; import net.i2p.I2PAppContext; +import net.i2p.util.PortMapper; /** * An iterator over the subscriptions in a SubscriptionList. Note that this iterator @@ -69,11 +70,13 @@ class SubscriptionIterator implements Iterator { * Yes, the EepGet fetch() is done in here in next(). * * see java.util.Iterator#next() - * @return an AddressBook (empty if the minimum delay has not been met) + * @return non-null AddressBook (empty if the minimum delay has not been met, + * or there is no proxy tunnel, or the fetch otherwise fails) */ public AddressBook next() { Subscription sub = this.subIterator.next(); - if (sub.getLastFetched() + this.delay < I2PAppContext.getGlobalContext().clock().now()) { + if (sub.getLastFetched() + this.delay < I2PAppContext.getGlobalContext().clock().now() && + I2PAppContext.getGlobalContext().portMapper().getPort(PortMapper.SVC_HTTP_PROXY) >= 0) { //System.err.println("Fetching addressbook from " + sub.getLocation()); return new AddressBook(sub, this.proxyHost, this.proxyPort); } else { diff --git a/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java b/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java index ec869f625..e1088557a 100644 --- a/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java +++ b/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java @@ -36,6 +36,7 @@ import java.util.Collections; import java.util.List; import net.i2p.data.DataHelper; +import net.i2p.util.PortMapper; import net.i2p.util.SecureFileOutputStream; public class SubscriptionsBean extends BaseBean @@ -136,7 +137,8 @@ public class SubscriptionsBean extends BaseBean // with the correct parameters will kick off a // config reload and fetch. *******/ - if (content != null && content.length() > 2) { + if (content != null && content.length() > 2 && + _context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) > 0) { message = _("Subscriptions saved, updating addressbook from subscription sources now."); // + "\"\"";