mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 11:12:22 -05:00
Serialize session creation in workstation mode to avoid multiple OTP requests
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1664 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
184ba21cf0
commit
31214b1be2
@ -84,9 +84,20 @@ public final class ExchangeSessionFactory {
|
|||||||
* @throws IOException on error
|
* @throws IOException on error
|
||||||
*/
|
*/
|
||||||
public static ExchangeSession getInstance(String userName, String password) throws IOException {
|
public static ExchangeSession getInstance(String userName, String password) throws IOException {
|
||||||
|
String baseUrl = Settings.getProperty("davmail.url");
|
||||||
|
if (Settings.getBooleanProperty("davmail.server")) {
|
||||||
|
return getInstance(baseUrl, userName, password);
|
||||||
|
} else {
|
||||||
|
// serialize session creation in workstation mode to avoid multiple OTP requests
|
||||||
|
synchronized (LOCK) {
|
||||||
|
return getInstance(baseUrl, userName, password);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ExchangeSession getInstance(String baseUrl, String userName, String password) throws IOException {
|
||||||
ExchangeSession session = null;
|
ExchangeSession session = null;
|
||||||
try {
|
try {
|
||||||
String baseUrl = Settings.getProperty("davmail.url");
|
|
||||||
|
|
||||||
// prepend default windows domain prefix
|
// prepend default windows domain prefix
|
||||||
String defaultDomain = Settings.getProperty("davmail.defaultDomain");
|
String defaultDomain = Settings.getProperty("davmail.defaultDomain");
|
||||||
|
Loading…
Reference in New Issue
Block a user