adjust to DigestURI changes from master to DigestURL

pull/1/head
reger 11 years ago
parent 561cbc7ee2
commit bc6ebb3c06

@ -30,10 +30,10 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.kelondro.data.meta.DigestURI;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
@ -61,7 +61,7 @@ public class ProxyCacheHandler extends AbstractRemoteHandler implements Handler
public void handleRemote(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
if (request.getMethod().equals("GET")) {
String queryString = request.getQueryString() != null ? "?" + request.getQueryString() : "";
DigestURI url = new DigestURI(request.getRequestURL().toString() + queryString);
DigestURL url = new DigestURL(request.getRequestURL().toString() + queryString);
ResponseHeader cachedResponseHeader = Cache.getResponseHeader(url.hash());
if (cachedResponseHeader != null) {
@ -70,7 +70,7 @@ public class ProxyCacheHandler extends AbstractRemoteHandler implements Handler
final net.yacy.crawler.retrieval.Request yacyRequest = new net.yacy.crawler.retrieval.Request(
null,
url,
proxyHeaders.referer() == null ? null : new DigestURI(proxyHeaders.referer().toString()).hash(),
proxyHeaders.referer() == null ? null : new DigestURL(proxyHeaders.referer().toString()).hash(),
"",
cachedResponseHeader.lastModified(),
sb.crawler.defaultProxyProfile.handle(),

@ -34,13 +34,13 @@ import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.document.TextParser;
import net.yacy.kelondro.data.meta.DigestURI;
import org.apache.http.Header;
import org.apache.http.HttpResponse;
@ -117,7 +117,7 @@ public class ProxyHandler extends AbstractRemoteHandler implements Handler {
cleanResponseHeader(responseHeader);
// TODO: is this fast, if not, use value from ProxyCacheHandler
DigestURI digestURI = new DigestURI(url);
DigestURL digestURI = new DigestURL(url);
ResponseHeader cachedResponseHeader = Cache.getResponseHeader(digestURI.hash());
// the cache does either not exist or is (supposed to be) stale
@ -126,7 +126,7 @@ public class ProxyHandler extends AbstractRemoteHandler implements Handler {
// delete the cache
ResponseHeader rh = Cache.getResponseHeader(digestURI.hash());
if (rh != null && (sizeBeforeDelete = rh.getContentLength()) == 0) {
byte[] b = Cache.getContent(new DigestURI(url).hash());
byte[] b = Cache.getContent(new DigestURL(url).hash());
if (b != null) sizeBeforeDelete = b.length;
}
Cache.delete(digestURI.hash());

@ -26,9 +26,9 @@ package net.yacy.http;
import java.io.IOException;
import java.net.MalformedURLException;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.protocol.Domains;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.search.Switchboard;
import org.eclipse.jetty.security.RoleInfo;
@ -71,7 +71,7 @@ public class YaCySecurityHandler extends SecurityHandler {
String refererHost;
try {
refererHost = new DigestURI(request.getHeader("Referer")).getHost();
refererHost = new DigestURL(request.getHeader("Referer")).getHost();
} catch (MalformedURLException e) {
refererHost = null;
}

Loading…
Cancel
Save