[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [imapsync] patch for 1.267: must log errors when disconnected
|
From |
Gilles LAMIRAL <gilles dot lamiral at laposte dot net> |
|
Subject |
Re: [imapsync] patch for 1.267: must log errors when disconnected |
|
Date |
Sat, 14 Feb 2009 17:42:21 +0100 |
Hello Phil,
Both patches applied:
- the "FOLDER loop is exited any time a connection is lost be sure to log it!"
- the "*->logout unless we're connected"
Thanks.
Phil Lobbes wrote:
>
> To be more correct, we probably should not call *->logout unless we're connected:
>
> Change this:
> $from->logout();
> $to->logout();
>
> To this:
> $from->logout() unless $from->isUnconnected();
> $to->logout() unless $to->isUnconnected();
>
> Phil
>
> ----- Original Message -----
> From: "Phil Lobbes" <plobbes at zimbra dot com>
> To: imapsync at linux-france dot org
> Sent: Saturday, January 31, 2009 4:11:41 PM GMT -05:00 US/Canada Eastern
> Subject: [imapsync] patch for 1.267: must log errors when disconnected
>
> 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();
--
Au revoir, 02 99 64 31 77
Gilles Lamiral. France, Chavagne (35310) 06 20 79 76 06