Improve downloading http textures. (#108)

This commit is contained in:
ZekerZhayard authored and GitHub committed 2020-08-16 19:50:19 +08:00
1 parent a8c8edaf20
commit f64af50a07
5 files changed
+119 -53

No files matched your search

@@ -208,7 +208,7 @@ public class HttpRequestUtil {
return responce;
} catch (Exception e) {
CustomSkinLoader.logger.debug("Failed to request (Exception: " + e.toString() + ")");
CustomSkinLoader.logger.debug("Failed to request " + request.url + " (Exception: " + e.toString() + ")");
return loadFromCache(request, new HttpResponce());
}
}
@@ -224,7 +224,7 @@ public class HttpRequestUtil {
private static HttpResponce loadFromCache(HttpRequest request, HttpResponce responce, long expireTime) {
if (request.cacheFile == null || !request.cacheFile.isFile())
return responce;
CustomSkinLoader.logger.debug("Cache file found (Length: " + request.cacheFile.length() + " , Path: '" + request.cacheFile.getAbsolutePath() + "' , Expire: " + expireTime + "')");
CustomSkinLoader.logger.debug("Cache file found (Length: " + request.cacheFile.length() + " , Path: '" + request.cacheFile.getAbsolutePath() + "' , Expire: " + expireTime + ")");
responce.fromCache = true;
responce.success = true;
if (!request.loadContent)