mirror of
https://github.com/torproject/metrics-lib.git
synced 2024-11-26 18:50:28 +00:00
Properly parse hostname in v2 network status.
This commit is contained in:
parent
9c7e1b9a54
commit
ca37fd616c
@ -3,6 +3,8 @@
|
||||
* Minor changes
|
||||
- Fix a NullPointerException when parsing an invalid crypto block
|
||||
starting with "-----END " rather than "-----BEGIN ".
|
||||
- Properly parse an authority's hostname from the "dir-source" line
|
||||
in a v2 network status.
|
||||
|
||||
|
||||
# Changes in version 2.9.1 - 2019-11-09
|
||||
|
@ -181,6 +181,7 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
|
||||
throw new DescriptorParseException("Illegal hostname in '" + line
|
||||
+ "'.");
|
||||
}
|
||||
this.hostname = parts[1];
|
||||
this.address = ParseHelper.parseIpv4Address(line, parts[2]);
|
||||
this.dirPort = ParseHelper.parsePort(line, parts[3]);
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ public class RelayNetworkStatusImplTest {
|
||||
new int[] { 0, statusBytes.length }, null);
|
||||
assertEquals(rnsi.getContactLine(),
|
||||
"1024R/8D56913D Alex de Joode <adejoode@sabotage.org>");
|
||||
assertEquals("194.109.206.212", rnsi.getHostname());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user