Author: sparky
Date: Sun Oct 11 15:51:36 2009
New Revision: 10753

Modified:
   toys/rsget.pl/RSGet/Captcha.pm
Log:
- always delete captcha if not needed


Modified: toys/rsget.pl/RSGet/Captcha.pm
==============================================================================
--- toys/rsget.pl/RSGet/Captcha.pm      (original)
+++ toys/rsget.pl/RSGet/Captcha.pm      Sun Oct 11 15:51:36 2009
@@ -62,20 +62,20 @@
        foreach my $id ( keys %waiting ) {
                my $obj = $waiting{ $id };
                my $left = $obj->{captcha_until} - $time;
+               my $md5 = $obj->{captcha_md5};
                if ( $left <= 0 ) {
-                       delete $waiting{ $id };
-                       delete $needed{ $obj->{captcha_md5} };
                        $obj->print( "captcha not solved" );
                        unsolved( $obj );
                } elsif ( $obj->{_abort} ) {
-                       delete $waiting{ $id };
                        $obj->abort();
-               } elsif ( my $s = $solved{ $obj->{captcha_md5} } ) {
-                       delete $waiting{ $id };
+               } elsif ( my $s = $solved{ $md5 } ) {
                        solved( $obj, $s );
                } else {
                        $obj->print( "solve captcha " . s2string( $left ) );
+                       next;
                }
+               delete $waiting{ $id };
+               delete $needed{ $md5 };
        }
        RSGet::Line::status( 'captcha' => scalar keys %waiting );
 }
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to