I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 8e2df567 authored by zzz's avatar zzz
Browse files

Pluck of revision 546257906e9b26c3a35e38967ebcaa54098d969f from branch i2p.i2p.zzz.test

---------------------------------------------------------------------------------------
    * ReseedHandler:
      - check for upper case HREF to be compatible with apache indexes
parent 4622f369
No related branches found
No related tags found
No related merge requests found
...@@ -137,11 +137,16 @@ public class ReseedHandler { ...@@ -137,11 +137,16 @@ public class ReseedHandler {
* Fetch a directory listing and then up to 200 routerInfo files in the listing. * Fetch a directory listing and then up to 200 routerInfo files in the listing.
* The listing must contain (exactly) strings that match: * The listing must contain (exactly) strings that match:
* href="routerInfo-{hash}.dat"> * href="routerInfo-{hash}.dat">
* OR
* HREF="routerInfo-{hash}.dat">
* and then it fetches the files * and then it fetches the files
* {seedURL}routerInfo-{hash}.dat * {seedURL}routerInfo-{hash}.dat
* after appending a '/' to seedURL if it doesn't have one. * after appending a '/' to seedURL if it doesn't have one.
* Essentially this means that the seedURL must be a directory, it * Essentially this means that the seedURL must be a directory, it
* can't end with 'index.html', for example. * can't end with 'index.html', for example.
*
* Jetty directory listings are not compatible, as they look like
* HREF="/full/path/to/routerInfo-...
**/ **/
private void reseedOne(String seedURL, boolean echoStatus) { private void reseedOne(String seedURL, boolean echoStatus) {
...@@ -165,8 +170,11 @@ public class ReseedHandler { ...@@ -165,8 +170,11 @@ public class ReseedHandler {
int total = 0; int total = 0;
while (total++ < 1000) { while (total++ < 1000) {
int start = content.indexOf("href=\"routerInfo-", cur); int start = content.indexOf("href=\"routerInfo-", cur);
if (start < 0) if (start < 0) {
break; start = content.indexOf("HREF=\"routerInfo-", cur);
if (start < 0)
break;
}
int end = content.indexOf(".dat\">", start); int end = content.indexOf(".dat\">", start);
String name = content.substring(start+"href=\"routerInfo-".length(), end); String name = content.substring(start+"href=\"routerInfo-".length(), end);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment