Shouldn't there be something similar in Qpsmtpd::PollServer? (Or maybe put it in Qpsmtpd::SMTP to avoid the duplication).

I'm not very versed on async but after staring at the code for the drive into work, I *think* this is what is needed for PollServer:

--- a/lib/Qpsmtpd/PollServer.pm
+++ b/lib/Qpsmtpd/PollServer.pm
@@ -164,6 +164,10 @@ sub disconnect {

 sub close {
     my Qpsmtpd::PollServer $self = shift;
+    unless ($self->connection->notes('disconnected')) {
+        $self->reset_transaction;
+        $self->run_hooks('disconnect');
+    }
     $self->run_hooks_no_respond("post-connection");
     $self->connection->reset;
     $self->SUPER::close;

But looking a bit further, it looks like maybe all that is really needed is to modify Qpsmtpd::SMTP::disconnect() and call $self->SUPER::disconnect(@_) from here as well as from Qpsmtpd::TcpServer and Qpsmtpd::TcpServer::Prefork. I'll test this when I have the chance and follow-up.

-Jared

Reply via email to