mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-08 12:18:07 -05:00
do not send error to client after a socket exception (connection closed)
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@88 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
337c004247
commit
cc2760f5cf
@ -1,11 +1,12 @@
|
|||||||
package davmail.pop;
|
package davmail.pop;
|
||||||
|
|
||||||
import davmail.AbstractConnection;
|
import davmail.AbstractConnection;
|
||||||
import davmail.tray.DavGatewayTray;
|
|
||||||
import davmail.exchange.ExchangeSession;
|
import davmail.exchange.ExchangeSession;
|
||||||
|
import davmail.tray.DavGatewayTray;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
import java.net.SocketException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
@ -102,6 +103,9 @@ public class PopConnection extends AbstractConnection {
|
|||||||
messages = session.getAllMessages();
|
messages = session.getAllMessages();
|
||||||
sendOK("PASS");
|
sendOK("PASS");
|
||||||
state = AUTHENTICATED;
|
state = AUTHENTICATED;
|
||||||
|
} catch (SocketException e) {
|
||||||
|
// can not send error to client after a socket exception
|
||||||
|
DavGatewayTray.warn("Client closed connection ", e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
@ -139,6 +143,9 @@ public class PopConnection extends AbstractConnection {
|
|||||||
messages.get(messageNumber).write(os);
|
messages.get(messageNumber).write(os);
|
||||||
sendClient("");
|
sendClient("");
|
||||||
sendClient(".");
|
sendClient(".");
|
||||||
|
} catch (SocketException e) {
|
||||||
|
// can not send error to client after a socket exception
|
||||||
|
DavGatewayTray.warn("Client closed connection ", e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
DavGatewayTray.error("Error retreiving message", e);
|
DavGatewayTray.error("Error retreiving message", e);
|
||||||
sendERR("error retreiving message " + e + " " + e.getMessage());
|
sendERR("error retreiving message " + e + " " + e.getMessage());
|
||||||
@ -153,6 +160,9 @@ public class PopConnection extends AbstractConnection {
|
|||||||
nextToken()) - 1;
|
nextToken()) - 1;
|
||||||
messages.get(messageNumber).delete();
|
messages.get(messageNumber).delete();
|
||||||
sendOK("DELETE");
|
sendOK("DELETE");
|
||||||
|
} catch (SocketException e) {
|
||||||
|
// can not send error to client after a socket exception
|
||||||
|
DavGatewayTray.warn("Client closed connection ", e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
DavGatewayTray.error("Error deleting message", e);
|
DavGatewayTray.error("Error deleting message", e);
|
||||||
sendERR("error deleting message");
|
sendERR("error deleting message");
|
||||||
@ -172,6 +182,9 @@ public class PopConnection extends AbstractConnection {
|
|||||||
sendClient(".");
|
sendClient(".");
|
||||||
}
|
}
|
||||||
sendOK("TOP");
|
sendOK("TOP");
|
||||||
|
} catch (SocketException e) {
|
||||||
|
// can not send error to client after a socket exception
|
||||||
|
DavGatewayTray.warn("Client closed connection ", e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
sendERR("error retreiving top of messages");
|
sendERR("error retreiving top of messages");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user