natInetAddress.cc (lookup): Preserve caller-supplied hostname in returned InetAddress objects.
* java/net/natInetAddress.cc (lookup): Preserve caller-supplied hostname in returned InetAddress objects. (getLocalHostname): Fix typo. * java/net/InetAddress.java (getByName): Set hostname on return object. (getLocalHost): Call lookup directly to ensure that a fully-qualified name is returned. From-SVN: r27587
This commit is contained in:
parent
9ddab891df
commit
e0cb3930ca
3 changed files with 18 additions and 6 deletions
|
@ -177,7 +177,7 @@ public final class InetAddress
|
|||
byte[] address = aton(host);
|
||||
if (address != null)
|
||||
return new InetAddress(address, null);
|
||||
InetAddress iaddr = new InetAddress(null, null);
|
||||
InetAddress iaddr = new InetAddress(null, host);
|
||||
lookup(host, iaddr, false);
|
||||
return iaddr;
|
||||
}
|
||||
|
@ -243,7 +243,8 @@ public final class InetAddress
|
|||
{
|
||||
try
|
||||
{
|
||||
localhost = getByName(hostname);
|
||||
localhost = new InetAddress(null, null);
|
||||
lookup(hostname, localhost, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue