2005-11-21 jrandom
* IE doesn't strip SPAN from <button> form fields, so add in a workaround within I2PTunnel. * Increase the maximum SSU retransmission timeout to accomodate slower or more congested links (though SSU's RTO calculation will usually use a much lower timeout) * Moved the streaming lib timed events off the main timer queues and onto a streaming lib specific set of timer queues. Streaming lib timed events are more likely to have lock contention on the I2CP socket while other timed events in the router are (largely) independent. * Fixed a case sensitive lookup bug (thanks tino!) * Syndie cleanup - new edit form on the preview page, and fixed some blog links (thanks tino!)
This commit is contained in:
@ -64,9 +64,9 @@ public class HostsTxtNamingService extends NamingService {
|
||||
try {
|
||||
File f = new File(hostsfile);
|
||||
if ( (f.exists()) && (f.canRead()) ) {
|
||||
DataHelper.loadProps(hosts, f);
|
||||
DataHelper.loadProps(hosts, f, true);
|
||||
|
||||
String key = hosts.getProperty(hostname);
|
||||
String key = hosts.getProperty(hostname.toLowerCase());
|
||||
if ( (key != null) && (key.trim().length() > 0) ) {
|
||||
return lookupBase64(key);
|
||||
}
|
||||
|
@ -212,9 +212,15 @@ public class DataHelper {
|
||||
*
|
||||
*/
|
||||
public static void loadProps(Properties props, File file) throws IOException {
|
||||
loadProps(props, new FileInputStream(file));
|
||||
loadProps(props, file, false);
|
||||
}
|
||||
public static void loadProps(Properties props, File file, boolean forceLowerCase) throws IOException {
|
||||
loadProps(props, new FileInputStream(file), forceLowerCase);
|
||||
}
|
||||
public static void loadProps(Properties props, InputStream inStr) throws IOException {
|
||||
loadProps(props, inStr, false);
|
||||
}
|
||||
public static void loadProps(Properties props, InputStream inStr, boolean forceLowerCase) throws IOException {
|
||||
BufferedReader in = null;
|
||||
try {
|
||||
in = new BufferedReader(new InputStreamReader(inStr, "UTF-8"), 16*1024);
|
||||
@ -230,7 +236,10 @@ public class DataHelper {
|
||||
String key = line.substring(0, split);
|
||||
String val = line.substring(split+1);
|
||||
if ( (key.length() > 0) && (val.length() > 0) )
|
||||
props.setProperty(key, val);
|
||||
if (forceLowerCase)
|
||||
props.setProperty(key.toLowerCase(), val);
|
||||
else
|
||||
props.setProperty(key, val);
|
||||
}
|
||||
} finally {
|
||||
if (in != null) try { in.close(); } catch (IOException ioe) {}
|
||||
|
Reference in New Issue
Block a user