Changeset 280fc05 for apps/addressbook


Ignore:
Timestamp:
May 30, 2015 1:53:56 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
94824e4d
Parents:
89745f5
Message:

susidns, addressbook: Don't attempt to fetch subscriptions if
HTTP proxy is down (ticket #1530)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/addressbook/java/src/net/i2p/addressbook/SubscriptionIterator.java

    r89745f5 r280fc05  
    2727
    2828import net.i2p.I2PAppContext;
     29import net.i2p.util.PortMapper;
    2930
    3031/**
     
    7071     *
    7172     * see java.util.Iterator#next()
    72      * @return an AddressBook (empty if the minimum delay has not been met)
     73     * @return non-null AddressBook (empty if the minimum delay has not been met,
     74     *          or there is no proxy tunnel, or the fetch otherwise fails)
    7375     */
    7476    public AddressBook next() {
    7577        Subscription sub = this.subIterator.next();
    76         if (sub.getLastFetched() + this.delay < I2PAppContext.getGlobalContext().clock().now()) {
     78        if (sub.getLastFetched() + this.delay < I2PAppContext.getGlobalContext().clock().now() &&
     79            I2PAppContext.getGlobalContext().portMapper().getPort(PortMapper.SVC_HTTP_PROXY) >= 0) {
    7780            //System.err.println("Fetching addressbook from " + sub.getLocation());
    7881            return new AddressBook(sub, this.proxyHost, this.proxyPort);
Note: See TracChangeset for help on using the changeset viewer.