Skip to content

Commit

Permalink
fixed crawler bug caused by NPE in logging
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7033 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Aug 12, 2010
1 parent a82a93f commit 0d81731
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions source/de/anomic/crawler/CrawlStacker.java
Expand Up @@ -28,6 +28,7 @@

package de.anomic.crawler;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;

Expand Down Expand Up @@ -361,9 +362,10 @@ public String urlInAcceptedDomain(final DigestURI url) {
// check if this is a local address and we are allowed to index local pages:
//boolean local = hostAddress.isSiteLocalAddress() || hostAddress.isLoopbackAddress();
//assert local == yacyURL.isLocalDomain(url.hash()); // TODO: remove the dnsResolve above!
InetAddress ia = Domains.dnsResolve(host);
return (local) ?
("the host '" + host + "' is local, but local addresses are not accepted: " + Domains.dnsResolve(host).getHostAddress()) :
("the host '" + host + "' is global, but global addresses are not accepted: " + Domains.dnsResolve(host).getHostAddress());
("the host '" + host + "' is local, but local addresses are not accepted: " + ((ia == null) ? "null" : ia.getHostAddress())) :
("the host '" + host + "' is global, but global addresses are not accepted: " + ((ia == null) ? "null" : ia.getHostAddress()));
}

public String urlInAcceptedDomainHash(final byte[] urlhash) {
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/crawler/ZURL.java
Expand Up @@ -132,7 +132,7 @@ public void push(
Entry entry = new Entry(bentry, executor, workdate, workcount, anycause);
put(entry);
stack.add(entry.hash());
Log.logInfo("URL Errors", bentry.url().toNormalform(false, false) + " - " + anycause);
Log.logInfo("Rejected URL", bentry.url().toNormalform(false, false) + " - " + anycause);
while (stack.size() > maxStackSize) stack.poll();
}

Expand Down

0 comments on commit 0d81731

Please sign in to comment.