yacyNews bugfix

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@457 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 20 years ago
parent f65dd694a1
commit 84b74d40f3

@ -53,8 +53,10 @@ public class yacyNewsAction implements yacyPeerAction {
public void processPeerArrival(yacySeed peer, boolean direct) {
String recordString = peer.get("news", null);
System.out.println("### triggered news arrival from peer " + peer.getName() + ", news " + ((recordString == null) ? "empty" : "attached"));
if (recordString == null) return;
yacyNewsRecord record = new yacyNewsRecord(de.anomic.tools.crypt.simpleDecode(recordString, ""));
System.out.println("### news arrival from peer " + peer.getName() + ", news=" + record.toString());
try {
this.pool.enqueueGlobalNews(record);
} catch (IOException e) {e.printStackTrace();}

@ -112,8 +112,10 @@ public class yacyNewsQueue {
public synchronized yacyNewsRecord topInc() throws IOException {
if (queueStack.size() == 0) return null;
yacyNewsRecord entry = pop(0);
entry.incDistribution();
push(entry);
if (entry != null) {
entry.incDistribution();
push(entry);
}
return entry;
}

Loading…
Cancel
Save