Changeset 2a739f5 for router


Ignore:
Timestamp:
May 25, 2016 1:53:21 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0e94162
Parents:
d48f70c2
Message:

Reseed: Require two sources minimum (ticket #1794)

Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/RouterVersion.java

    rd48f70c2 r2a739f5  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 12;
     21    public final static long BUILD = 13;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java

    rd48f70c2 r2a739f5  
    6464    /** if false, use su3 only, and disable fallback reading directory index and individual dat files */
    6565    private static final boolean ENABLE_NON_SU3 = false;
     66    private static final int MIN_RI_WANTED = 100;
     67    private static final int MIN_RESEED_SERVERS = 2;
    6668
    6769    /**
     
    242244     *  which is the lowest Android we support anyway.
    243245     *
     246     *  Not guaranteed to be correct, e.g. FreeBSD:
     247     *  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201446
     248     *
    244249     *  @since 0.9.20
    245250     */
     
    525530        private int reseed(List<URI> URLList, boolean echoStatus) {
    526531            int total = 0;
     532            int fetched_reseed_servers = 0;
    527533            for (int i = 0; i < URLList.size() && _isRunning; i++) {
    528534                if (_context.router().gracefulShutdownInProgress()) {
     
    543549                if (dl > 0) {
    544550                    total += dl;
     551                    fetched_reseed_servers++;
    545552                    // Don't go on to the next URL if we have enough
    546                     if (total >= 100)
     553                    if (total >= MIN_RI_WANTED && fetched_reseed_servers >= MIN_RESEED_SERVERS)
    547554                        break;
    548555                    // remove alternate versions if we haven't tried them yet
Note: See TracChangeset for help on using the changeset viewer.