Skip to content

Commit

Permalink
Another workaround for the second part of http://forum.yacy-websuche.…
Browse files Browse the repository at this point in the history
…de/viewtopic.php?f=5&t=2770

This should prevent URLs with bad referrer entries from being dropped by transferURL or even crashing the whole Transmission$Chunk


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6792 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
hermens committed Apr 10, 2010
1 parent eb2a4bb commit ef467a0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/net/yacy/kelondro/data/meta/URIMetadataRow.java
Expand Up @@ -416,8 +416,16 @@ public Date freshdate() {
}

public byte[] referrerHash() {
// return the creator's hash
return entry.getColBytes(col_referrer, true);
// return the creator's hash or null if there is none
// FIXME: There seem to be some malformed entries in the databasees like "null\0\0\0\0\0\0\0\0"
final byte[] r = entry.getColBytes(col_referrer, true);
if (r != null) {
int i = r.length;
while (i > 0) {
if (r[--i] == 0) return null;
}
}
return r;
}

public String md5() {
Expand Down

0 comments on commit ef467a0

Please sign in to comment.