Subject: | bug in handling "Resource temporarily unavailable" |
Distribution: Mail-IMAPClient-2.1.3
Perl version: v5.6.1 built for i386-linux
OS: Linux 2.4.18-6mdksmp
I got stumped on this error:
# --- BEGIN error
Use of uninitialized value in numeric gt (>) at
/usr/lib/perl5/site_perl/5.6.1/Mail/IMAPClient.pm line 877.
Persistent 'Resource temporarily unavailable' errors
Couldn't append the message. at ./testimapattach.pl line 512.
Sending: 3 LOGOUT
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.6.1/Mail/IMAPClient.pm line 877.
Persistent 'Resource temporarily unavailable' errors
Error sending '3 LOGOUT' to IMAP: Resource temporarily unavailable at
./testimapattach.pl line 514
# --- END error
Then I saw a bug in line 877:
877: if ( $temperrs++ > $self->{MaxTempErrors}||10 ) {
The '>' takes precedence before '||' that's why the content of the
if-block is ignored if $self->{MaxTempErrors} is undefined.
Another bug is the case of "MaxTempErrors". According to line 183-185
of new constructor this should be "Maxtemperrors".
183: while (scalar(@_)) {
184: $self->{ucfirst(lc($_[0]))} = $_[1]; shift, shift;
185: }
I have attached a patched. :-)
*** IMAPClient.pm.orig Fri May 11 01:50:12 2001
--- IMAPClient.pm Mon Jun 24 18:13:38 2002
***************
*** 874,880 ****
$total
);
if ($! =~ /Resource temporarily unavailable/i ) {
! if ( $temperrs++ > $self->{MaxTempErrors}||10 ) {
$self->LastError("Persistent '${!}' errors\n");
$self->_debug("Persistent '${!}' errors\n");
return undef;
--- 874,880 ----
$total
);
if ($! =~ /Resource temporarily unavailable/i ) {
! if ( $temperrs++ > ($self->{Maxtemperrors}||10) ) {
$self->LastError("Persistent '${!}' errors\n");
$self->_debug("Persistent '${!}' errors\n");
return undef;