From d8d3719f34fa2dde9312d3156f7eccfe0fef0584 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sat, 24 Apr 2010 10:39:06 -0700 Subject: [PATCH] Tweak NAT timeout behavior * Change "broken pipe" behavior to simply run through the ping loop again, rather than be treated as a NAT timeout Bug: 2615293 Change-Id: I67c3200f148a8c2beda58f812c29af8a726a4b9c --- src/com/android/exchange/EasSyncService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java index ef89ff819..5e85bb307 100644 --- a/src/com/android/exchange/EasSyncService.java +++ b/src/com/android/exchange/EasSyncService.java @@ -1496,14 +1496,14 @@ public class EasSyncService extends AbstractSyncService { /** * Simplistic attempt to determine a NAT timeout, based on experience with various carriers - * and networks. The strings "reset by peer" and "broken pipe" are very common in these - * situations, so we look for them specifically (sans the b in broken, in case it's lowercase) + * and networks. The string "reset by peer" is very common in these situations, so we look for + * that specifically. We may add additional tests here as more is learned. * @param message * @return whether this message is likely associated with a NAT failure */ private boolean isLikelyNatFailure(String message) { if (message == null) return false; - if (message.contains("reset by peer") || message.contains("roken pipe")) { + if (message.contains("reset by peer")) { return true; } return false; @@ -1685,6 +1685,10 @@ public class EasSyncService extends AbstractSyncService { } else { userLog("NAT type IOException"); } + } else if (hasMessage && message.contains("roken pipe")) { + // The "broken pipe" error (uppercase or lowercase "b") seems to be an + // internal error, so let's not throw an exception (which leads to delays) + // but rather simply run through the loop again } else { throw e; }