forked from I2P_Developers/i2p.i2p
Update: Fix JVM crash and i2p.jar corruption when updating from -1
This commit is contained in:
@ -98,6 +98,9 @@ public class FileUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Warning - do not call any new classes from here, or
|
||||||
|
* update will crash the JVM.
|
||||||
|
*
|
||||||
* @param logLevel Log.WARN, etc.
|
* @param logLevel Log.WARN, etc.
|
||||||
* @return true if it was copied successfully
|
* @return true if it was copied successfully
|
||||||
* @since 0.9.7
|
* @since 0.9.7
|
||||||
@ -106,6 +109,7 @@ public class FileUtil {
|
|||||||
int files = 0;
|
int files = 0;
|
||||||
ZipFile zip = null;
|
ZipFile zip = null;
|
||||||
try {
|
try {
|
||||||
|
final byte buf[] = new byte[8192];
|
||||||
zip = new ZipFile(zipfile);
|
zip = new ZipFile(zipfile);
|
||||||
Enumeration<? extends ZipEntry> entries = zip.entries();
|
Enumeration<? extends ZipEntry> entries = zip.entries();
|
||||||
while (entries.hasMoreElements()) {
|
while (entries.hasMoreElements()) {
|
||||||
@ -153,7 +157,13 @@ public class FileUtil {
|
|||||||
System.err.println("INFO: File [" + entry.getName() + "] extracted and unpacked");
|
System.err.println("INFO: File [" + entry.getName() + "] extracted and unpacked");
|
||||||
} else {
|
} else {
|
||||||
fos = new FileOutputStream(target);
|
fos = new FileOutputStream(target);
|
||||||
DataHelper.copy(in, fos);
|
// We do NOT use DataHelper.copy() because it loads new classes
|
||||||
|
// and causes the update to crash.
|
||||||
|
//DataHelper.copy(in, fos);
|
||||||
|
int read;
|
||||||
|
while ((read = in.read(buf)) != -1) {
|
||||||
|
fos.write(buf, 0, read);
|
||||||
|
}
|
||||||
if (logLevel <= Log.INFO)
|
if (logLevel <= Log.INFO)
|
||||||
System.err.println("INFO: File [" + entry.getName() + "] extracted");
|
System.err.println("INFO: File [" + entry.getName() + "] extracted");
|
||||||
}
|
}
|
||||||
|
18
history.txt
18
history.txt
@ -1,3 +1,21 @@
|
|||||||
|
2016-12-22 zzz
|
||||||
|
* Blocklist:
|
||||||
|
- More efficiently check blocklist when receiving new RI
|
||||||
|
- Check blocklist when loading RIs
|
||||||
|
- Ensure blocklist is initialized before netdb
|
||||||
|
* Console: Limit age of news entries displayed
|
||||||
|
* Update: Fix JVM crash and i2p.jar corruption when updating from -1
|
||||||
|
|
||||||
|
2016-12-21 zzz
|
||||||
|
* NTP:
|
||||||
|
- Verify source address and port
|
||||||
|
- Add to command line
|
||||||
|
- Add KoD support (ticket #1896)
|
||||||
|
- Add initial IPv6 support (ticket #1897)
|
||||||
|
|
||||||
|
2016-12-20 zzz
|
||||||
|
* Build: Fix installer compile failure
|
||||||
|
|
||||||
2016-12-16 zzz
|
2016-12-16 zzz
|
||||||
* Router: Synchronize graceful exit code access
|
* Router: Synchronize graceful exit code access
|
||||||
* Update: Save blocklist version in UpdateManager
|
* Update: Save blocklist version in UpdateManager
|
||||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 1;
|
public final static long BUILD = 2;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
Reference in New Issue
Block a user