private VectorGraphics.VectorPath path = null;
//private SVG.Paint fill = null;
//private SVG.Paint stroke = null;
+ int strokewidth = 1;
public Picture image; // will disappear
private int fillcolor = 0x00000000; // will become SVG.Paint
} });
specialBoxProperties.put("strokewidth", new SpecialBoxProperty() {
- public Object get(Box b) { return b.strokewidth; }
+ public Object get(Box b) { return new Integer(b.strokewidth); }
public void put(Box b, Object value) {
if (b.strokewidth == stoi(value)) return;
b.strokewidth = stoi(value);
*/
Semaphore okToRecieve = null;
+ /** true iff this is the first request to be made on this socket */
+ boolean firstRequest = true;
+
/** cache for resolveAndCheckIfFirewalled() */
static Hashtable resolvedHosts = new Hashtable();
connect();
sendRequest(contentType, content);
} catch (IOException e) {
- sock = null;
- in = null;
+ reset();
throw e;
}
blockOn = okToRecieve;
Hashtable h = in == null ? null : parseHeaders(in);
if (h == null) {
+ if (firstRequest) throw new HTTPException("server closed the socket with no response");
// sometimes the server chooses to close the stream between requests
- in = null; sock = null;
+ reset();
releaseMe.release();
return makeRequest(contentType, content);
}
if (h.get("HTTP").equals("1.0") && h.get("content-length") == null) {
if (Log.on) Log.log(this, "proxy returned an HTTP/1.0 reply with no content-length...");
- in = null; sock = null;
+ reset();
} else {
int cl = h.get("content-length") == null ? -1 : Integer.parseInt(h.get("content-length").toString());
new HTTPInputStream(in, cl, releaseMe).close();
}
- } catch (IOException e) { sock = null; in = null; throw e;
+ } catch (IOException e) { reset(); throw e;
} finally { if (doRelease) releaseMe.release();
}
}
}
return ret;
} finally {
- if (!good) { HTTP.this.sock = null; HTTP.this.in = null; }
+ if (!good) reset();
}
}
}
}
+ void reset() {
+ firstRequest = true;
+ in = null;
+ sock = null;
+ }
+
// Misc Helpers ///////////////////////////////////////////////////////////////////////////////////