2002/07/01 22:02:10
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:48:39 +0000 (06:48 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:48:39 +0000 (06:48 +0000)
darcs-hash:20040130064839-2ba56-de7a737066b636802dc06b9718c479e33e8ee440.gz

CHANGES
src/org/xwt/HTTP.java

diff --git a/CHANGES b/CHANGES
index c1a3330..a872ea5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 
 01-Jul megacz Platform.java: initial window size fixes
 
+01-Jul megacz HTTP.java: we no longer insert the IP into the URL.
+
index 702e993..6323b52 100644 (file)
@@ -65,7 +65,7 @@ public class HTTP {
         host = this.url.getHost();
         if (Log.on) Log.log(this, "creating HTTP object for connection to " + host + ":" + port);
         addHeader("Host", host);                                           // host header is always sent verbatim
-        if (!skipResolveCheck) host = resolveAndCheckIfFirewalled(host);   // might have to use the strict IP if behind a proxy
+        if (!skipResolveCheck) resolveAndCheckIfFirewalled(host);   // might have to use the strict IP if behind a proxy
 
         ProxyInfo pi = Platform.detectProxy();
         if (sock == null && pi != null && pi.proxyAutoConfigFunction != null) sock = attemptPAC(pi.proxyAutoConfigFunction);
@@ -83,13 +83,13 @@ public class HTTP {
      *  resolves the hostname and returns it as a string in the form "x.y.z.w", except for the special case "xmlrpc.xwt.org".
      *  @throws HTTPException if the host falls within a firewalled netblock
      */
-    private String resolveAndCheckIfFirewalled(String host) throws HTTPException {
+    private void resolveAndCheckIfFirewalled(String host) throws HTTPException {
 
         // special case
-        if (host.equals("xmlrpc.xwt.org")) return host;
+        if (host.equals("xmlrpc.xwt.org")) return;
 
         // cached
-        if (resolvedHosts.get(host) != null) return (String)resolvedHosts.get(host);
+        if (resolvedHosts.get(host) != null) return;
 
         if (Log.on) Log.log(this, "  resolveAndCheckIfFirewalled: resolving " + host);
 
@@ -101,7 +101,7 @@ public class HTTP {
                  (quadbyte[0] == 192 && quadbyte[1] == 168) ||
                  (quadbyte[0] == 172 && (quadbyte[1] & 0xF0) == 16)) && !addr.equals(Main.originAddr))
                 throw new HTTPException("security violation: " + host + " [" + addr.getHostAddress() + "] is in a firewalled netblock");
-            return addr.getHostAddress();
+            return;
         } catch (UnknownHostException uhe) { }
 
         // resolve using xmlrpc.xwt.org
@@ -111,7 +111,7 @@ public class HTTP {
             Object ret = new XMLRPC("http://xmlrpc.xwt.org/RPC2/", "dns.resolve").call(new Object[] { host });
             if (ret == null || !(ret instanceof String)) throw new Exception("    xmlrpc.xwt.org returned non-String: " + ret);
             resolvedHosts.put(host, ret);
-            return (String)ret;
+            return;
         } catch (Throwable e) {
             throw new HTTPException("exception while attempting to use xmlrpc.xwt.org to resolve " + host + ": " + e);
         }