From 84b74d40f3d82273278c4007a3f4c45641a7f51f Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 29 Jul 2005 15:29:06 +0000 Subject: [PATCH] yacyNews bugfix git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@457 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/yacy/yacyNewsAction.java | 2 ++ source/de/anomic/yacy/yacyNewsQueue.java | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/yacy/yacyNewsAction.java b/source/de/anomic/yacy/yacyNewsAction.java index 4b1817a91..eba34c41b 100644 --- a/source/de/anomic/yacy/yacyNewsAction.java +++ b/source/de/anomic/yacy/yacyNewsAction.java @@ -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();} diff --git a/source/de/anomic/yacy/yacyNewsQueue.java b/source/de/anomic/yacy/yacyNewsQueue.java index 4c39a3440..29ad0100e 100644 --- a/source/de/anomic/yacy/yacyNewsQueue.java +++ b/source/de/anomic/yacy/yacyNewsQueue.java @@ -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; }