LDAP: fix for iCal4 attendee completion, send localhost if current socket is local, else send fully qualified domain name

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@772 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-10-07 22:08:05 +00:00
parent f5bafdbc6a
commit baa5dcb814
1 changed files with 7 additions and 2 deletions

View File

@ -861,8 +861,13 @@ public class LdapConnection extends AbstractConnection {
}
protected String hostName() throws UnknownHostException {
// TODO: send multiple computer context with getHostName and getCanonicalHostName
return InetAddress.getLocalHost().getCanonicalHostName();
if (client.getInetAddress().isLoopbackAddress()) {
// local address, probably using localhost in iCal URL
return "localhost";
} else {
// remote address, send fully qualified domain name
return InetAddress.getLocalHost().getCanonicalHostName();
}
}
/**