*) direct access to requestheader of htCache.Entry removed to make it more http independent

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2486 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent 3870d615e3
commit ffbf416e76

@ -630,7 +630,7 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
String storeError = cacheEntry.shallStoreCacheForProxy(); String storeError = cacheEntry.shallStoreCacheForProxy();
boolean storeHTCache = cacheEntry.profile().storeHTCache(); boolean storeHTCache = cacheEntry.profile().storeHTCache();
boolean isSupportedContent = plasmaParser.supportedContent(plasmaParser.PARSER_MODE_PROXY,cacheEntry.url(),cacheEntry.responseHeader().mime()); boolean isSupportedContent = plasmaParser.supportedContent(plasmaParser.PARSER_MODE_PROXY,cacheEntry.url(),cacheEntry.getMimeType());
if ( if (
/* /*
* Now we store the response into the htcache directory if * Now we store the response into the htcache directory if

@ -842,14 +842,33 @@ public final class plasmaHTCache {
return this.cacheArray; return this.cacheArray;
} }
public httpHeader requestHeader() { // public httpHeader requestHeader() {
return this.requestHeader; // return this.requestHeader;
} // }
public httpHeader responseHeader() { public httpHeader responseHeader() {
return this.responseHeader; return this.responseHeader;
} }
public String getMimeType() {
return (this.responseHeader == null) ? null : this.responseHeader.mime();
}
public Date ifModifiedSince() {
return (this.requestHeader == null) ? null : this.requestHeader.ifModifiedSince();
}
public boolean requestWithCookie() {
return (this.requestHeader == null) ? false : this.requestHeader.containsKey(httpHeader.COOKIE);
}
public boolean requestProhibitsIndexing() {
return (this.requestHeader == null)
? false
: this.requestHeader.containsKey(httpHeader.X_YACY_INDEX_CONTROL) &&
((String)this.requestHeader.get(httpHeader.X_YACY_INDEX_CONTROL)).toUpperCase().equals("NO-INDEX");
}
/* /*
public boolean update() { public boolean update() {
return ((status == CACHE_FILL) || (status == CACHE_STALE_RELOAD_GOOD)); return ((status == CACHE_FILL) || (status == CACHE_STALE_RELOAD_GOOD));

@ -813,8 +813,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
* *
* Testing if the content type is supported by the available parsers * Testing if the content type is supported by the available parsers
* ========================================================================= */ * ========================================================================= */
boolean isSupportedContent = (entry.responseHeader() != null) && boolean isSupportedContent = plasmaParser.supportedContent(entry.url(),entry.getMimeType());
plasmaParser.supportedContent(entry.url(),entry.responseHeader().mime());
/* ========================================================================= /* =========================================================================
* INDEX CONTROL HEADER * INDEX CONTROL HEADER
@ -823,14 +822,9 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
* yacy to index the response returned as answer to a request * yacy to index the response returned as answer to a request
* ========================================================================= */ * ========================================================================= */
boolean doIndexing = true; boolean doIndexing = true;
if (entry.requestHeader() != null) { if (entry.requestProhibitsIndexing()) {
if (
(entry.requestHeader().containsKey(httpHeader.X_YACY_INDEX_CONTROL)) &&
(((String) entry.requestHeader().get(httpHeader.X_YACY_INDEX_CONTROL)).toUpperCase().equals("NO-INDEX"))
) {
doIndexing = false; doIndexing = false;
} }
}
/* ========================================================================= /* =========================================================================
* LOCAL IP ADDRESS CHECK * LOCAL IP ADDRESS CHECK
@ -896,8 +890,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
enQueue(this.sbQueue.newEntry( enQueue(this.sbQueue.newEntry(
entry.url(), entry.url(),
indexURL.urlHash(entry.referrerURL()), indexURL.urlHash(entry.referrerURL()),
entry.requestHeader().ifModifiedSince(), entry.ifModifiedSince(),
entry.requestHeader().containsKey(httpHeader.COOKIE), entry.requestWithCookie(),
entry.initiator(), entry.initiator(),
entry.depth(), entry.depth(),
entry.profile().handle(), entry.profile().handle(),

Loading…
Cancel
Save