mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Add a connect and read timeout for downloading libraries. This should really stop the "waiting forever" at startup screen.
This commit is contained in:
1 parent
0d5affede3
commit
9c6c56c49d
1 file changed
+4
-2
@@ -412,6 +412,8 @@ public class RelaunchLibraryManager
|
||||
downloadMonitor.updateProgressString(infoString);
|
||||
FMLRelaunchLog.info(infoString);
|
||||
URLConnection connection = libDownload.openConnection();
|
||||
connection.setConnectTimeout(5000);
|
||||
connection.setReadTimeout(5000);
|
||||
connection.setRequestProperty("User-Agent", "FML Relaunch Downloader");
|
||||
int sizeGuess = connection.getContentLength();
|
||||
performDownload(connection.getInputStream(), sizeGuess, hash, libFile);
|
||||
@@ -422,13 +424,13 @@ public class RelaunchLibraryManager
|
||||
{
|
||||
if (downloadMonitor.stopIt)
|
||||
{
|
||||
FMLRelaunchLog.warning("You have stopped downloads in progress");
|
||||
FMLRelaunchLog.warning("You have stopped the downloading operation before it could complete");
|
||||
return;
|
||||
}
|
||||
if (e instanceof RuntimeException) throw (RuntimeException)e;
|
||||
FMLRelaunchLog.severe("There was a problem downloading the file %s automatically. Perhaps you " +
|
||||
"have an environment without internet access. You will need to download " +
|
||||
"the file manually\n", libFile.getName());
|
||||
"the file manually or restart and let it try again\n", libFile.getName());
|
||||
libFile.delete();
|
||||
throw new RuntimeException("A download error occured", e);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user