public void clearQueue() {
_model.clearLinkQueue();
}
private Request newGetRequest(Link link) {
HttpUrl url = link.getURL();
String referer = link.getReferer();
Request req = new Request();
req.setMethod("GET");
req.setURL(url);
req.setVersion("HTTP/1.0"); // 1.1 or 1.0?
if (referer != null) {
req.setHeader("Referer", referer);
}
req.setHeader("Host", url.getHost() + ":" + url.getPort());
if (req.getVersion().equals("HTTP/1.0"))
req.setHeader("Connection", "Keep-Alive");
NamedValue[] headers = _model.getExtraHeaders();
if (headers != null && headers.length > 0) {
for (int i=0; i< headers.length; i++) {