[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[imapsync] patch for 1.267: must log errors when disconnected


From Phil Lobbes <plobbes at zimbra dot com>
Subject [imapsync] patch for 1.267: must log errors when disconnected
Date Sat, 31 Jan 2009 13:11:41 -0800 (PST)

Here's a patch for this bug that I reported a long time ago.  This is short and simple enough that hopefully it will get included.

This patch addresses numerous cases where imapsync might not report an error even if all folder were NOT successfully sync'd because of a dropped network connection.

Phil
-- 
Phil Lobbes
Zimbra, a Yahoo! company

--- imapsync.ORIG	2009-01-31 16:03:52.066125000 -0500
+++ imapsync	2009-01-31 16:04:42.159875000 -0500
@@ -1625,7 +1625,19 @@
 print "Time : ", timenext(), " s\n";
 }
 
-
+# FOLDER loop is exited any time a connection is lost be sure to log it!
+if ( $from->IsUnconnected() or $to->IsUnconnected() ) {
+	my @err;
+	if ( $from->IsUnconnected() ) {
+		$error++;
+		push( @err, "(from) host1[$host1]" );
+	}
+	if ( $to->IsUnconnected() ) {
+		$error++;
+		push( @err, "(to) host2[$host2]" );
+	}
+	warn("error: lost connection(s): @err\n");
+}
 
 $from->logout();
 $to->logout();