mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 11:12:22 -05:00
LDAP: cache current hostname value in sendComputerContext to improve iCal address completion performance
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1465 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
df4a6505c1
commit
007ae0b94f
@ -669,15 +669,20 @@ public class LdapConnection extends AbstractConnection {
|
||||
}
|
||||
}
|
||||
|
||||
protected String currentHostName;
|
||||
|
||||
protected String getCurrentHostName() throws UnknownHostException {
|
||||
if (currentHostName == null) {
|
||||
if (client.getInetAddress().isLoopbackAddress()) {
|
||||
// local address, probably using localhost in iCal URL
|
||||
return "localhost";
|
||||
currentHostName = "localhost";
|
||||
} else {
|
||||
// remote address, send fully qualified domain name
|
||||
return InetAddress.getLocalHost().getCanonicalHostName();
|
||||
currentHostName = InetAddress.getLocalHost().getCanonicalHostName();
|
||||
}
|
||||
}
|
||||
return currentHostName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cache serviceInfo string value
|
||||
|
Loading…
Reference in New Issue
Block a user