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

Contents of /rpms/qpsmtpd/sme9/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 - (show annotations) (download)
Sat Feb 2 00:59:44 2013 UTC (11 years, 9 months ago) by slords
Branch: MAIN
CVS Tags: qpsmtpd-0_84-14_el6_sme, qpsmtpd-0_84-16_el6_sme, qpsmtpd-0_84-12_el6_sme, qpsmtpd-0_96-7_el6_sme, qpsmtpd-0_96-2_el6_sme, qpsmtpd-0_84-13_el6_sme, qpsmtpd-0_84-6_el6_sme, qpsmtpd-0_84-18_el6_sme, qpsmtpd-0_84-9_el6_sme, qpsmtpd-0_84-4_el6_sme, qpsmtpd-0_96-11_el6_sme, qpsmtpd-0_84-15_el6_sme, qpsmtpd-0_96-4_el6_sme, qpsmtpd-0_96-3_el6_sme, qpsmtpd-0_96-10_el6_sme, qpsmtpd-0_84-17_el6_sme, qpsmtpd-0_84-7_el6_sme, qpsmtpd-0_96-5_el6_sme, qpsmtpd-0_84-10_el6_sme, qpsmtpd-0_84-8_el6_sme, qpsmtpd-0_96-1_el6_sme, qpsmtpd-0_84-5_el6_sme, qpsmtpd-0_96-6_el6_sme, qpsmtpd-0_96-8_el6_sme, qpsmtpd-0_84-11_el6_sme, qpsmtpd-0_96-9_el6_sme, HEAD
* Fri Feb 1 2013 Shad L. Lords <slords@mail.com> 0.84-4.sme
- Update spec so building on rhel6 works [SME: 7263]

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