bugfix: lookup of peernames no result for active peer in page IndexControlRWIs_p.html -> Transfer RWI to other Peer

SeedDB.lookupByName searche for lowercase peerNames, while MapColumnIndex.getIndex uses peername as is in the keyset.
Changed the index init to insert lowercase peer names as key
pull/1/head
reger 13 years ago
parent c6558cba08
commit 6696cb1313

@ -169,7 +169,8 @@
#{hosts}#
<option value="#[hosthash]#">#[hostname]#</option>
#{/hosts}#
</select> or enter a hash:<input type="text" name="host" value="" size="21" maxlength="21" />
</select> <br>
or enter a hash or peer name:<input type="text" name="host" value="" size="21" maxlength="21" />
</dd>
</dl>
</fieldset>

@ -306,8 +306,9 @@ public class IndexControlRWIs_p
Seed seed = null;
if ( host.length() != 0 ) {
if ( host.length() == 12 ) {
// the host string is a peer hash
seed = sb.peers.getConnected(host);
// the host string is !likely! a peer hash (or peer name with 12 chars)
seed = sb.peers.getConnected(host); // check for seed.hash
if (seed == null) seed = sb.peers.lookupByName(host); // check for peer name
} else {
// the host string can be a host name
seed = sb.peers.lookupByName(host);
@ -317,6 +318,7 @@ public class IndexControlRWIs_p
seed = sb.peers.getConnected(host);
}
if (seed != null) { // if no seed found skip transfer
// prepare index
ReferenceContainer<WordReference> index;
final long starttime = System.currentTimeMillis();
@ -332,13 +334,13 @@ public class IndexControlRWIs_p
index.size());
Reference iEntry;
URIMetadataRow lurl;
while ( urlIter.hasNext() ) {
while (urlIter.hasNext()) {
iEntry = urlIter.next();
lurl = segment.urlMetadata().load(iEntry.urlhash());
if ( lurl == null ) {
if (lurl == null) {
try {
unknownURLEntries.put(iEntry.urlhash());
} catch ( final RowSpaceExceededException e ) {
} catch (final RowSpaceExceededException e) {
Log.logException(e);
}
urlIter.remove();
@ -355,7 +357,7 @@ public class IndexControlRWIs_p
Word.commonHashLength);
try {
icc.add(index);
} catch ( final RowSpaceExceededException e ) {
} catch (final RowSpaceExceededException e) {
Log.logException(e);
}
@ -370,6 +372,9 @@ public class IndexControlRWIs_p
+ " seconds, "
+ unknownURLEntries.size() + " URL not found") : "error: " + error);
index = null;
} else {
prop.put("result", "Peer " + host + " not found");
}
} catch ( final IOException e ) {
Log.logException(e);
}

@ -74,7 +74,7 @@ public class MapColumnIndex {
line = table.next();
String value = line.getValue().get(whereKey);
if (value == null) continue; // we don't need to remember that
indexupdate(line.getKey(), valueIdxMap, value);
indexupdate(line.getKey(), valueIdxMap, value.toLowerCase()); // add the entry lowercase (needed for seedDB.lookupByName)
}
}

Loading…
Cancel
Save