return;
} catch (UnknownHostException uhe) { }
- if (Platform.detectProxy() == null) throw new HTTPException("could not resolve hostname \"" + host + "\" and no proxy configured");
- if (Log.on) Log.log(this, " could not resolve host " + host + "; using xmlrpc.xwt.org to ensure security");
- try {
- JS.Array args = new JS.Array();
- args.addElement(host);
- Object ret = new XMLRPC("http://xmlrpc.xwt.org/RPC2/", "dns.resolve").call(args);
- if (ret == null || !(ret instanceof String)) throw new Exception(" xmlrpc.xwt.org returned non-String: " + ret);
- resolvedHosts.put(host, ret);
- return;
- } catch (Throwable e) {
- throw new HTTPException("exception while attempting to use xmlrpc.xwt.org to resolve " + host + ": " + e);
- }
+ if (Platform.detectProxy() == null)
+ throw new HTTPException("could not resolve hostname \"" + host + "\" and no proxy configured");
}
org.xwt.js.JS.Array args = new org.xwt.js.JS.Array();
args.addElement(url.toString());
args.addElement(url.getHost());
+ /* FIXME
Object obj = pacFunc.call(args);
if (Log.verbose) Log.log(this, " PAC script returned \"" + obj + "\"");
pac = obj.toString();
+ */
} catch (Throwable e) {
if (Log.on) Log.log(this, "PAC script threw exception " + e);
return null;
// HTTPInputStream ///////////////////////////////////////////////////////////////////////////////////
/** An input stream that represents a subset of a longer input stream. Supports HTTP chunking as well */
- public class HTTPInputStream extends FilterInputStream {
+ public class HTTPInputStream extends FilterInputStream implements KnownLength {
/** if chunking, the number of bytes remaining in this subset; otherwise the remainder of the chunk */
private int length = 0;
this.length = length == -1 ? 0 : length;
}
+ public int getLength() { return contentLength; }
public boolean markSupported() { return false; }
public int read(byte[] b) throws IOException { return read(b, 0, b.length); }
public long skip(long n) throws IOException { return read(null, -1, (int)n); }
}
JS.CompiledFunction scr = JS.parse("PAC script at " + url, 0, new StringReader(script));
+ // FIXME
+ /*
scr.call(new JS.Array(), proxyAutoConfigRootScope);
+ */
return (JS.Callable)proxyAutoConfigRootScope.get("FindProxyForURL");
} catch (Exception e) {
if (Log.on) {
if (authorization != oldAuth) return;
if (Log.on) Log.log(Authorization.class, "displaying proxy authorization dialog");
+ /*
+ FIXME
Message.Q.add(new Message() {
public void perform() {
Box b = new Box();
b.put("proxyIP", proxyIP);
}
});
-
+ */
waitingForUser.block();
if (Log.on) Log.log(Authorization.class, "got proxy authorization info; re-attempting connection");