1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 19:22:22 -05:00

Improve error handling: detect SocketException to avoid client socket closed errors

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@927 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-01-24 20:41:02 +00:00
parent 009300142c
commit 46e7283fb2
2 changed files with 5 additions and 0 deletions

View File

@ -331,6 +331,8 @@ public class ImapConnection extends AbstractConnection {
ExchangeSession.Message message = rangeIterator.next(); ExchangeSession.Message message = rangeIterator.next();
try { try {
handleFetch(message, rangeIterator.currentIndex, parameters); handleFetch(message, rangeIterator.currentIndex, parameters);
} catch (SocketException e) {
DavGatewayTray.warn(new BundleMessage("LOG_CLIENT_CLOSED_CONNECTION"), e);
} catch (IOException e) { } catch (IOException e) {
DavGatewayTray.log(e); DavGatewayTray.log(e);
sendClient(commandId + " NO Unable to retrieve message: " + e.getMessage()); sendClient(commandId + " NO Unable to retrieve message: " + e.getMessage());

View File

@ -1272,6 +1272,9 @@ public class LdapConnection extends AbstractConnection {
DavGatewayTray.debug(new BundleMessage("LOG_LDAP_REQ_SEARCH_SUCCESS", currentMessageId)); DavGatewayTray.debug(new BundleMessage("LOG_LDAP_REQ_SEARCH_SUCCESS", currentMessageId));
sendClient(currentMessageId, LDAP_REP_RESULT, LDAP_SUCCESS, ""); sendClient(currentMessageId, LDAP_REP_RESULT, LDAP_SUCCESS, "");
} }
} catch (SocketException e) {
// client closed connection
DavGatewayTray.debug(new BundleMessage("LOG_CLIENT_CLOSED_CONNECTION"));
} catch (IOException e) { } catch (IOException e) {
DavGatewayTray.log(e); DavGatewayTray.log(e);
try { try {