mirror of
https://github.com/torproject/collector.git
synced 2024-12-02 15:16:23 +00:00
Don't fail if extra-info descriptors are missing.
This commit is contained in:
parent
1732539892
commit
77bfec0122
@ -10,9 +10,15 @@ public class ExtraInfoDownloader {
|
||||
+ authority + "... ");
|
||||
Stack<String> extraInfos = new Stack<String>();
|
||||
for (String fingerprint : directories.keySet()) {
|
||||
BufferedInputStream in = new BufferedInputStream(new URL(
|
||||
"http://" + authority + "/tor/extra/fp/" + fingerprint).
|
||||
openStream());
|
||||
URL u = new URL("http://" + authority + "/tor/extra/fp/"
|
||||
+ fingerprint);
|
||||
HttpURLConnection huc = (HttpURLConnection) u.openConnection();
|
||||
huc.setRequestMethod("GET");
|
||||
huc.connect();
|
||||
int response = huc.getResponseCode();
|
||||
if (response == 200) {
|
||||
BufferedInputStream in = new BufferedInputStream(
|
||||
huc.getInputStream());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int len;
|
||||
byte[] data = new byte[1024];
|
||||
@ -22,10 +28,12 @@ public class ExtraInfoDownloader {
|
||||
in.close();
|
||||
String extraInfo = sb.toString();
|
||||
if (extraInfo.length() > 0) {
|
||||
BufferedReader br = new BufferedReader(new StringReader(extraInfo));
|
||||
BufferedReader br = new BufferedReader(
|
||||
new StringReader(extraInfo));
|
||||
rdp.parse(br);
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("done");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user