if (Log.verbose) Log.info(this, "evaluating PAC script");
String pac = null;
try {
- 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();
public static void sleep(final int i) throws JSExn {
try {
final JS.UnpauseCallback callback = JS.pause();
- final long currentTime = System.currentTimeMillis();
// FEATURE use a single sleeper thread
new Thread() { public void run() {
try { Thread.sleep(i); } catch (InterruptedException e) { }
if (Log.on) Log.info(Main.class, "loading xwar");
final Ibex ibex = new Ibex(rr);
- final JS final_rr = (JS)ibex.get("");
scarImage =
Picture.load((Stream)Main.builtin.get("org/ibex/builtin/scar.png"),
if (button == 1) new Message("_Press1", T, root);
else if (button == 2) new Message("_Press2", T, root);
else if (button == 3) {
- final Box who = root;
Scheduler.add(new Scheduler.Task() { public void perform() throws JSExn {
Platform.clipboardReadEnabled = true;
try {
while (pt.hasMoreTokens()) v.addElement(new Float(pt.parseFloat()));
float[] dashes = new float[v.size() % 2 == 0 ? v.size() : 2 * v.size()];
for(int i=0; i<dashes.length; i++) dashes[i] = ((Float)v.elementAt(i % v.size())).floatValue();
- float length = 0;
int dashpos = dashOffset;
boolean on = dashpos % 2 == 0;
for(int i=0; i<numvertices; i++) {
/** if you enqueue a function, it gets invoked in its own pauseable context */
public void perform() throws JSExn {
Interpreter i = new Interpreter(this, true, new JSArray());
- int oldpausecount = i.pausecount;
i.resume();
}
private int getString(int c) throws IOException {
StringBuffer stringBuf = null;
int quoteChar = c;
- int val = 0;
c = in.read();
in.startString(); // start after the first "
while(c != quoteChar) {
int i = 0;
if (peekToken() != RB)
while(true) { // iterate over the initialization values
- int size = b.size;
b.add(parserLine, LITERAL, JS.N(i++)); // push the index in the array to place it into
if (peekToken() == COMMA || peekToken() == RB)
b.add(parserLine, LITERAL, null); // for stuff like [1,,2,]
startExpr(b, precedence[tok]);
- int size = b.size;
-
if (tok != ADD_TRAP && tok != DEL_TRAP) {
// tok-1 is always s/^ASSIGN_// (0 is BITOR, 1 is ASSIGN_BITOR, etc)
b.add(parserLine, tok - 1, tok-1==ADD ? JS.N(2) : null);
if (peekToken() != RP) {
// extended Ibex catch block: catch(e faultCode "foo.bar.baz")
consume(NAME);
- String propName = string;
b.add(parserLine, DUP);
b.add(parserLine, LITERAL, string);
b.add(parserLine, GET);
private static final int min(int a, int b) { return a < b ? a : b; }
public void draw(int dx, int dy, int cx1, int cy1, int cx2, int cy2) {
- int totalWidth = width;
- int totalHeight = height;
// *{x,y}{1,2} key: d=dest s=src, p=bounds of this picture, i=intersection of s and p, pd = dest of this pic
for(int i=0;i<pics.length;i++) {
for(int j=0;j<pics[i].length;j++) {
CFFILE file = (CFFILE)h.folders[i].files.elementAt(j);
if (file.fileName.equals(fileName)) return new LimitStream(is2, file.fileSize);
byte[] b = new byte[file.fileSize];
- int read = is2.read(b);
}
}
}
InputStream readBlock() throws IOException {
- int checksum = readLittleInt(dis);
int compressedBytes = readLittleShort(dis);
int unCompressedBytes = readLittleShort(dis);
byte[] reserved = new byte[/*folder.header.perDatablockReservedSize*/0];
byte[] rec = readHandshake();
handshakes = concat(new byte[][] { handshakes, rec });
- DataInputStream stream = new DataInputStream(new ByteArrayInputStream(rec, 4, rec.length - 4));
switch(rec[0]) {
case 2: // ServerHello
if (server_cert == null) {
server_cert = this_cert;
TBSCertificateStructure tbs = server_cert.getTBSCertificate();
- X509Name subject = tbs.getSubject();
// gross hack to extract the Common Name so we can compare it to the server hostname
String CN = tbs.getSubject().toString() + " ";