Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Network Health
Metrics
Onionoo
Commits
e01e8ba9
Commit
e01e8ba9
authored
Nov 20, 2018
by
Karsten Loesing
Browse files
Accept empty AS names.
Partially takes back
b45c630b
.
parent
2e278f68
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/torproject/metrics/onionoo/updater/LookupService.java
View file @
e01e8ba9
...
...
@@ -250,11 +250,6 @@ public class LookupService {
}
String
asNumber
=
"AS"
+
String
.
valueOf
(
Integer
.
parseInt
(
parts
[
1
]));
String
asName
=
parts
[
2
];
if
(
asName
.
isEmpty
())
{
log
.
error
(
"Illegal AS name in '{}' in {}."
,
line
,
this
.
geoLite2AsnBlocksIpv4CsvFile
.
getAbsolutePath
());
return
lookupResults
;
}
while
(
firstAddressNumber
<
startIpNum
&&
firstAddressNumber
!=
-
1L
)
{
sortedAddressNumbers
.
remove
(
firstAddressNumber
);
...
...
src/test/java/org/torproject/metrics/onionoo/updater/LookupServiceTest.java
View file @
e01e8ba9
...
...
@@ -440,13 +440,14 @@ public class LookupServiceTest {
}
@Test
()
public
void
testLookupGeoLite2AsnBlocksIpv4
TooFewFieldsNo
AsName
()
{
public
void
testLookupGeoLite2AsnBlocksIpv4AsName
Empty
()
{
List
<
String
>
geoLite2AsnBlocksIpv4Lines
=
new
ArrayList
<>();
geoLite2AsnBlocksIpv4Lines
.
add
(
"network,autonomous_system_number,"
+
"autonomous_system_organization"
);
geoLite2AsnBlocksIpv4Lines
.
add
(
"8.8.8.0/24,15169,"
);
this
.
assertLookupResult
(
null
,
null
,
geoLite2AsnBlocksIpv4Lines
,
"8.8.8.8"
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
);
"us"
,
"United States"
,
"California"
,
"Mountain View"
,
37.3860f
,
-
122.0838f
,
"AS15169"
,
""
);
}
@Test
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment