Changeset 27b4803
- Timestamp:
- May 25, 2011 1:34:32 PM (10 years ago)
- Branches:
- master
- Children:
- 82a0ac1
- Parents:
- 641e71c
- Location:
- core/java/src/net/i2p/client/naming
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
core/java/src/net/i2p/client/naming/BlockfileNamingService.java
r641e71c r27b4803 372 372 if (d != null) 373 373 return d; 374 // Base32 failed? 375 if (hostname.length() == BASE32_HASH_LENGTH + 8 && hostname.toLowerCase().endsWith(".b32.i2p")) 376 return null; 374 377 } 375 378 -
core/java/src/net/i2p/client/naming/DummyNamingService.java
r641e71c r27b4803 20 20 class DummyNamingService extends NamingService { 21 21 22 pr ivatestatic final int BASE32_HASH_LENGTH = 52; // 1 + Hash.HASH_LENGTH * 8 / 522 protected static final int BASE32_HASH_LENGTH = 52; // 1 + Hash.HASH_LENGTH * 8 / 5 23 23 public final static String PROP_B32 = "i2p.naming.hostsTxt.useB32"; 24 24 protected static final int CACHE_MAX_SIZE = 32; … … 42 42 } 43 43 44 /** 45 * @param hostname mixed case as it could be a key 46 * @param lookupOptions input parameter, NamingService-specific, can be null 47 * @param storedOptions output parameter, NamingService-specific, any stored properties will be added if non-null 48 * @return dest or null 49 * @since 0.8.7 50 */ 44 51 @Override 45 52 public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions) { … … 57 64 58 65 // Try Base32 decoding 59 if (hostname.length() == BASE32_HASH_LENGTH + 8 && hostname. endsWith(".b32.i2p") &&66 if (hostname.length() == BASE32_HASH_LENGTH + 8 && hostname.toLowerCase().endsWith(".b32.i2p") && 60 67 _context.getBooleanPropertyDefaultTrue(PROP_B32)) { 61 68 d = LookupDest.lookupBase32Hash(_context, hostname.substring(0, BASE32_HASH_LENGTH)); … … 71 78 /** 72 79 * Provide basic static caching for all services 80 * @param s case-sensitive, could be a hostname or a full b64 string 73 81 */ 74 82 protected static void putCache(String s, Destination d) { … … 80 88 } 81 89 82 /** @return cached dest or null */ 90 /** 91 * @param s case-sensitive, could be a hostname or a full b64 string 92 * @return cached dest or null 93 */ 83 94 protected static Destination getCache(String s) { 84 95 synchronized (_cache) { … … 87 98 } 88 99 89 /** @since 0.8.7 */ 100 /** 101 * @param s case-sensitive, could be a hostname or a full b64 string 102 * @since 0.8.7 103 */ 90 104 protected static void removeCache(String s) { 91 105 synchronized (_cache) { -
core/java/src/net/i2p/client/naming/EepGetNamingService.java
r641e71c r27b4803 67 67 68 68 hostname = hostname.toLowerCase(); 69 // Base32 failed? 70 if (hostname.length() == BASE32_HASH_LENGTH + 8 && hostname.endsWith(".b32.i2p")) 71 return null; 69 72 70 73 List URLs = getURLs(); -
core/java/src/net/i2p/client/naming/ExecNamingService.java
r641e71c r27b4803 65 65 if (d != null) 66 66 return d; 67 // Base32 failed? 68 if (hostname.length() == BASE32_HASH_LENGTH + 8 && hostname.toLowerCase().endsWith(".b32.i2p")) 69 return null; 67 70 68 71 hostname = hostname.toLowerCase(); -
core/java/src/net/i2p/client/naming/MetaNamingService.java
r641e71c r27b4803 101 101 if (d != null) 102 102 return d; 103 // Base32 failed? 104 if (hostname.length() == BASE32_HASH_LENGTH + 8 && hostname.toLowerCase().endsWith(".b32.i2p")) 105 return null; 103 106 104 107 for (NamingService ns : _services) { -
core/java/src/net/i2p/client/naming/NamingService.java
r641e71c r27b4803 423 423 * choose the implementation from the "i2p.naming.impl" system 424 424 * property. 425 * 426 * FIXME Actually, it doesn't ensure that. Only call this once!!! 425 427 */ 426 428 public static final synchronized NamingService createInstance(I2PAppContext context) {
Note: See TracChangeset
for help on using the changeset viewer.