Merge branch 'master' into noEngineAvailable

This commit is contained in:
Guenther Demetz
2019-06-06 10:28:10 +02:00
10 changed files with 193 additions and 55 deletions
@@ -601,6 +601,8 @@ public abstract class Getdown
int ii = 0; for (Resource prsrc : list) {
ProgressObserver pobs = pragg.startElement(ii++);
try {
// if this patch file failed to download, skip it
if (!prsrc.getLocalNew().exists()) continue;
// install the patch file (renaming them from _new)
prsrc.install(false);
// now apply the patch
@@ -663,6 +665,10 @@ public abstract class Getdown
log.warning("Download failed", "rsrc", rsrc, e);
}
@Override protected void resourceMissing (Resource rsrc) {
log.warning("Resource missing (got 404)", "rsrc", rsrc);
}
/** The last percentage at which we checked for another getdown running, or -1 for not
* having checked at all. */
protected int _lastCheck = -1;
@@ -23,6 +23,10 @@ function dnsResolve (host) {
return resolver.dnsResolve(host)
}
function myIpAddress () {
return resolver.myIpAddress()
}
function isInNet (addrOrHost, pattern, maskstr) {
var testRE = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
var test = testRE.exec(addrOrHost);
@@ -6,6 +6,7 @@
package com.threerings.getdown.launcher;
import java.io.StringReader;
import java.net.InetAddress;
import java.net.URL;
import org.junit.Test;
@@ -133,5 +134,12 @@ public class ProxyUtilTest {
// return 'DIRECT';
// }
// }
String MYIP =
"function FindProxyForURL(url, host) {\n" +
" return 'PROXY ' + myIpAddress() + ':8080';\n" +
"}";
String myIp = InetAddress.getLocalHost().getHostAddress();
testPAC(MYIP, "http://testurl.com/", "PROXY " + myIp + ":8080");
}
}