X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2FHTTP.java;fp=src%2Forg%2Fxwt%2FHTTP.java;h=146389721469b0c61488fc866e0c91d667643317;hp=681b928a614ec505b71ba822d035431a15e7493e;hb=3591b88b94a6bb378af3d4abe6eb5233ce583104;hpb=de378041d5ca2aca1a2b5a31ef15ae90a86c977f diff --git a/src/org/xwt/HTTP.java b/src/org/ibex/HTTP.java similarity index 98% rename from src/org/xwt/HTTP.java rename to src/org/ibex/HTTP.java index 681b928..1463897 100644 --- a/src/org/xwt/HTTP.java +++ b/src/org/ibex/HTTP.java @@ -1,11 +1,11 @@ // Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] -package org.xwt; +package org.ibex; import java.net.*; import java.io.*; import java.util.*; -import org.xwt.js.*; -import org.xwt.util.*; +import org.ibex.js.*; +import org.ibex.util.*; import org.bouncycastle.util.encoders.Base64; import org.bouncycastle.crypto.digests.*; @@ -117,7 +117,7 @@ public class HTTP { } else if (reply.startsWith("2")) { if (h.get("HTTP").equals("1.0") && h.get("content-length") == null) - throw new HTTPException("XWT does not support HTTP/1.0 servers which fail to return the Content-Length header"); + throw new HTTPException("Ibex does not support HTTP/1.0 servers which fail to return the Content-Length header"); int cl = h.get("content-length") == null ? -1 : Integer.parseInt(h.get("content-length").toString()); InputStream ret = new HTTPInputStream(in, cl, releaseMe); if ("gzip".equals(h.get("content-encoding"))) ret = new java.util.zip.GZIPInputStream(ret); @@ -264,11 +264,11 @@ public class HTTP { } /** executes the PAC script and dispatches a call to one of the other attempt methods based on the result */ - private Socket attemptPAC(org.xwt.js.JS pacFunc) { + private Socket attemptPAC(org.ibex.js.JS pacFunc) { if (Log.verbose) Log.info(this, "evaluating PAC script"); String pac = null; try { - org.xwt.js.JSArray args = new org.xwt.js.JSArray(); + org.ibex.js.JSArray args = new org.ibex.js.JSArray(); Object obj = pacFunc.call(url.toString(), url.getHost(), null, null, 2); if (Log.verbose) Log.info(this, " PAC script returned \"" + obj + "\""); pac = obj.toString(); @@ -365,7 +365,7 @@ public class HTTP { pw.print("GET " + path + " HTTP/1.1\r\n"); } - pw.print("User-Agent: XWT\r\n"); + pw.print("User-Agent: Ibex\r\n"); pw.print("Accept-encoding: gzip\r\n"); pw.print("Host: " + (host + (port == 80 ? "" : (":" + port))) + "\r\n"); if (proxied) pw.print("X-RequestOrigin: " + Main.originHost + "\r\n"); @@ -748,7 +748,7 @@ public class HTTP { Log.info(Platform.class, "WPAD detection failed due to:"); if (e instanceof JSExn) { try { - org.xwt.js.JSArray arr = new org.xwt.js.JSArray(); + org.ibex.js.JSArray arr = new org.ibex.js.JSArray(); arr.addElement(((JSExn)e).getObject()); } catch (Exception e2) { Log.info(Platform.class, e); @@ -781,7 +781,7 @@ public class HTTP { Scheduler.add(new Scheduler.Task() { public void perform() throws Exception { Box b = new Box(); - Template t = Template.buildTemplate(Stream.getInputStream((JS)Main.builtin.get("org/xwt/builtin/proxy_authorization.xwt")), new XWT(null)); + Template t = Template.buildTemplate(Stream.getInputStream((JS)Main.builtin.get("org/ibex/builtin/proxy_authorization.ibex")), new Ibex(null)); t.apply(b); b.put("realm", realm); b.put("proxyIP", proxyIP); @@ -894,8 +894,8 @@ public class HTTP { return ((d1 <= d2 && day >= d1 && day <= d2) || (d1 > d2 && (day >= d1 || day <= d2))) ? T : F; - case "dateRange": throw new JSExn("XWT does not support dateRange() in PAC scripts"); - case "timeRange": throw new JSExn("XWT does not support timeRange() in PAC scripts"); + case "dateRange": throw new JSExn("Ibex does not support dateRange() in PAC scripts"); + case "timeRange": throw new JSExn("Ibex does not support timeRange() in PAC scripts"); //#end return super.callMethod(method, a0, a1, a2, rest, nargs); }