LDAP: cancel search threads on connection close, not request end

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1679 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-05-11 12:14:05 +00:00
parent a830470398
commit 064708cff0
1 changed files with 6 additions and 7 deletions

View File

@ -485,6 +485,12 @@ public class LdapConnection extends AbstractConnection {
DavGatewayTray.warn(new BundleMessage("LOG_EXCEPTION_SENDING_ERROR_TO_CLIENT"), e2);
}
} finally {
// cancel all search threads
synchronized (searchThreadMap) {
for (SearchRunnable searchRunnable:searchThreadMap.values()) {
searchRunnable.abandon();
}
}
close();
}
DavGatewayTray.resetIcon();
@ -583,13 +589,6 @@ public class LdapConnection extends AbstractConnection {
DavGatewayTray.debug(new BundleMessage("LOG_EXCEPTION_SENDING_ERROR_TO_CLIENT"), e2);
}
throw e;
} finally {
// cancel all search threads
synchronized (searchThreadMap) {
for (SearchRunnable searchRunnable:searchThreadMap.values()) {
searchRunnable.abandon();
}
}
}
}