/[smeserver]/rpms/qpsmtpd/sme10/0029-Run-hook_reset_transaction-after-all-connections.patch
ViewVC logotype

Annotation of /rpms/qpsmtpd/sme10/0029-Run-hook_reset_transaction-after-all-connections.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sun Feb 7 20:49:54 2016 UTC (8 years, 9 months ago) by stephdl
Branch: MAIN
CVS Tags: qpsmtpd-0_96-19_el7_sme, qpsmtpd-0_96-12_el7_sme, qpsmtpd-0_96-11_el7_sme, qpsmtpd-0_96-16_el7_sme, qpsmtpd-0_96-13_el7_sme, qpsmtpd-0_96-6_el7_sme, qpsmtpd-0_96-18_el7_sme, qpsmtpd-0_96-23_el7_sme, qpsmtpd-0_96-20_el7_sme, qpsmtpd-0_84-20_el7_sme, qpsmtpd-0_96-17_el7_sme, qpsmtpd-0_96-8_el7_sme, qpsmtpd-0_96-5_el7_sme, qpsmtpd-0_96-2_el7_sme, qpsmtpd-0_96-21_el7_sme, qpsmtpd-0_96-22_el7_sme, qpsmtpd-0_96-14_el7_sme, qpsmtpd-0_96-15_el7_sme, qpsmtpd-0_96-9_el7_sme, qpsmtpd-0_96-4_el7_sme, qpsmtpd-0_96-1_el7_sme, qpsmtpd-0_96-3_el7_sme, qpsmtpd-0_84-18_el7_sme, qpsmtpd-0_96-10_el7_sme, qpsmtpd-0_84-19_el7_sme, HEAD
* Sun Feb 7 2016 stephane de labrusse <stephdl@de-labrusse.fr> 0.84-18.sme
- Build new rpm for sme10

1 stephdl 1.1 From 5c3bd220aaccd49ebbcbfb4324ac4c789d116273 Mon Sep 17 00:00:00 2001
2     From: jaredj <jaredj@nmgi.com>
3     Date: Sat, 28 Feb 2009 15:13:46 +0800
4     Subject: Run hook_reset_transaction after all connections
5    
6     This makes hook_reset_transaction a bit more useful by running it on
7     disconnections. It also ensures that hook_disconnect runs when the
8     client disconnects without QUITing.
9     ---
10     lib/Qpsmtpd/SMTP.pm | 1 +
11     lib/Qpsmtpd/TcpServer.pm | 4 ++++
12     lib/Qpsmtpd/TcpServer/Prefork.pm | 5 +++++
13     3 files changed, 10 insertions(+), 0 deletions(-)
14    
15     diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm
16     index f669055..0735f0c 100644
17     --- a/lib/Qpsmtpd/SMTP.pm
18     +++ b/lib/Qpsmtpd/SMTP.pm
19     @@ -576,6 +576,7 @@ sub quit_respond {
20     sub disconnect {
21     my $self = shift;
22     $self->run_hooks("disconnect");
23     + $self->connection->notes(disconnected => 1);
24     $self->reset_transaction;
25     }
26    
27     diff --git a/lib/Qpsmtpd/TcpServer.pm b/lib/Qpsmtpd/TcpServer.pm
28     index 07d8d16..de3504f 100644
29     --- a/lib/Qpsmtpd/TcpServer.pm
30     +++ b/lib/Qpsmtpd/TcpServer.pm
31     @@ -115,6 +115,10 @@ sub read_input {
32     alarm $timeout;
33     }
34     alarm(0);
35     + return if $self->connection->notes('disconnected');
36     + $self->reset_transaction;
37     + $self->run_hooks('disconnect');
38     + $self->connection->notes(disconnected => 1);
39     }
40    
41     sub respond {
42     diff --git a/lib/Qpsmtpd/TcpServer/Prefork.pm b/lib/Qpsmtpd/TcpServer/Prefork.pm
43     index 28f60dc..2728cea 100644
44     --- a/lib/Qpsmtpd/TcpServer/Prefork.pm
45     +++ b/lib/Qpsmtpd/TcpServer/Prefork.pm
46     @@ -35,6 +35,11 @@ sub read_input {
47     or $self->respond(502, "command unrecognized: '$_'");
48     alarm $timeout;
49     }
50     + unless ($self->connection->notes('disconnected')) {
51     + $self->reset_transaction;
52     + $self->run_hooks('disconnect');
53     + $self->connection->notes(disconnected => 1);
54     + }
55     };
56     if ($@ =~ /^disconnect_tcpserver/) {
57     die "disconnect_tcpserver";
58     --
59     1.7.2.2
60    

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed