refactoring

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

@ -183,15 +183,6 @@ public class Response {
if (this.responseHeader != null) this.responseHeader.put(HeaderFramework.CONTENT_LENGTH, "0"); // 'virtual' length, shows that the resource was not loaded 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) { public void updateStatus(final int newStatus) {
this.status = newStatus; this.status = newStatus;
} }

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

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

@ -1921,7 +1921,7 @@ public final class Switchboard extends serverSwitch {
0, 0,
0, 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 = final IndexingQueueEntry queueEntry =
new IndexingQueueEntry(response, new Document[] {document}, null); new IndexingQueueEntry(response, new Document[] {document}, null);

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

Loading…
Cancel
Save