diff --git a/app/src/main/java/com/sun/mail/iap/ResponseInputStream.java b/app/src/main/java/com/sun/mail/iap/ResponseInputStream.java index dc6f65078b..45370d2277 100644 --- a/app/src/main/java/com/sun/mail/iap/ResponseInputStream.java +++ b/app/src/main/java/com/sun/mail/iap/ResponseInputStream.java @@ -20,6 +20,8 @@ import java.io.*; import com.sun.mail.iap.ByteArray; import com.sun.mail.util.ASCIIUtility; +import eu.faircode.email.TrafficStatsHelper; + /** * * Inputstream that is used to read a Response. @@ -90,8 +92,10 @@ public class ResponseInputStream { } catch (InterruptedException ex) { eu.faircode.email.Log.w(ex); } - } else + } else if (wait > 1) { + TrafficStatsHelper.debug("Data after=" + wait); wait = 1; + } if (b == '\n') { if ((idx > 0) && buffer[idx-1] == '\r') gotCRLF = true; @@ -158,8 +162,10 @@ public class ResponseInputStream { } catch (InterruptedException ex) { eu.faircode.email.Log.w(ex); } - } else + } else if (wait > 1) { + TrafficStatsHelper.debug("Data after=" + wait); wait = 1; + } count -= actual; idx += actual; } diff --git a/app/src/main/java/eu/faircode/email/TrafficStatsHelper.java b/app/src/main/java/eu/faircode/email/TrafficStatsHelper.java index dcfb935536..e0bbd052ae 100644 --- a/app/src/main/java/eu/faircode/email/TrafficStatsHelper.java +++ b/app/src/main/java/eu/faircode/email/TrafficStatsHelper.java @@ -43,4 +43,11 @@ public class TrafficStatsHelper { else EntityLog.log(ctx, EntityLog.Type.Statistics, msg); } + + public static void debug(String msg) { + if (ctx == null) + Log.e(msg); + else + EntityLog.log(ctx, EntityLog.Type.General, msg); + } }