small change

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4448 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 17 years ago
parent 85a82950e0
commit 5ac71729d8

@ -81,22 +81,26 @@ public final class transfer {
prop.put("process_path", ""); prop.put("process_path", "");
prop.put("process_maxsize", "0"); prop.put("process_maxsize", "0");
final yacySeed otherseed = yacyCore.seedDB.get(otherpeer); if (sb.isRobinsonMode() || !sb.rankingOn) {
if (otherseed == null || sb.isRobinsonMode() || !sb.rankingOn) {
// in a robinson environment, do not answer. We do not do any transfer in a robinson cluster. // in a robinson environment, do not answer. We do not do any transfer in a robinson cluster.
return prop; return prop;
} }
otherseed.setLastSeenUTC();
if (filename.indexOf("..") >= 0) { final yacySeed otherPeer = yacyCore.seedDB.get(otherpeer);
if (otherPeer == null) {
// reject unknown peers: this does not appear fair, but anonymous senders are dangerous // reject unknown peers: this does not appear fair, but anonymous senders are dangerous
sb.getLog().logFine("RankingTransmission: rejected unknown peer '" + otherpeer + "', current IP " + header.get("CLIENTIP", "unknown"));
return prop;
}
otherPeer.setLastSeenUTC();
if (filename.indexOf("..") >= 0) {
// reject paths that contain '..' because they are dangerous // reject paths that contain '..' because they are dangerous
if (otherseed == null) sb.getLog().logFine("RankingTransmission: rejected unknown peer '" + otherpeer + "', current IP " + header.get("CLIENTIP", "unknown")); sb.getLog().logFine("RankingTransmission: rejected wrong path '" + filename + "' from peer " + otherPeer.getName() + "/" + otherPeer.getPublicAddress()+ ", current IP " + header.get("CLIENTIP", "unknown"));
if (filename.indexOf("..") >= 0) sb.getLog().logFine("RankingTransmission: rejected wrong path '" + filename + "' from peer " + otherseed.getName() + "/" + otherseed.getPublicAddress()+ ", current IP " + header.get("CLIENTIP", "unknown"));
return prop; return prop;
} }
String otherpeerName = otherseed.hash + ":" + otherseed.getName(); String otherpeerName = otherPeer.hash + ":" + otherPeer.getName();
if (process.equals("permission")) { if (process.equals("permission")) {
prop.put("process", "0"); prop.put("process", "0");

Loading…
Cancel
Save