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) { public void processPeerArrival(yacySeed peer, boolean direct) {
String recordString = peer.get("news", null); 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; if (recordString == null) return;
yacyNewsRecord record = new yacyNewsRecord(de.anomic.tools.crypt.simpleDecode(recordString, "")); yacyNewsRecord record = new yacyNewsRecord(de.anomic.tools.crypt.simpleDecode(recordString, ""));
System.out.println("### news arrival from peer " + peer.getName() + ", news=" + record.toString());
try { try {
this.pool.enqueueGlobalNews(record); this.pool.enqueueGlobalNews(record);
} catch (IOException e) {e.printStackTrace();} } catch (IOException e) {e.printStackTrace();}

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

Loading…
Cancel
Save