- no more table copy for error-eco table
- optional table copy for lurl-entries
- more abstractions (less single constant strings)
- better logging (using host names instead of ips)
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4459 6c8d7289-2bf4-0310-a012-ef5d649a1542
booleanauth=((String)header.get("CLIENTIP","")).equals("localhost")||sb.verifyAuthentication(header,true);// handle access rights
booleanauth=((String)header.get(httpHeader.CONNECTION_PROP_CLIENTIP,"")).equals("localhost")||sb.verifyAuthentication(header,true);// handle access rights
// reject unknown peers: this does not appear fair, but anonymous senders are dangerous
sb.getLog().logFine("RankingTransmission: rejected unknown peer '"+ohash+"', current IP "+header.get("CLIENTIP","unknown"));
sb.getLog().logFine("RankingTransmission: rejected unknown peer '"+ohash+"', current IP "+header.get(httpHeader.CONNECTION_PROP_CLIENTIP,"unknown"));
returnprop;
}
opeer.setLastSeenUTC();
if(filename.indexOf("..")>=0){
// reject paths that contain '..' because they are dangerous
sb.getLog().logFine("RankingTransmission: rejected wrong path '"+filename+"' from peer "+opeer.getName()+"/"+opeer.getPublicAddress()+", current IP "+header.get("CLIENTIP","unknown"));
sb.getLog().logFine("RankingTransmission: rejected wrong path '"+filename+"' from peer "+opeer.getName()+"/"+opeer.getPublicAddress()+", current IP "+header.get(httpHeader.CONNECTION_PROP_CLIENTIP,"unknown"));
@ -88,6 +88,8 @@ public final class indexRWIRowEntry implements indexRWIEntry {
privatestaticfinalintcol_worddistance=18;// i 1 initial zero; may be used as reserve: is filled during search
privatestaticfinalintcol_reserve=19;// k 1 reserve
publicdoubletermFrequency;
privatekelondroRow.Entryentry;
publicindexRWIRowEntry(StringurlHash,
@ -101,14 +103,14 @@ public final class indexRWIRowEntry implements indexRWIEntry {
intposinphrase,// position of word in its phrase
intposofphrase,// number of the phrase where word appears
intworddistance,// word distance; this is 0 by default, and set to the difference of posintext from two indexes if these are combined (simultanous search). If stored, this shows that the result was obtained by remote search
intsizeOfPage,// # of bytes of the page TODO: not needed any more
longlastmodified,// last-modified time of the document where word appears
longupdatetime,// update time; this is needed to compute a TTL for the word, so it can be removed easily if the TTL is short
Stringlanguage,// (guessed) language of document
chardoctype,// type of document
intoutlinksSame,// outlinks to same domain
intoutlinksOther,// outlinks to other domain
kelondroBitfieldflags// attributes to the url and to the word according the url
kelondroBitfieldflags,// attributes to the url and to the word according the url
privateTreeMap<Object,indexRWIRowEntry>sortedRWIEntries;// key = ranking (Long); value = indexRWIEntry; if sortorder < 2 then key is instance of String
privateHashMap<String,TreeMap<Object,indexRWIRowEntry>>doubleDomCache;// key = domhash (6 bytes); value = TreeMap like sortedRWIEntries
privateTreeMap<Object,indexRWIVarEntry>sortedRWIEntries;// key = ranking (Long); value = indexRWIEntry; if sortorder < 2 then key is instance of String
privateHashMap<String,TreeMap<Object,indexRWIVarEntry>>doubleDomCache;// key = domhash (6 bytes); value = TreeMap like sortedRWIEntries
privateHashMap<String,String>handover;// key = urlhash, value = urlstring; used for double-check of urls that had been handed over to search process
privateplasmaSearchQueryquery;
privateintsortorder;
@ -72,8 +74,8 @@ public final class plasmaSearchRankingProcess {
// attention: if minEntries is too high, this method will not terminate within the maxTime
@ -2573,10 +2573,10 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
if(authorization.length()>256)return0;
// authorization by encoded password, only for localhost access
if((((String)header.get("CLIENTIP","")).equals("localhost"))&&(adminAccountBase64MD5.equals(authorization)))return3;// soft-authenticated for localhost
if((((String)header.get(httpHeader.CONNECTION_PROP_CLIENTIP,"")).equals("localhost"))&&(adminAccountBase64MD5.equals(authorization)))return3;// soft-authenticated for localhost
// authorization by hit in userDB
if(userDB.hasAdminRight((String)header.get(httpHeader.AUTHORIZATION,"xxxxxx"),((String)header.get("CLIENTIP","")),header.getHeaderCookies()))return4;//return, because 4=max
if(userDB.hasAdminRight((String)header.get(httpHeader.AUTHORIZATION,"xxxxxx"),((String)header.get(httpHeader.CONNECTION_PROP_CLIENTIP,"")),header.getHeaderCookies()))return4;//return, because 4=max
// authorization with admin keyword in configuration