Changeset 4f3c15e


Ignore:
Timestamp:
Jul 4, 2011 10:07:13 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
476caf3
Parents:
c8397990
Message:

use HostsTxtNamingService? if default fails to initialize

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/client/naming/NamingService.java

    rc8397990 r4f3c15e  
    3737    public static final String PROP_IMPL = "i2p.naming.impl";
    3838    private static final String DEFAULT_IMPL = "net.i2p.client.naming.BlockfileNamingService";
     39    private static final String BACKUP_IMPL = "net.i2p.client.naming.HostsTxtNamingService";
    3940   
    4041    /**
     
    435436        } catch (Exception ex) {
    436437            Log log = context.logManager().getLog(NamingService.class);
    437             log.error("Cannot load naming service " + impl + ", only .b32.i2p lookups will succeed", ex);
    438             instance = new DummyNamingService(context); // fallback
     438            // Blockfile may throw RuntimeException but HostsTxt won't
     439            if (!impl.equals(BACKUP_IMPL)) {
     440                log.error("Cannot load naming service " + impl + ", using HostsTxtNamingService", ex);
     441                instance = new HostsTxtNamingService(context);
     442            } else {
     443                log.error("Cannot load naming service " + impl + ", only .b32.i2p lookups will succeed", ex);
     444                instance = new DummyNamingService(context);
     445            }
    439446        }
    440447        return instance;
Note: See TracChangeset for help on using the changeset viewer.