develooper Front page | perl.cvs.qpsmtpd | Postings from March 2007

[svn:qpsmtpd] r730 - trunk/lib/Danga

From:
msergeant
Date:
March 28, 2007 14:33
Subject:
[svn:qpsmtpd] r730 - trunk/lib/Danga
Message ID:
20070328213313.7FC1CCBA2F@x12.develooper.com
Author: msergeant
Date: Wed Mar 28 14:33:10 2007
New Revision: 730

Modified:
   trunk/lib/Danga/Client.pm

Log:
This fixes a really nasty bug that means that some (mostly spam, admittedly) mail would get missed.
What happens is if you pause the connection (needed if you YIELD for something)
then the line-reading loop exits, and never gets back there unless the client
sends more data. If the client is an abuser (i.e. pipelines) then you might
never get back to the read loop.
(yes, this was a bitch to track down :-))


Modified: trunk/lib/Danga/Client.pm
==============================================================================
--- trunk/lib/Danga/Client.pm	(original)
+++ trunk/lib/Danga/Client.pm	Wed Mar 28 14:33:10 2007
@@ -152,7 +152,11 @@
     $self->{pause_count}--;
     if ($self->{pause_count} <= 0) {
         $self->{pause_count} = 0;
-        # $self->watch_read(1);
+        $self->AddTimer(0, sub {
+            if (length($self->{line}) && !$self->paused) {
+                $self->process_read_buf(\""); # " for bad syntax highlighters
+            }
+        });
     }
 }
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About