mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-11-23 06:07:01 +00:00
[HER-1662] use fully qualified hostname
* WriterPoolProcessor.java, ARCWriterProcessor.java, WARCWriterProcessor.java, InetAddressUtil.java
replace all InetAddress.getHostName() with InetAddress.getCanonicalHostName() (for consistency)
This commit is contained in:
1 parent
211cd7c659
commit
d253ff1ace
4 files changed
+4
-4
No files matched your search
@@ -209,7 +209,7 @@ public class ARCWriterProcessor extends WriterPoolProcessor {
|
||||
|
||||
private static String getHostName() {
|
||||
try {
|
||||
return InetAddress.getLocalHost().getHostName();
|
||||
return InetAddress.getLocalHost().getCanonicalHostName();
|
||||
} catch (UnknownHostException e) {
|
||||
logger.log(Level.SEVERE, "Could not get local host name.", e);
|
||||
return "localhost";
|
||||
|
||||
@@ -514,7 +514,7 @@ public class WARCWriterProcessor extends WriterPoolProcessor {
|
||||
try {
|
||||
InetAddress host = InetAddress.getLocalHost();
|
||||
record.addLabelValue("ip", host.getHostAddress());
|
||||
record.addLabelValue("hostname", host.getHostName());
|
||||
record.addLabelValue("hostname", host.getCanonicalHostName());
|
||||
} catch (UnknownHostException e) {
|
||||
logger.log(Level.WARNING,"unable top obtain local crawl engine host",e);
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ implements Lifecycle {
|
||||
sfx = sfx.trim();
|
||||
if (sfx.contains(WriterPoolMember.HOSTNAME_VARIABLE)) { String str = "localhost.localdomain";
|
||||
try {
|
||||
str = InetAddress.getLocalHost().getHostName();
|
||||
str = InetAddress.getLocalHost().getCanonicalHostName();
|
||||
} catch (UnknownHostException ue) {
|
||||
logger.severe("Failed getHostAddress for this host: " + ue);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user