From df71308664a96a014a948e543ad247efdaacb94c Mon Sep 17 00:00:00 2001 From: zzz Date: Tue, 13 May 2014 21:36:06 +0000 Subject: [PATCH] Susimail: Don't let an exception on one mail break others --- apps/susimail/src/src/i2p/susi/webmail/Mail.java | 2 ++ .../src/i2p/susi/webmail/PersistentMailCache.java | 3 +++ .../src/src/i2p/susi/webmail/pop3/POP3MailBox.java | 12 +++++++++--- history.txt | 5 ++++- router/java/src/net/i2p/router/RouterVersion.java | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/apps/susimail/src/src/i2p/susi/webmail/Mail.java b/apps/susimail/src/src/i2p/susi/webmail/Mail.java index b586a4a771..b645156e0e 100644 --- a/apps/susimail/src/src/i2p/susi/webmail/Mail.java +++ b/apps/susimail/src/src/i2p/susi/webmail/Mail.java @@ -118,6 +118,8 @@ class Mail { part = new MailPart(rb); } catch (DecodingException de) { Debug.debug(Debug.ERROR, "Decode error: " + de); + } catch (Exception e) { + Debug.debug(Debug.ERROR, "Parse error: " + e); } } diff --git a/apps/susimail/src/src/i2p/susi/webmail/PersistentMailCache.java b/apps/susimail/src/src/i2p/susi/webmail/PersistentMailCache.java index fe858fb100..d5aa9bebca 100644 --- a/apps/susimail/src/src/i2p/susi/webmail/PersistentMailCache.java +++ b/apps/susimail/src/src/i2p/susi/webmail/PersistentMailCache.java @@ -282,6 +282,9 @@ class PersistentMailCache { } catch (IOException ioe) { Debug.debug(Debug.ERROR, "Error reading: " + f + ": " + ioe); return null; + } catch (OutOfMemoryError oom) { + Debug.debug(Debug.ERROR, "Error reading: " + f + ": " + oom); + return null; } finally { if (in != null) try { in.close(); } catch (IOException ioe) {} diff --git a/apps/susimail/src/src/i2p/susi/webmail/pop3/POP3MailBox.java b/apps/susimail/src/src/i2p/susi/webmail/pop3/POP3MailBox.java index 1b750993e1..630051b6ab 100644 --- a/apps/susimail/src/src/i2p/susi/webmail/pop3/POP3MailBox.java +++ b/apps/susimail/src/src/i2p/susi/webmail/pop3/POP3MailBox.java @@ -237,9 +237,15 @@ public class POP3MailBox implements NewMailListener { Integer idObj = Integer.valueOf(id); ReadBuffer body = null; if (id >= 1 && id <= mails) { - body = sendCmdN( "RETR " + id ); - if (body == null) - Debug.debug( Debug.DEBUG, "RETR returned null" ); + try { + body = sendCmdN( "RETR " + id ); + if (body == null) + Debug.debug( Debug.DEBUG, "RETR returned null" ); + } catch (OutOfMemoryError oom) { + Debug.debug( Debug.ERROR, "OOM fetching mail" ); + lastError = oom.toString(); + close(); + } } else { lastError = "Message id out of range."; diff --git a/history.txt b/history.txt index f9278ae827..d097e52a4e 100644 --- a/history.txt +++ b/history.txt @@ -1,6 +1,9 @@ 2014-05-13 zzz * BOB, SAM, i2psnark: Fix datagram NPE (ticket #1275) - * SusiMail: Fix AIOOBE (ticket #1269) + * i2psnark: Escaping fixes on details page + * SusiMail: + - Fix AIOOBE (ticket #1269) + - Don't let an exception on one mail break others 2014-05-10 zzz * NTCP: Fix NPE (ticket #996) diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 14408f1ed4..987fc2f753 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 18; + public final static long BUILD = 19; /** for example "-test" */ public final static String EXTRA = "-rc";