From: | "Rodger Duffett" <rodger [...] its.uct.ac.za> |
To: | <bug-Mail-IMAPClient [...] rt.cpan.org> |
Subject: | Infinite loop in migrate function |
Date: | Mon, 7 Apr 2003 16:51:35 +0200 |
Helo,
When migrating a mailbox btwn Imap servers both running Cyrus 2.0.16 the
migrate function enters an infinite loop for the first message exceeding the
buffer size IF a regular expression in the calling code was used to capture
a fragment. If the $1 is populated outside of the confines of a block or
exec statement it remains in scope until the next succesful pattern is
matched. Under the conditions of the migration this was the 'pattern' sub at
IMAPClient 2.2.7. $1 was thus not undef and the function returned the
existing value of $1. The condition 'until ($chunk =
$pattern->($fromBuffer) )' at 882 is then never met and the loop occurs.
I've solved it for my code by putting my first regex in a block but there is
probably a more robust fix.
Many thanks for a very useful module.
Cheerio
Rodger Duffett
University of Cape
PS I'm also having a problem with message_string and bytes returned not
matching bytes expected however I have not figured out exactly what
circumstance cause this. It appears to happen for random messages in a
mailbox. The messages seem to be copied OK although the process hangs until
the timeout value is reached.