refactoring

pull/1/head
Michael Peter Christen 11 years ago
parent 982601017e
commit ba6ffddefc

@ -182,16 +182,7 @@ public class Response {
this.fromCache = true;
if (this.responseHeader != null) this.responseHeader.put(HeaderFramework.CONTENT_LENGTH, "0"); // 'virtual' length, shows that the resource was not loaded
}
public Response(
final Request request,
final RequestHeader requestHeader,
final ResponseHeader responseHeader,
final CrawlProfile profile,
final boolean fromCache) {
this(request, requestHeader, responseHeader, profile, fromCache, null);
}
public void updateStatus(final int newStatus) {
this.status = newStatus;
}

@ -83,7 +83,8 @@ public class ProxyCacheHandler extends AbstractRemoteHandler implements Handler
proxyHeaders,
cachedResponseHeader,
sb.crawler.defaultProxyProfile,
false);
false,
null);
byte[] cacheContent = Cache.getContent(url.hash());
if (cacheContent != null && cachedResponse.isFreshForProxy()) {
handleRequestFromCache(request, response, cachedResponseHeader, cacheContent);

@ -190,7 +190,8 @@ public class ProxyHandler extends AbstractRemoteHandler implements Handler {
null,
responseHeaderLegacy,
sb.crawler.defaultProxyProfile,
false
false,
null
);
final String storeError = yacyResponse.shallStoreCacheForProxy();

@ -1921,7 +1921,7 @@ public final class Switchboard extends serverSwitch {
0,
0,
0);
response = new Response(request, null, null, this.crawler.defaultSurrogateProfile, false);
response = new Response(request, null, null, this.crawler.defaultSurrogateProfile, false, null);
final IndexingQueueEntry queueEntry =
new IndexingQueueEntry(response, new Document[] {document}, null);

@ -374,7 +374,8 @@ public final class HTTPDProxyHandler {
requestHeader,
cachedResponseHeader,
sb.crawler.defaultProxyProfile,
true
true,
null
);
final byte[] cacheContent = Cache.getContent(url.hash());
if (cacheContent != null && response.isFreshForProxy()) {
@ -520,7 +521,8 @@ public final class HTTPDProxyHandler {
requestHeader,
responseHeader,
sb.crawler.defaultProxyProfile,
true
true,
null
);
final String storeError = response.shallStoreCacheForProxy();
final boolean storeHTCache = response.profile().storeHTCache();

Loading…
Cancel
Save