forked from I2P_Developers/i2p.i2p
propagate from branch 'i2p.i2p' (head 5d56a7eb371dddb9336e596bda69f99c91294b05)
to branch 'i2p.i2p.str4d.ui' (head 3aeafcdb5c0ffbc9c77f574558f8438d3e81133e)
This commit is contained in:
@@ -46,6 +46,7 @@ import net.i2p.util.OrderedProperties;
|
||||
import net.i2p.util.ReusableGZIPInputStream;
|
||||
import net.i2p.util.ReusableGZIPOutputStream;
|
||||
import net.i2p.util.SecureFileOutputStream;
|
||||
import net.i2p.util.SystemVersion;
|
||||
import net.i2p.util.Translate;
|
||||
|
||||
/**
|
||||
@@ -55,6 +56,9 @@ import net.i2p.util.Translate;
|
||||
*/
|
||||
public class DataHelper {
|
||||
|
||||
/** See storeProps(). 600-750 ms on RPi. */
|
||||
private static final boolean SHOULD_SYNC = !(SystemVersion.isAndroid() || SystemVersion.isARM());
|
||||
|
||||
/**
|
||||
* Map of String to itself to cache common
|
||||
* keys in RouterInfo, RouterAddress, and BlockfileNamingService properties.
|
||||
@@ -68,9 +72,9 @@ public class DataHelper {
|
||||
"cost", "host", "port",
|
||||
// SSU RouterAddress options
|
||||
"key", "mtu",
|
||||
"ihost0", "iport0", "ikey0", "itag0",
|
||||
"ihost1", "iport1", "ikey1", "itag1",
|
||||
"ihost2", "iport2", "ikey2", "itag2",
|
||||
"ihost0", "iport0", "ikey0", "itag0", "iexp0",
|
||||
"ihost1", "iport1", "ikey1", "itag1", "iexp1",
|
||||
"ihost2", "iport2", "ikey2", "itag2", "iexp2",
|
||||
// RouterInfo options
|
||||
"caps", "coreVersion", "netId", "router.version",
|
||||
"netdb.knownLeaseSets", "netdb.knownRouters",
|
||||
@@ -514,8 +518,10 @@ public class DataHelper {
|
||||
}
|
||||
out.println(name + "=" + val);
|
||||
}
|
||||
out.flush();
|
||||
fos.getFD().sync();
|
||||
if (SHOULD_SYNC) {
|
||||
out.flush();
|
||||
fos.getFD().sync();
|
||||
}
|
||||
out.close();
|
||||
if (out.checkError()) {
|
||||
out = null;
|
||||
|
||||
Reference in New Issue
Block a user