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
pull/1/head
hermens 15 years ago
parent eb2a4bb555
commit ef467a0303

@ -416,8 +416,16 @@ public class URIMetadataRow implements URIMetadata {
}
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() {

Loading…
Cancel
Save